I will be using 74LS181 ICs for my 16-bit ALU and I bought some today in a local hobby store. I decided to give a try with this little breadboard setup. It’s not really a CPU but it was fun.
The inputs are set by the DIP switch. Switches 1-4 set the A input and switches 5-8 set the B input to the ALU, with 4 and 8 being the least significant bits. The chip’s operation selector (pins 3-6) is hardwired to H-L-L-H and mode selector (pin 8) is hardwired to ground which sets the ALU mode of arithmetic addition (binary A plus B in two’s complement representation). The row of green LEDs is there to indicate the output (here the least significant bit is the one on the left) and the red LED is a carry flag.
Resistors next to the IC are 10k ohm DIP switch pull-ups. When a particular switch is off, +5V (and only) is tied to a corresponding input terminal (asserting binary zero digit as inputs to the 74LS181 are active low). With a switch on, a corresponding input terminal receives direct connection to ground, current flowing from +5V bus to ground is limited by the pull-up resistor, pin voltage is zero volts and the input value is binary one.
Resistors around LEDs are around 200 ohm each and they limit the current flowing through the LEDs to 20 or so milliamps.
It this example, A input is set to 0011 and B input is 1111. The result of binary addition of these two numbers is 10010, which is 0010 and a set carry flag in a 4 bit representation. This is indicated by the row of green LEDs (least significant bit outer left) and a red carry LED (which, believe me or not, is lit).
Ultimately, I will design with four 74LS181s and a lookahead carry generator. The 74LS182 is a lookahead carry generator typically used with 181 but looks like it is hard to get, at least here in Poland. I will probably buy it off US ebay or think of another way of generating outgoing carry from 16-bit operations. Just connecting Cn and Cn+4 inputs and outputs of individual 181s is unacceptable due to high latency of such ripple carry setup.