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

SUBJECT NAME: INTEGRATED ELECTRONICS NAME: ABDUL WAHAB

ROLL NO: 2020-EE-089


SECTION: B

LAB 7
TASK

OBJECTIVE: To design half adder.

INTODUCTION:
A half adder is a type of adder, an electronic circuit that performs the addition of
numbers. The half adder is able to add two single binary digits and provide the output plus a
carry value. It has two inputs, called A and B, and two outputs S (sum) and C (carry). The
common representation uses an XOR logic gate and an AND logic gate.

CIRCUIT DIAGRAM:

TRUTH TABLE:

INPUT OUTPUT
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1

DEPARTMENT OF ELECTRONIC ENGINEERING


SIR SYED UNIVERSITY OF ENGINEERING AND
SUBJECT NAME: INTEGRATED ELECTRONICS NAME: ABDUL WAHAB
ROLL NO: 2020-EE-089
SECTION: B

CODING:
//design module

module half_adder (A , B , S , C );

input A , B;

output S , C;

xor ( S , A , B );

and ( C , A , B );

endmodule

//stimulus module

module wahab();

reg a , b ;

wire s , c;

half_adder ckt(a,b,s,c);

initial

begin

a = 1'b0; b = 1'b0;

#40

a = 1'b1; b = 1'b0;

#40

a = 1'b0; b = 1'b1;

#40

a = 1'b1; b = 1'b1;

end

endmodule

DEPARTMENT OF ELECTRONIC ENGINEERING


SIR SYED UNIVERSITY OF ENGINEERING AND
SUBJECT NAME: INTEGRATED ELECTRONICS NAME: ABDUL WAHAB
ROLL NO: 2020-EE-089
SECTION: B

RESULT:

DEPARTMENT OF ELECTRONIC ENGINEERING


SIR SYED UNIVERSITY OF ENGINEERING AND

You might also like