0% found this document useful (0 votes)
5 views

CODE CONVERTER

The document details a lab experiment focused on the implementation of code converters, specifically converting BCD to Excess-3 and binary to Gray code using logic gates. It outlines the objectives, required materials, and step-by-step procedures including truth table construction and circuit design. Additionally, it discusses the advantages and limitations of the codes used, concluding with insights gained from the experiment.

Uploaded by

Navneet Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CODE CONVERTER

The document details a lab experiment focused on the implementation of code converters, specifically converting BCD to Excess-3 and binary to Gray code using logic gates. It outlines the objectives, required materials, and step-by-step procedures including truth table construction and circuit design. Additionally, it discusses the advantages and limitations of the codes used, concluding with insights gained from the experiment.

Uploaded by

Navneet Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Department of Electronics & Communication

Engineering EC111: Digital Design Lab

Experiment 2 : Implementation of a Logic Function using Logic Gates and


NAND Gates

Submitted To: Submitted By:

LAB REPORT

Experiment 3: Implementation of Code Converters


Objective: Design and implementation of BCD to Excess - 3 Code and Binary to
Gray Code of 4 bit.

Materials Required:
1. Breadboard.

2. Equipment: DC Power Supply and Bench top Digital Multi meter

3. Components: Light Emitting Diode, Digital IC’s,

• LED’s: Four.

• SSD: Four
• Digital IC’s: 7400 - Quad 2 input NAND, 7486 - Quad 2 input XOR and
Connecting Wires.
1 Code Converters:
A code converter is a circuit that makes the two systems compatible even though
each uses a different binary code. Binary codes are divided into two groups
weighted and non-weighted. BCD (binary-coded decimal) is a weighted code and
each binary digit is assigned a weight (8-4-2-1). The BCD code differs from the
conventional binary number representation, in the BCD code, each decimal digit is
binary coded. BCD is useful in applications where output information has to be
displayed in decimal.
In the non-weighted codes there are no specific weights associated with the
digits, as was the case with weighted codes. A non-weighted codes are the
excess-3 code and gray code. It is generated by adding 3 to a decimal number and
then converting the result to a 4-bit binary number. Excess-3 code is a self-
complementing code and is useful in arithmetic operations.
Cyclic code uses four non-weighted binary digits to represent decimal numbers.
Cyclic code have the unique feature that the successive code words differ only in one
bit position. One type of cyclic code is the reflected code, also known as the Gray
code.

2. Pre-experiment Lab Report: BCD to Excess - 3 Code


and Binary to Gray Code of 4 bit.
a. State the problem.

b. Identify the number of inputs and outputs then assign the different
variables for inputs and outputs.

c. Construct the truth table which indicates the relationship between inputs
and outputs.

d. Obtain the simplified output logic expressions using K - Map.

e. Design the simplified output logic expressions for excess - 3 code using
only 2 input NAND gates (Fig. 2(a)).

f. Design the simplified output logic expressions for 4 bit gray code using
only 2 input XOR gates (Fig. 2(b)).
g. Build the logic circuits for the above expressions using suitable IC’s
(Fig. 1(a) and Fig. 1(b))..

h. Apply the various combination of inputs according to the truth table and
observe the condi- tion of Output.

i. In addition to the status of Output LED’s, display the 0 and 1 using seven
segment display (Fig. 3(a) and Fig. 3(b)).

i. 3 eb 33 e
Design an internal Design an internal
b e e
2 circuit for BCD to 2
2 circuit for binary to
E-3 using only 2 e 1 gray code using e
1 b 1 only
input NAND gates e e
D 2 input XOR gates
0 b0 0

1. (b)

Fig. 1: Code converters (a) BCD to Excess - 3 (a) Binary to Gray Code.

Note:
1. What is the advantages of Excess - 3 code compared to BCD code.

2. Limitations of BCD code.

3. Advantages and applications of Gray code.

4. What is mean by reflective code?


Table 1: BCD to Excess - Code

Decimal A B C D e3 e2 e1 e0
0 0 0 0 0 0 0 1 1
1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
10 1 0 1 0 x x x x
11 1 0 1 1 x x x x
12 1 1 0 0 x x x x
13 1 1 0 1 x x x x
14 1 1 1 0 x x x x
15 1 1 1 1 x x x x

KMAP

CIRCUIT DIAGRAM USING NAND GATE


Table 2: Binary to Gray Code
Decimal b3 b2 b1 b0 G3 G2 G1 G0
0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 0 0 1
2 0 0 1 0 0 0 1 1
3 0 0 1 1 0 0 1 0
4 0 1 0 0 0 1 1 0
5 0 1 0 1 0 1 1 1
6 0 1 1 0 0 1 0 1
7 0 1 1 1 0 1 0 0
8 1 0 0 0 1 1 0 0
9 1 0 0 1 1 1 0 1
10 1 0 1 0 1 1 1 1
11 1 0 1 1 1 1 1 0
12 1 1 0 0 1 0 1 0
13 1 1 0 1 1 0 1 1
14 1 1 1 0 1 0 0 1
15 1 1 1 1 1 0 0 0

KMAP
CIRCUIT DIAGRAM USING XOR GATE
5V B4 A4 B3 A3 5V B4 A4 B3 A3
Y4 Y3 Y4 Y3

14 13 12 1110 9 8 14 13 12 1110 9 8

7400
7486

1 2 3 45 67
1 2 3 4 5 6 7

Y2 Y2
A1 B1 Y1 Ground A1 B1 Y1 Ground
A2 B2 A2 B2
(a) (b)

Fig. 2: IC pin diagrams (a) 7400 - 2 input NAND gates (b) 7486 - 2 input XOR gates.
Advantages of Excess - 3 code compared to BCD code:
1. These codes are self-complementary.
2. These codes use biased representation.
3. The excess-3 code has no limitation, so that it considerably simplifies arithmetic
operations.
4. The codes 0000 and 1111 can cause a fault in the transmission line. The excess-3
code doesn't use these codes and gives an advantage for memory organization.
5. These codes are usually un weighted binary decimal codes.

Limitations of BCD Code:


 The addition and subtraction of BCD have different rules.
 The BCD arithmetic is little more complicated.
 BCD needs more number of bits than binary to represent the decimal number. So
BCD is less efficient than binary.
Advantages and applications of Gray code:
Gray Code system is a binary number system in which every successive pair of numbers
differs in only one bit. It is used in applications in which the normal sequence of binary
numbers generated by the hardware may produce an error or ambiguity during the
transition from one number to the next.
Reflective Code:

A code is reflective when the code is self complementing. In other words, when the code
for 9 is the complement the code for 0, 8 for 1, 7 for 2, 6 for 3 and 5 for 4. 2421BCD,
5421BCD and Excess-3 code are reflective codes. 8421 BCD and Excess-3 are sequential
codes.
CONCLUSION
After completing this experiment here, I conclude that with the help of this experiment, I
have came to an better understanding of how to convert the BCD code to excess three
code using NAND gate only and binary code to gray code using Xor gate only,I understood
also that how to use them in the circuit firstly in this experiment, I have solved the k-map
And then derived the solution expression in from k map and then made the truth table
for the given expression and lastly, I have made circuit.

You might also like