0% found this document useful (0 votes)
39 views11 pages

Computer Organization and Architecture Lab DEEPAK KUMAR

The document describes two digital logic experiments conducted in a computer organization and architecture lab. The first experiment implements half adders and full adders using basic logic gates like AND and XOR. Truth tables are provided to show the sum and carry outputs for all possible input combinations. The second experiment implements converters between binary and gray codes, with truth tables showing the 4-bit code conversions in both directions. Screenshots are included of the logic gate circuit diagrams for the half adder, full adder, and binary-gray code converters.

Uploaded by

Aryan Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views11 pages

Computer Organization and Architecture Lab DEEPAK KUMAR

The document describes two digital logic experiments conducted in a computer organization and architecture lab. The first experiment implements half adders and full adders using basic logic gates like AND and XOR. Truth tables are provided to show the sum and carry outputs for all possible input combinations. The second experiment implements converters between binary and gray codes, with truth tables showing the 4-bit code conversions in both directions. Screenshots are included of the logic gate circuit diagrams for the half adder, full adder, and binary-gray code converters.

Uploaded by

Aryan Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Computer Organization and Architecture Lab

Master of Computer Applications


1st Semester

Name – Deepak Kumar


Roll number – 23718
Batch – 2023-2024

1
Index

Sr No. Practical Name Date Remarks

1- Implementing HALF ADDER, FULL ADDER 02-10-23


using basic logic gates

2- Implementing Binary –to –Gray –to –Binary 02-10-23


code converters.

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

Truth Table of Half Adder

3
A B Sum(S) Carry(C)

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

In the above table


'A' and' B' are the input states, and 'sum' and 'carry' are the output states.
The carry output is 0 in case where both the inputs are not 1.
The least significant bit of the sum is defined by the 'sum' bit.
The SOP form of the sum and carry are as follows:

The SOP form of the sum and carry are as follows:


Sum = x'y+xy'
Carry = xy
Half-Adder logical circuit:
So, the Half Adder is designed by combining the 'XOR' and 'AND' gates and provide the sum
and carry.
There is the following Boolean expression of Half Adder circuit:

4
Sum= A XOR B (A+B)

Carry= A AND B (A.B)

Screen Shot of Half Adder

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

Truth Table of Full Adder

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

In the above table,

'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.

Sum = x' y' z+x' yz+xy' z'+xyz


Carry = xy+xz+yz

Screen Shot of Full Adder

Practical – 2

Objective - Implementing Binary –to –Gray –to –Binary code converters

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:

Decimal Number 4-bit Binary Code 4-bit Gray Code


ABCD G1 G2 G3 G4
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111

Screen Shot of Binary –to –Gray

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:

Decimal Number 4 – bit Gray Code 4-bit Binary Code

G1G2G3G4 ABCD

0 0000 0000

1 0001 0001

2 0010 0011

3 0011 0010

4 0100 0110

5 0101 0110

Screen Shot of Gray –to – Binary

10
11

You might also like