Digital Tutorial Lesson 6: Building a Ripple-Carry Adder Using Your Reusable Digital Parts
What You Will Learn
In this tutorial you will use the reusable digital half adder and full adder devices, which you created in the previous tutorial lesson, to build a four-bit ripple-carry adder circuit.
You can use multiple full adders to build an N-bit adder circuit. Each full adder inputs a Cin, which is the Cout of the previous adder. This kind of adder is called a ripple-carry adder, since each carry bit "ripples" to the next full adder. Note that the first (and only the first) full adder may be replaced by a half adder (under the assumption that Cin = 0).
Building a Ripple-Carry Adder
The following is a list of parts needed for this part of the tutorial lesson:
Part Name | Part Type | Part Value |
---|---|---|
A0 - A3 | Digital Input | 1-bit |
B0 - B3 | Digital Input | 1-bit |
S0 - S3 | Digital Output | N/A |
Cout | Digital Output | N/A |
U1 | Reusable Digital Device MyHA | Defaults |
u2 - U4 | Reusable Digital Device MyFA | Defaults |
In this tutorial lesson, you will build a 4-bit ripple-carry binary adder using the half adder and full adder devices you created in the previous tutorial lesson. To find and place your new adder parts, you can go to the Parts Bin of the Toolbox and search for "MyHA" and "MyFA" alphabetically under the letter "M".
Alternatively, you can open the "Select Device Dialog" by choosing Menu > Parts > Select Part.... If you know the device's name, you can type it in the box labeled Name and click the Find button. Or you can use the device database filter and type in a few letters, e.g. "My" to find both of your devices.
Place all the parts listed above in the schematic editor and connect them as shown in the figure below. Note that the half adder block U1 is used for the least significant bits A0 and B0, and the full adder block U2, U3 and U4 are used for the more significant bits. The "Cout" output of the last full adder block U4 summing the most significant bits A4 and B4 is taken out as the "Carry" output of the whole circuit.
Testing Your Ripple-Carry Adder Circuit
You can run different simulation scenarios by inputting 4-bit binary numbers to A's and B's. The figures below show two of such scenarios. In the first figure, A = 1001 (9) and B = 0011 (3). The sum is 1100 representing the decimal number 12. In the second figure, A = 1011 (11) and B = 0111 (7). The sum of these inputs must be the decimal number 18, which is equivalent to 0010 with a carry of 1 in a 4-bit system (i.e. 2 + 16), which can be seen in the figure.