Objective:: About Modelsim
Objective:: About Modelsim
The objective of the lab is to implement a full-adder using two half-adders and implementation of 4-bit Ripple Carry Adder using four full-adders.
About ModelSim: ModelSim is a widely-used logic simulation tool for verification and debugging of digital circuits.
Theory: Half-Adder:
A half adder adds two one-bit binary numbers A and B. It has two outputs, S and C (the value theoretically carried on to the next addition); the final sum is 2C + S. The simplest half-adder design, pictured on the right, incorporates an XOR gate for S and an AND gate for C. Half adders cannot be used compositely, given their incapacity for a carry-in bit. Circuit:
b 0 1
s 0 1
co 0 0
3 4
1 1
0 1
1 0
0 1
Full-Adder:
A full adder has three inputs. In addition to the two addends, there is also a carry in input, which adds the bit carried from the previous column, as in the middle column in the following example: 101 +101 1010
Circuit:
Schematic and symbol of a full adder circuit using two half adders.
ci 0 1 0 1 0 1
s 0 1 1 0 1 0
co 0 0 0 1 0 1
7 8
1 1
1 1
0 1
0 1
1 1
Waveform:
Dataflow diagram:
4-bit Ripple Carry Adder (RCA) using four Full-Adders Ripple Carry Adder (RCA):
It is possible to create a logical circuit using multiple full adders to add N-bit numbers. Each full adder inputs a Cin, which is the Cout of the previous adder. This kind of adder is a ripple carry adder, since each carry bit "ripples" to the next full adder. In case of 4-bit RCA, four full-adders are used.
Full-adder code:
Waveform:
Dataflow diagram: