Intel 8231 Coprocessor ramblings.

General discussions related to the Altair 8800 Clone

Intel 8231 Coprocessor ramblings.

Postby KenF » July 1st, 2022, 9:01 am

After a long search, I finally found an Intel 8231A math coprocessor not offered for hundreds of dollars by scalpers. He had 4 so I bought them all. And surprisingly, they all work. I built a coprocessor board in the simple configuration (async) and just as surprisingly, it also worked - not something guaranteed with some of my projects.

But... While all four ICs work the same, they have some subtle differences with the official Intel spec sheet. The stack on the chip pushes and pops in a strange manner or not at all and contains other data that is easily identified, but shouldn't be there. Assuming that the defugality was caused by my design or circuit, I spent quite a while with a logic analyzer watching data come and go, finally deciding that the interface was fine.

The specs sheet is labeled 8251A just as the chips themselves, so the difference is strange. Unfortunately, despite long sessions with DuckDuckgo and even Google, I can find nothing anywhere besides that single spec sheet. I have all the original Intel manuals from that era and the 8231 is not referenced anywhere. That may be because it is not really an Intel IC, but was purchased from AMD and rebranded.

By lots of testing, I know how it works even if it doesn't match the specs and can now write a library for it. But, anybody ever used one? Or better yet, know of some website that might have an ancient article along the lines of "Programming the Intel Math Coprocessor, or "The weirdness of the 8231 explained."

???
KenF
 
Posts: 30
Joined: April 25th, 2022, 11:13 am

Re: Intel 8231 Coprocessor ramblings.

Postby BillO » July 1st, 2022, 5:18 pm

Interesting, but I may b missing something.

Did you mean to say that the chips are marked as 8215A chips and not as 8231s?
BillO
 
Posts: 136
Joined: November 11th, 2020, 6:29 am

Re: Intel 8231 Coprocessor ramblings.

Postby KenF » July 3rd, 2022, 8:37 am

Sorry, typo. 8231a is the chip number. For some reason I automatically write 8251 even when I program. If it is muscle memory, then it has lasted a long time - I haven't used an 8251 in decades.

Still working on the problem.
KenF
 
Posts: 30
Joined: April 25th, 2022, 11:13 am

Re: Intel 8231 Coprocessor ramblings.

Postby KenF » July 5th, 2022, 8:45 am

So the spec sheet lied...

Well, probably not. I suspect it was written back in the time when a rare 4 mhz 8080 was the hottest 8 bit thing going. The Intel notes say that the 8231A can be run in either interrupt mode or using the Ready line as sync. This allows for a mismatch between clock speeds of both CPU and APU. And it does. My 8080 running at 2 mhz (in Ready configuration) works with the 8231 running either 3 mhz or 4 mhz. It also works with an 8085 at the usual 3 mhz.

However, an 8085 at 5 mhz does not and I tried 4 different CPUs with all four APUs that I bought. It almost works, giving the right calculations but with the command opcode jammed onto the stack - and sometimes with two or more copies of the just-used opcode pushed also. Playing with the strange behavior, I wrote a driver that checked for and threw away the extraneous bytes, pulling the real results into place for use, but this is just too kludgy to depend on. Changing the 10 mhz crystal on the 8085 for an 8 brought the situation back to normal.

So, my assumption is that the APU is too slow (or the 5 mhz 8085 is too fast) to both receive data and internally decide to tell the CPU to stop for a moment. And with the lack of a return handshake in time, the 8085 just plows on to the next instruction.

So, the use of an 8231A APU requires the degrading of some speed on the system, but the gigantic gain (huge!!) in both smallness of code and speed of calculation over software multiply and divide (not even to mention square roots and trig) makes the sacrifice well worth the loss of clock speed if the user code needs mathematical functions besides add and subtract.

So... A software driven latch that detects the oncoming APU calls and instantly swaps clock speed for the needed time? Kind of an 8bit speed zone with both Reduce Speed and Resume Speed signs at each end. Hmmm....
KenF
 
Posts: 30
Joined: April 25th, 2022, 11:13 am

Re: Intel 8231 Coprocessor ramblings.

Postby Wayne Parham » July 5th, 2022, 2:41 pm

That is so interesting, Ken!

What is perhaps as interesting to me as the technical details is the history of such a device.

Microprocessors were just so new when the 8080 was introduced, there couldn't have been much demand for an FPU. They weren't all that common in minicomputers back then - only for engineering/scientific use, obviously - and probably sold in less than 10% of the minicomputers of the day. So for micros, I'm guessing it was more like 0.1% to maybe 1% in the 1970s. I'd lean more towards 0.1% or even less.

That makes you one of the very few people with experience with this chip. You'd have been a rare bird in the 1970s. Much more so now. I'd guess the number of people with your 8231 experience here in the 2020s shrinks to, well, down to just you. Maybe a dozen guys on the planet building stuff using an 8231. Maybe.

Kudos!
Wayne Parham
 
Posts: 240
Joined: March 18th, 2022, 3:01 pm

Re: Intel 8231 Coprocessor ramblings.

Postby KenF » July 5th, 2022, 4:46 pm

Actually, I was in my 20s in 1975-76 when we built our first 8080 S100 clones. (A real Altair wasn't an option since they were backordered almost to forever.) During the years that the 8080/8085/Z80 was viable, I never even heard of a math coprocessor. (Or maybe I have completely dropped the memory.) As I have said, there is no reference to one in any of my old manuals. Besides, Wikipedia gives that the price of the 8231 back then was between $350 and $400. That was a ton of money in the 70's and almost equivalent to what we paid to build each entire system. And if you got one, what would you do with it? No software would try to detect it and almost everything we ran was written by some young nerd, just to use a word that hadn't been invented yet. And fast math was not high on the list of nerdish needs in those early days of hardware hacking.

I never saw a coprocessor, and I saw a lot of kitchen table built 8080s along with the splattering of Altairs and Imsaiis. Had at least thirty in our club.
KenF
 
Posts: 30
Joined: April 25th, 2022, 11:13 am

Re: Intel 8231 Coprocessor ramblings.

Postby KenF » July 8th, 2022, 8:29 am

The abilities of this ancient and apparently first math coprocessor are quite impressive. My original IBM PC (1982) eventually got an 8087 coprocessor when it became available and the difference between using it and not was about 10 to 1. Of course, unlike today, software did not automatically use it and most did not even look for a math chip.

After a few days of haphazard programming with the chip in an 8080/85/Z80, the difference is more like a zillion to one. With no multiply or divide instructions, those operations (sans APU) have to be done in a loop. 10 * 8 is no problem - just add 10 to itself 8 times in 8 bit registers. But for 16 bit operations, something like 32768 * 15879 takes a LONG time. Looping through a set of opcodes thousands of times can take a lot of seconds, or even minutes. And if the need is for 32 bit math, forget it. Buy a five dollar calculator.

Of course, the proper way to multiply and divide is not looping, but binary math. Much faster, if not fast, but the pages and pages of ANDs, ORs, XORs and shifts is a programming nightmare if you are just coding for fun.

But... With the 8231, a full multiply of two 32 bit numbers requires only 16 bytes pushed onto the stack of the APU, a command byte twice, and a pair of very short (milliseconds) waits. Then pop off the 8 bytes of the result. For a single operation, it comes back with the result with no apparent delay.

I may make a short video of the difference - kind of like those GeekBench demos that YouTubers make of all new computers. I think it would be quite impressive.

All that being said, if you have an eight bit processor and need to do number crunching, you have probably chosen the wrong platform.

As an aside, a blogger contacted me with the info that a company called Rochester Electronics makes a clone of the 8231 (or more properly, the AMD AM9511 which Intel licensed) and is available for purchase even now. The problem is, their website gives a price of $132 for a quantity of 1. Original chips can be found for far less on EBay.
KenF
 
Posts: 30
Joined: April 25th, 2022, 11:13 am


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 19 guests

cron