Nothing Special   »   [go: up one dir, main page]

What Is A Full Adder?: Block Diagram

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

What is a full adder?

The full adder is a digital circuit that performs the addition of three numbers. It
is implemented using logic gates. A one-bit full adder adds three one-bit
binary numbers (two input bits, mostly A and B, and one carry bit Cin being
carried forward from previous addition) and outputs a sum and a carry bit.
BLOCK DIAGRAM

the Boolean Logical Functions for the Circuit


S = A ⊕ B ⊕ Cin
Cout = A.B + B.C + C.A
OR
Cout = A & B | (A^B) & Cin

Logic Diagram of Full Adder Circuit


Truth Table for Full Adder:
A B Cin SUM (S) CARRY (Cout)

0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 1 1 0 1

1 0 0 1 0

1 0 1 0 1

1 1 0 0 1

1 1 1 1 1
Design the RTL Schematic (Gate Level Diagram) for the Circuit

Hardware Schematic for full adder


This is the hardware schematic for the design code that has been executed.

RTL Schematic for Full Adder Circuit


Write the HDL module and Test bench program for the Circuit

Full Adder using Verilog HDL


step by step as follows.
Step-1/2 :
Concept –  
Full Adder is a digital combinational Circuit which is having three input a, b and cin and
two output sum and cout. above Truth Table to do the functionality
Step-3 :
Verilog HDL code for Full Adder (Design Part) –
// Code your design : Full Adder
module full_add(a,b,cin,sum,cout);
input a,b,cin;
output sum,cout;
wire x,y,z;

// instantiate building blocks of full adder


half_add h1(.a(a),.b(b),.s(x),.c(y));
half_add h2(.a(x),.b(cin),.s(sum),.c(z));
or o1(cout,y,z);
endmodule : full_add

// code your half adder design


module half_add(a,b,s,c);
input a,b;
output s,c;

// gate level design of half adder


xor x1(s,a,b);
and a1(c,a,b);
endmodule :half_add
Step-4 :
Test bench –
// Code your testbench here
module full_add_tb;
reg a,b,cin;
wire sum,cout;

// instantiate the DUT block


full_add f1(.a(a),.b(b),.cin(cin),.sum(sum),.cout(cout));

// this particular line is added to dump the file on online simulator


initial begin $dumpfile("full_tb.vcd");$dumpvars(); end

// insert all the inputs


initial begin a=1'b1; #4; a=1'b0;#10 $stop();end
initial begin b=1'b1; forever #2 b=~b;end
initial begin cin=1'b1;forever #1 cin=~cin; #10 $stop();end

// monitor all the input and output ports at times


// when any of the input changes its state

initial begin $monitor(" time=%0d A=%b B=%b


Cin=%b Sum=%b Cout=%b",
$time,a,b,cin,sum,cout);end
endmodule : full_add_tb
Step-5 :
Expected Output –
time=0 A=1 B=1 Cin=1 Sum=1 Cout=1
time=1 A=1 B=1 Cin=0 Sum=0 Cout=1
time=2 A=1 B=0 Cin=1 Sum=0 Cout=1
time=3 A=1 B=0 Cin=0 Sum=1 Cout=0
time=4 A=0 B=1 Cin=1 Sum=0 Cout=1
time=5 A=0 B=1 Cin=0 Sum=1 Cout=0
time=6 A=0 B=0 Cin=1 Sum=1 Cout=0
time=7 A=0 B=0 Cin=0 Sum=0 Cout=0
time=8 A=0 B=1 Cin=1 Sum=0 Cout=1
time=9 A=0 B=1 Cin=0 Sum=1 Cout=0
time=10 A=0 B=0 Cin=1 Sum=1 Cout=0
time=11 A=0 B=0 Cin=0 Sum=0 Cout=0
time=12 A=0 B=1 Cin=1 Sum=0 Cout=1
time=13 A=0 B=1 Cin=0 Sum=1 Cout=0

Draw the CMOS Logic Circuits

CMOS circuit for full adder

You might also like