Computer Organization and Architecture Lab DEEPAK KUMAR
Computer Organization and Architecture Lab DEEPAK KUMAR
1
Index
2
Practical - 1
Objective - Implementing HALF ADDER, FULL ADDER using basic logic gates.
Description:
Half Adder
A half adder is a fundamental digital electronic circuit that serves as a building block for more
complex digital systems. Its primary function is to perform basic addition of two binary digits,
often denoted as "A" and "B," and generate two outputs: a sum (S) and a carry (C).
Binary Addition- The half adder is commonly used in binary addition operations, allowing
you to add two single-digit binary numbers together. For instance, when adding 1 + 1, the half
adder produces a sum of 0 and a carry of 1, indicating that a carry should be propagated to the
next stage of the addition.
Block Diagram:
A Sum
Half Adder
B Carry
3
A B Sum(S) Carry(C)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
4
Sum= A XOR B (A+B)
Full Adder-
A full adder is a digital electronic circuit that is more versatile than a half adder. It can perform
addition of three binary digits - two inputs (A and B) and a carry-in (Cin) - and generate two
outputs: a sum (S) and a carry-out (Cout).
5
Block Diagram:
A Sum
Full Adder
B Carry
Cin
Inputs Outputs
A B Cin Sum(S) Carry(C)
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
'A' and' B' are the input variables. These variables represent the two significant bits which are
going to be added
'Cin' is the third input which represents the carry. From the previous lower significant position,
6
the carry bit is fetched.
The 'Sum' and 'Carry' are the output variables that define the output values.
The eight rows under the input variable designate all possible combinations of 0 and 1 that can
occur in these variables.
Practical – 2
7
Binary to Gray
Binary to Gray code conversion is a practical and fundamental process used in digital electronics
and communication systems. Gray code, also known as reflected binary code or unit distance
code, is an alternative binary representation with unique properties that make it particularly
useful in various applications.
Binary to Gray code conversion is the transformation of a traditional binary number, composed
of 0s and 1s, into its Gray code equivalent. In Gray code, only one bit changes at a time as you
move from one value to the next, making it beneficial for applications where minimizing errors
and transitions is critical.
Truth Table:
8
Gray to Binary
9
Gray to Binary code conversion is the reverse process of converting Gray code back to
traditional binary representation. Gray code is known for its characteristic where only one bit
changes at a time as you move from one value to the next, which makes this conversion a
practical necessity in various digital systems.
Gray to Binary code conversion is the process of transforming a Gray code number into its
binary equivalent. This conversion is done by reversing the XOR (exclusive OR) operation used
during Binary to Gray code conversion.
Truth Table:
G1G2G3G4 ABCD
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0110
10
11