Skip to content
The highlighted area shows (from left to right): red LED showing carry flag state (illuminated); Orange LED for use_carry (not illuminated); Orange LED for carry_set (illuminated); 74LS00 quad NAND gate IC; 74LS86 quad XOR gate IC. Considering the limited space remaining on the intended PCB for this ALU and the small and fairly simple programs that this CPU will be running I’ve only opted to use one of these remaining flags at this time.Here are a few ALU alternatives that I’d like to add but will have to wait till my next CPU.Breadboard construction was initially ok when testing each chip but soon got messy.So here is my design for a soldered perfboard layout (click on the image to get a bigger picture). He has two registers, A and BA SUBtraction takes a little more work. Blinkenlight plugins on both boards displayed A, B and C register content, data bus values, status & control flags and the contents of the ‘S’um register. This initial venture into CPU design being very much guided by Ben Eater’s At the core of this ALU are two 4-bit adders (74LS283’s) with the carry-out of one fed to the carry-in of the other to create an 8-bit adder. Look at the 1 – c part of that equation and remember that c is either a 1 or a zero and you’ll see that all we’re doing is inverting c. If c is 1 then 1 – 1 = 0 and if c is 0 then 1 – 0 = 1.It’s interesting to refer back to the ADD and SUB without carry operations. Why, we’re sending a 1 as carry using the carry_set control signal.So, in answer to the question, yes, we can do the DEC operation in exactly the same way we do the INC operation.We can now start designing some silicon. That 1 is provided by a control line that is held low for addition and high for subtraction. They just provide the two input values to each addition or subtraction.This initial design provides basic arithmetic but no logic. This gives his design the ability to add and subtract 8-bit numbers. These could then be set to high or low to control both boards and test each ALU function. These are the schematics for Ben Eaters 8-Bit Computer. I considered adding bitwise operations such as AND, OR or shift left/right commands but didn’t expect to use them on this simple 8-bit CPU. I tend to refer to these as PCBs but there are no tracks on the board. That 1 is provided by a control line that is held low for addition and high for subtraction. All connections are made by soldering wires to each pin of each component.I have used the same 8cm x 12cm double-sided perfboard as I used for Along with the logic chips, diodes, ribbon cable connectors and pull-up/down resistors (using a single-in-line SIL array to save space) I have also added a couple of Wiring on the board appears more complex than the register board but that is largely due to the data pins of most of the IC’s used not being in a neat A0 to A7 order. Converted to an addition this becomes A + ~0 + 1 – 1. These control flags are:-That left two remaining status/control bus flags available for further functions. We then combine the outputs from the AND gates with an OR gate.However, this circuit would mean using three ICs and I’d like to keep the chip count down if possible. All we need is to add a control signal to clear the B register and another control signal to send an explicit 1 to the carry in. Connecting the Here is the completed ALU board on the right with the registers board on the left and the clock modules and test control breadboard in the background. We’re basically doing an ADC but with the carry in set explicitly to one rather than coming from the carry flag.Well, that was easy. Modifications have been, or will be made, so that the memory is 256 Bytes instead of 16. They just provide the two input values to each addition or subtraction.This initial design provides basic arithmetic but no logic. ALU … And so that’s subtraction and multiple subtractions could be used to provide a divide function, if checks on the resulting sum of each subtraction were possible.I should add that the contents of the A and B registers remain unchanged when arithmetic is performed in the ALU.