Close

Reimplementing the 74x181

A project log for ONAN 1111

A Retrobrew TTL CPU - Classic yet Baroque

Nicolas REIMENNicolas REIMEN 09/04/2022 at 13:121 Comment

The 74181 is the classic-est of classic 4-bit slice ALU chips. Initially, I thought I might use these chips in the design. However, I decided against it when I came across a batch of old soviet chips that made it reasonably simple to re-implement the venerable ALU with gate chips. The soviet chips I found are КР531ЛР9s (KP531LR9 = 74x64 clones) which contain a combination of AND and NOR gates making it relatively straightforward to implement the binary functions of the 74181. The schematic can be found in the "Files" section, as well as the PCB layout.

The first stage of the 74181 contains 4 identical elements (1 for each bit). Each of these elements are implemented using 2 КР531ЛР9s (for a total of 8). The second stage contains functions of increasing complexity which perform the equivalent of a carry-lookahead, plus a few other things. In total, I used 4 КР531ЛР9s, 12 КМ155ЛА3 (4 NAND gates, = 74x00) and 4 КМ155ЛА4 (3 triple-input NAND gates = 74x10) to implement the 2nd stage.

Here is a picture of the finished board:

The first stage is the set of 10 vertical chips in the upper half of the board. The second is the set of 20 horizontal chips below. All other components are only for display purposes and will not be included in the final version of the ALU board.

The Green LEDs on top are the two 4-bit inputs (A and B). The 16 red LEDs on the right indicate what function the ALU is currently executing, based on the S input. Only one of these LEDs is lit at a time. They are driven by a pair of К555ИД7s (=74x138) located right of the green input-display LEDs. At bottom, from left to right are located: the output display (4 green LEDs), various indicator signals and finally, 8 red LEDs showing the output of the first stage and input of the second. These signals play a central role in the operation of the ALU, as explained in Ken Schirriff's excellent blog post on the 74181.

The ONAN 1111 CPU will contain 5 boards equivalent to this one (5 slices of 4 bits = 20 bits wide). These final ALU boards will have a little more logic to handle shifting operations (which the 74181 does not do).

Discussions

zpekic wrote 10/05/2022 at 01:28 point

So this board is the exact functional equivalent of 74181 with its active low, active high, etc. peculiarities? Will all of those 16 functions be actually used by the CPU? 

  Are you sure? yes | no