
Inside the vintage 74181 ALU chip: how it works and why it's so strange - dwaxe
http://www.righto.com/2017/03/inside-vintage-74181-alu-chip-how-it.html
======
gumby
Wow, what a blast from the past. I remember gazing at the data book as a
kid[+], wondering what sort of super genius came up with some of those bizarre
operations and wondering when I'd learn enough / be smart enough to want to
use them all.

Never did get around to figuring it out and now I don't have to!

[+] Once upon a time you could write to TI, National etc and they would send
you data sheets and even whole databooks for free. (I think I remember buying
a set of TI TTL datebooks at a junk shop, but I think National or Linear would
send theirs for free). Since I had to pay for parts out of my pocket money
there was a _lot_ of pouring over designs before getting parts and trying to
build anything. I guess this is the equivalent of the folks who had to submit
card decks once a day.

~~~
crb3
In my assembler and technician days I stayed alert to visits by distributor
reps: older but good databooks were likely to be found in the trashbins
shortly thereafter, ready to be fished out and taken home.

These days, for a given part-number, Googling " _part-number_ pdf" returns
links to where datasheets can be downloaded. This is a distinct improvement:
disk space is easier found than shelf space.

~~~
userbinator
You can still find scans of the databooks at archive.org (and if you have
some, you are encouraged to contribute...), especially useful for information
on obsolete parts whose datasheets were never available separately in digital
form.

------
payne92
I remember using this chip in college in a "build a CPU from scratch" course.

Most teams implemented these elaborate instruction decoding methods, mapping
000 -> addition, 001 -> and, etc.

We just jammed 4 bits from our opcode right into the ALU select, so we ended
up with all of the weird operations this writeup documents. Worked great; our
CPU was almost "too simple".

Woz would have approved, I think.

~~~
zeta0134
I built a working computer in Minecraft, and ended up going with exactly that
because the decoding circuits would have been too complex for the project
otherwise: [https://www.youtube.com/watch?v=s9XT-
dyfEiU](https://www.youtube.com/watch?v=s9XT-dyfEiU)

This build could be improved in a lot of ways as I've grown as a developer and
engineer in the years since I built it, but back then, "Jam the opcode bits
into the ALU" was the simplest thing I could think of at the time, and worked
quite well. If I ever tackle something like this again (a year's worth of
Redstone is... I'm not sure I have the patience for that anymore) I'd like to
try an 8-bit system just for the challenge of packing the opcodes down a bit.
The 16-bit opcodes I used here were rather inefficient.

~~~
kbenson
I'm seriously wondering at this point how many college CS assignments meant to
be completed in Logic Works (or some equivalent) have instead been implemented
in Minecraft. If Minecraft existed when I went through college, I imagine it's
one of the things I might have attempted (at least for the simpler
assignments).

Kudos to any teachers that use Minecraft as a neat visual aid. That would have
been awesome.

------
sehugg
The custom CPU for Cinematronics (Vectorbeam) games used three of these (from
[https://archive.org/details/ArcadeGameManualRipoff](https://archive.org/details/ArcadeGameManualRipoff))

 _The ALU is implemented using three 24LS181 (N6M6L6) function generators,
three 74LS85 (N9,M9,L9) 4 bit magnitude comparators, and a 74S182 (L4) look
ahead carry generator._

~~~
kens
It amazes me that making a 12 bit processor out of TTL was still a reasonable
thing to do in the late 1970s.

------
userbinator
I think the key insight that lead to its development is the realisation that,
if you have a carry-lookahead adder/subtractor, P and G already provide OR and
AND (along with their negations), and taken together without the carry
lookahead logic enabled, give XOR.

An existing article about how the '181 works starts here and continues for a
few pages:

[http://6502.org/users/dieter/a2/a2_3.htm](http://6502.org/users/dieter/a2/a2_3.htm)

