|
AMD's Am9511 Arithmetic Processor
Although I can't really confirm, I suspect this was the first ever "Math Coprocessor". It is really a micro-processor within itself, having a set of opcodes, registers and internal micro-code rom that allows this chip to mathematically manipulate bytes of data within it's memory, which is organized as machine stacks. Data coming from the outside world is "pushed" into the processor and each successive byte pushes the former down one notch. Once the command is issued to the command register, the results can be "popped" off the stack back to the requesting device, generally the board's CPU. This chip can handle math in 3 main formations:
In 16-bit signed integer mode, numbers from -32768 thru +32767 can be used. For operations not requiring larger values, these execute the fastest.
For numbers which are still integers yet require larger values, a 32-bit wide signed integer can process values from -2,147,483,648 to +2,147,483,647. This is referred to as "double precision". Execution times for these format math problems take longer to execute than 16-bit, but are significantly faster and carry more accuracy in digits than their floating point equivalents. Because of the number of bits, integers with exacting accuracy can be used. 32-bit floating point values are handled on a vastly different format. 4 bytes of information are used, the MSB is the Exponent of the number. D7 contains the sign of the Mantissa or last 3 bytes, and D6 contains the sign of the Exponent. Therefore, exponents can have the value of -64 to +63. The Mantissa is "normalized" so that it becomes a value from 0.5 (or 0.0 depending on the processor) to 1.0.
The Mantissa is then multiplied by 2 raised to the exponent to create working value. However all the internal math is done with the numbers in this format.
What exactly is a floating point number? More on it's usage: The value for π or Pi as it's called is an infinitely cycling decimal value which starts with 3.141592654 and continues indefinitely. This value can be represented in floating point notation. However, it is important to note here that with 4 bytes of information, 3 for the Mantissa digits following the decimal lose accuracy as they simply can't all be represented in such a small place. The Am9511 contains its own representation of π internally for operations. How exactly does this work? The mantissa is normalized, that is the resulting binary value is rotated so the top-most bit of the mantissa is "1". Each time the value has to be rotated to the left, the exponent is decremented so that that value remains correct. In the case of the Am9511, the top-most bit of the mantissa has the value 0.5, the next bit is half of that, or 0.25. The next bit 0.125, next is 0.0625 and so forth. For every "1" in the mantissa you add that value.
For example the floating point number 10.000 would render as $04 $A0 $00 $00.
List of Commands 16-bit Integer (Fixed Point)
32-bit Integer (Fixed Point)
32-bit Floating Point Operations
Conversion Operations, Push, Pop and Exchanges
PDF Documentation for the Am9511
Simple Test Program Here's the 9511 TEST PROGRAM from the MCB2 manual (see Documentation page) This loads the Am9511 with 2 each 16-bit operands and commands a 16-bit multiply operation, then retrieves the results. This uses the Monitor program to interact.
9511 TEST PROGRAM THIS PROGRAM USES THE CDL/TDL/STP MONITOR TO TEST THE 9511 HIGH SPEED ARITHMETIC CHIP. O AND I ARE MONITOR INPUT AND OUTPUT COMMANDS. CR IS A "RETURN" KEYSTROKE O7C,03 CR (LSB) ; LOAD FIRST BYTE OF FIRST 16 BIT WORD Notes: I tried this out on my board with the Am9511, it works as advertised - a simple arithmetic test. It does the job of verifying the basic functionality of the chip with your MCB. By changing the command byte issued to port $7D, you can also try a 16-bit addition, subtraction, and division. Software Downloads:
MATHPAK1.ASM - This is a 2,336 byte program that occupies a 4K rom from $2000-$2FFF in IC-23 on the Space-Time Productions MCB.
Notes:
AM9511.ASM - This is a storefront program I created for the Am9511, offering a set of subroutines to carry 16-bit integer, 32-bit integer, and 32-bit floating point numbers in 2-byte and 4-byte format in and out of the Am9511. There are no ASCII conversion routines included, however it does offer the 16-bit math portion not incorporated in the DAI Computer, which assigned all integers as 32-bit.
What about BASIC using the Am9511? I want to take a moment to acknowledge the programming prowess of David Collier and his amazing 8080 coding on the DAI Computer. Reading the PDF files of the source code is quite impressive.
Space-Time Productions Am9511 Hardware Implementation of the Am9511 Arithmetic Processor on the Space-Time Productions MCB is done using I/O mapping and /PAUSE -> /WAIT timing and control. Address line AB0 is tied to the Control/Data input so that I/O address $7C connects the Z80 databus to the Am9511 Data Register, $7D connects the Z80 databus to the Am9511 Command Register. The /PAUSE signal which is output from the Am9511 is tied to the Z80's /WAIT input pin so that when the Am9511 is processing an instruction, the Z80 goes into a "hold" mode where the last instruction is ended, and the processor doesn't execute the next program step until the /WAIT signal is released. While there are disadvantages to this design, it uncomplicates the usage by allowing the Z80 code to function quite transparently to the Am9511. Once the Z80 writes the Command Word into the Am9511, the /PAUSE signal causes the Z80 to /WAIT and then when released, the Z80 simply reads the results of the function or calculation back in. Although wait times of only a few clock cycles, all the way up thru a full 1.3 millisecond (depending on the gravity of the calculation involved), the Z80 code simply sees it as feeding the arguments into the Am9511, commanding the calculation take place, then "immediately" reading the results back. In actuality, the Z80 has coasted while the Am9511 performed the calculation, but it allows linear programming to be used. While there are other hardware methods to connect the Am9511, they complicate the code in that a calculation is requested, but the processor must have some pre-determined tasks it can handle without the results of that calculation while it waits for the outcome. I've not seen example code for this method, but I can imagine it might be somewhat arduous. The end-of-calculation pin could be monitored by an input port of a p8255, but the Z80 would have to continue on with its program without the needed work of the Am9511. This is probably one of the earliest forms of parallel processing, but it leaves the programmer entirely responsible for the tasks at hand while waiting. This chip tends to run rather warm when compared to the other ICs on the MCB board, especially so when the board is being overclocked. It has a +12 Volt input pin as well as a +5 Volt input pin. Measure your power supplies carefully, as a few tenths of a volt over will cause the chip to heat up to the point where it can burn to the touch. Yes, I did do this. I dialed in the +12 and +5 to as accurate as I could get them by measuring the delivered voltage at the chip(s). The Am9511 still runs warm, but not hot enough to harm anyone. I'm thinking the addition of some heat sink paste and a sizeable sink might be in order to get the chip to last a long time. These chips at this writing vary but run around $85-$120 USD.
That's all I have at the moment, be sure to send your comments and questions via email on the contact section of my site. Thanks!
Copyright © 2004 -
Other information credited to its sources. |