This was a mini project done over the course of a weekend after having had my interest in computer hardware spiked due to a course in computer system architecture that I was taking.
Let's do a quick rundown on how to create a basic 4-bit Ripple Carry Adder (RCA).
Let's start from the beginning by adding two 1-bit binary numbers and then draw and fill in a function table.
Notice how we can express the sum
We can now easily construct a circuit that adds two 1-bit numbers:
The circuit in the above figure is called a half adder A half adder does not do the job though because it can't take into account potential carry in bits, that's not good!
So let us improve our half adder by complementing the circuit with what is missing. To do what we must first find out what's missing and how to add it. Let's investigate by creating a truth table and a Karnaugh map.
After having generated a boolean expression in disjunctive minimal form we obtain the following expressions for the sum and the carry:
We can now easily construct a circuit to add two 1-bit numbers where we can also take into account a potential carry in bit.
Okay, we know how to construct a circuit that adds two 1-bit binary numbers where we also take into account any incoming carry. The cool thing about a full adder is that once you know how to build one you can just copy it several times to construct an n-bit adder. In the case of a 4-bit adder we just have to replicate it three more times!
In the below figure we can see the actual circuit. It may at first glance seem advanced but if you just spend a
little bit of time with it, it'll become easy to understand. The basic component of the adder is the full adder which generates a
sum bit and a carry bit. The only thing we're doing in the 4-bit RCA is to connect four full adders. The carry from the result of one full adder
gets fed right into the next full adder in line. In the end we end up with four
sum bits
Now that we know how a Ripple Carry Adder works and is built, let's actually build it on a breadboard!
The left most switch in the below wiring diagram represents the four bits
On the image below we can see the final product in real life.
The first number (right-most switch) is
-
2x 74HC86 Quad two-input XOR-gate (CMOS)
-
2x 74HC08 Quad two-input AND-gate (CMOS)
-
1x 74HC32 Quad two-input OR-gate (CMOS)
-
2x 4-position DIP-switch (SPST)
-
5x LEDs
-
5x 1k$\Omega$ resistor (for LEDs)
-
5x 10k$\Omega$ resistor (pull-up resistors for IC inputs)
-
1x Breadboard
-
24 gauge wire
-
5v power source