0% found this document useful (0 votes)
75 views9 pages

Objective:: About Modelsim

The document describes implementing a full-adder using two half-adders and a 4-bit Ripple Carry Adder (RCA) using four full-adders in ModelSim. It provides details on half-adders, full-adders, and how RCA works by connecting the carry output of one full-adder to the carry input of the next full-adder. Code examples and testbenches are given to demonstrate a half-adder, full-adder, and 4-bit RCA in ModelSim along with corresponding waveform outputs and dataflow diagrams.

Uploaded by

Zakria Alam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views9 pages

Objective:: About Modelsim

The document describes implementing a full-adder using two half-adders and a 4-bit Ripple Carry Adder (RCA) using four full-adders in ModelSim. It provides details on half-adders, full-adders, and how RCA works by connecting the carry output of one full-adder to the carry input of the next full-adder. Code examples and testbenches are given to demonstrate a half-adder, full-adder, and 4-bit RCA in ModelSim along with corresponding waveform outputs and dataflow diagrams.

Uploaded by

Zakria Alam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

Objective:

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:

Schematic and symbol of a half adder (HA)

Truth table of Half-Adder:


S.no 1 2 a 0 0
1

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.

Truth table of Full-Adder:


S.no 1 2 3 4 5 6 a 0 0 0 0 1 1 b 0 0 1 1 0 0
2

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

Half-adder code in model sim:

Full-adder code through calling two half-adder modules:

Testbench file to test Full-adder results:

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:

RCA code through four Full-Adder modules:

Test file to test the RCA module:

Waveform:

Dataflow diagram:

You might also like