0% found this document useful (0 votes)
18 views8 pages

Logic Lab7

Uploaded by

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

Logic Lab7

Uploaded by

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

Mansoura University

Faculty of Computers and Information


Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year

LAB 06:
Code Converter and majority circuits

LAB Objectives
The goal of this lab is to realize binary to gray and gray to binary code converter
and understand combinational circuits by implementing majority circuits. After
completing this lab:
• Students should be able to design and implement the circuit for the
following 3-bit Code conversion:
i) Binary to Gray Code
ii) Gray to Binary Code
• They can design and build a Majority circuit using NAND and XOR gates.

LAB Content
1. Code converter
▪ Binary to Gray
1) Binary Code: It is straight binary code. The binary number system (with base 2)
represents values using two symbols, typically 0 and 1. Computers call these bits
as either off (0) or on (1). The binary code is made up of only zeros and ones, and
used in computers to stand for letters and digits. It is used to represent numbers
using natural or straight binary form. It is a weighted code since a weight is
assigned to every position. Various arithmetic operations can be performed in this
form. Binary code is weighted and sequential code.
2) Gray Code: It is a modified binary code in which a decimal number is
represented in binary form in such a way that each Gray- Code number differs from
the preceding and the succeeding number by a single bit. (E.g. for decimal number
5 the equivalent Gray code is 0111 and for 6 it is 0101. These two codes differ by
only one bit position i. e. third from the left.)
▪ Example:
In this conversion, the input straight binary number can easily be converted
to its Gray code equivalent. 1. Record the most significant bit as it is. 2. EX-

1
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year
OR this bit to the next position bit, record the resultant bit. 3. Record
successive EX-ORed bits until completed. 4. Convert 0011 binary to Gray.

▪ Design:
1) Truth Table:

K-Map for G2: G2 = Σ m (4, 5, 6, 7)

B1

B2 1 1 1 1

G2=B2
G1 = Σ m (2, 3, 4, 5) using k-map to simplify then:

2
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year
G1= B2 ⊕ B1

G0 = Σ m (1, 2, 5, 6) using k-map to simplify then:

G0= B1 ⊕ B0
Then,
G2 = B2
G1 = B2 ⊕ B1
G0 = B1 ⊕ B0
Circuit Diagram:

Circuit Implements

3
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year

❖ PROCEDURE: -
1. The circuit connections are made as shown in fig.
2. Pin (14) is connected to +Vcc and Pin (7) to ground.
3. In the case of binary to gray conversion, the inputs B0, B1, B2 are given at
respective pins and outputs G0, G1, G2 are taken for all the 8 combinations
of the input.
4. In the case of gray to binary conversion, the inputs G0, G1, G2 are given at
respective pins and outputs B0, B1, B2 are taken for all the 8 combinations
of inputs.
5. The values of the outputs are tabulated.

◼ Gray to binary converter:


1) Truth table

4
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year
Then:
B2 = G2
B1 = G1 ⊕ B2
B0 = G0 ⊕ B1
Diagram:

2. Majority Circuit
1) Set up truth table so that the output X will be 1 whenever two or more
inputs are 1.

2) Write sum of products for the output


X = A’ BC + A B’C + ABC’ + ABC
3) Simplify output expression
X = A’ BC + A B’C + ABC’ + ABC
x= BC (A’+A) + A (B’C + BC’)

5
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year
x= BC + A (B ⊕ C)
4) Diagram

▪ Diagram using NAND and XOR:

Implementation:

6
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year

Homework 06:
Student Name
Student ID
Section
Dept.
Year
Date

◼ Design a combinational circuit with three input and one output:


a) The output 1 when the binary value of the inputs is less than 3. The
output is 0 otherwise.
………….………..…………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

………………………………………………………………………………………………………………………………………………

………….………..…………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

7
Mansoura University
Faculty of Computers and Information
Information Technology Department
Course: Digital Logic Design
Code: [IT124P]
First Year

b) The output 1 when the binary value of the inputs is an even number.

………….………..…………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

………………………………………………………………………………………………………………………………………………

………….………..…………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..……………………………………………………………………………………………………………………………

………….………..………………………………………………………………………………………………………………………….

…………………………………………………………………………………………………………………………………………………

You might also like