Shoppa, Tim wrote:
background:
I'm revisiting a homebrew microcoded CPU that I started
thinking about a few years ago (with the intention of making it
predominantly from LS-TTL if I can get enough parts together). I hadn't
considered hardware multiply or divide before (the intention was just to
have library routines in software), but if it was relatively common on
systems between the mid-70s and early-80s then maybe I'll include
something. Simple shift-add multiply with unsigned integers is simple
enough, but I'm thinking that if I do it at all it'd be nice for it to work
with signed integers, too, so I've got some head-scratching to do :-)
As to "common", if your CPU starts looking like a 68000 or 8086, then
you'll
probably have both signed and unsigned multiply and divide.
Yes, as I mentioned to Richard, I always forget just how early the 68k was,
given the feature-rich nature of the design. I wonder if it was still
shift-add or did something more complex.
(I think the original x86 had some instructions to
assist with BCD multiply?)
Hmm, possibly. Hazy memory of something like that in later x86, but I don't
recall if it was in the early ones.
e.g. PA-RISC was in production from 1986 through 2008,
was a high performance
micro, and had no hardware multiply. If you're looking for a good model for
implementing in 74xx series logic, keep in mind that in 1986, HP was selling their
new workstation, the HP 9000 840, which had its CPU largely implemented in 74F
series logic (I think there were some PAL's etc. but my memory fades).
That's a useful one to know about! Was it a microcoded design, or was the
instruction decoding more logic-based? (which might explain the PALs!)
IMHO unsigned multiply will usually be most
appropriate for the bit twiddling
a micro has to do. BUT... if you're gonna do Fortran benchmarks, you
probably want signed multiply. (This is a sore point when it comes to
implementing bit-twiddling multiplies in Fortran. Understandable because
Fortran was designed around ones-complement processors.)
That's also useful. Booth's algorithm for signed numbers doesn't look too
bad - but unsigned multiply is a lot easier :-)
I suspect that when it comes to it I'll build everything around eurocards,
as I have a few 16-slot 64w eurocard backplanes in storage. The way it's
looking at the moment, I'll have a spare input to the ALU's output mux, so
perhaps I'll expose one of those to at least a couple of slots on the
backplane (along with ALU A and B input paths) and can then add the logic
for hardware mul/div later on.
cheers
Jules