0% found this document useful (0 votes)
60 views10 pages

Department of Aviation Engineering Technology Superior University

This document describes an experiment to implement code converters using logic gates. The objectives are to learn BCD to seven segment display code conversion, BCD to Gray code conversion, and BCD to excess-3 code conversion. The experiment involves using a digital logic trainer, IC 7447, IC 7486, AND, OR, NOT gates to build circuits that perform the code conversions. Truth tables are provided that define the input-output relationships for each type of code conversion.

Uploaded by

ARSLAN IJAZ
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)
60 views10 pages

Department of Aviation Engineering Technology Superior University

This document describes an experiment to implement code converters using logic gates. The objectives are to learn BCD to seven segment display code conversion, BCD to Gray code conversion, and BCD to excess-3 code conversion. The experiment involves using a digital logic trainer, IC 7447, IC 7486, AND, OR, NOT gates to build circuits that perform the code conversions. Truth tables are provided that define the input-output relationships for each type of code conversion.

Uploaded by

ARSLAN IJAZ
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/ 10

Department of Aviation Engineering Technology

Superior University

Digital Techniques
AT-2226

Experiment No.10
Implementation of Code Converters using Gates

Prepared for

By:

Name:

ID:

Section:

Semester:

Total Marks:

Obtained Marks:

Signature:

Date:
Digital Techniques Lab 10

Implementation of Code Converters using Gates


Objective:

1. To learn about BCD to Seven Segment Display Code


2. BCD to Gray Code Conversion
3. BCD to Excess-3 Code Conversion

Equipment:
1. Digital Logic Trainer
2. IC 7447, IC 7486, AND, OR, NOT gates
3. Connecting wires
4. Resistors 180 ohms

Theory:

The availability of large variety of codes for the same discrete elements of information results in the
use of different codes by different digital systems. Sometimes it becomes necessary to use output one
system as input to another system.

A conversion circuit must be inserted between the two systems, if each uses different code for the
same information. When a decimal number is decoded such that each digit of the number is
represented by a 4-bit binary number, it is called 8421 Binary Coded Decimal Code or more simply
a BCD code.

Here, ten out of sixteen possible combinations of the code are selected to represent decimal 0 through
9. Most commonly used BCD codes are given below:

63
Table 10.1: Truth Table of BCD to Gray Code and Excess-3

EXCESS-3
DECIMAL BCD GRAY CODE
CODE

0 0000 0000 0011

1 0001 0001 0100

2 0010 0011 0101

3 0011 0010 0110

4 0100 0110 0111

5 0101 0111 1000

6 0110 0101 1001

7 0111 0100 1010

8 1000 1100 1011

9 1001 1 1 01 1100

The important characteristics of the Gray code is that only one digit changes as we count from top to
bottom; that is why it is termed as minimum change code. The Gray code is used for input and
output devices. Primary use is in numeric input encoding applications, where we expect
nonrandom input value change (i.e. value n changes either to n-1 or to n+1).

Another decimal code that has been used in some old computers is Excess-3 code. Its code
assignment is obtained from the corresponding value of BCD after the addition of 3. The code is
used in many arithmetic circuits because it is self- complementing (i.e. the 9’s complement value
of the decimal number can be obtained by complementing each bit of the code).
Task 1: BCD to Seven Segment Display Code Conversion

Most Digital equipment has some means for displaying information in a form that can be understood
readily by the user or operator. One of the simplest and most popular methods for displaying
numerical digits uses a 7-segment configuration. To form decimal characters 0 through 9 and
sometimes hex characters A through

A BCD to 7-Segment Driver (IC 7447) is used to take four bit BCD input and provide the outputs
that will pass current through the appropriate segment of the display to generate desired output/
number. Truth Table for Active High and Active Low cases are shown below:

S2 1 16 vCC

2 f15 f
S1

g 10 9 8 7 6
3 14 g
g fcomm a b

4 a13 a a
7447 f b
g
5 b 12 b e c

d
S0 6 c 11 c
e dcomm cDp

1 2 3 4 5
S3 7 d10 d

GND8 e9 e

Figure 10.1: Pin Configuration of BCD to 7-Segment IC

The segments of Seven Segment display are made of LEDs. Depending on the arrangements of the
LEDs, the display could be Common Anode or Common Cathode type. We are using common anode
type of display, which would require that either pin 3 or pin 8 is connected to Vcc and the input is
active low.
Truth Table:

Table 10.2: Truth Table of BCD to 7-Segment (Active High)

Input Output-Seven Segment Decoder

Decimal
BCD (Active High)

Display
So S1 S2 S3 a b c d e f g
Output

0 0 0 0 0 1 1 1 1 1 1 0 0

0 0 0 1 1 0 1 1 0 0 0 0 1

0 0 1 0 2 1 1 0 1 1 0 1 2

0 0 1 1 3 1 1 1 1 0 0 1 3

0 1 0 0 4 0 1 1 0 0 1 1 4

0 1 0 1 5 1 0 1 1 0 1 1 5

0 1 1 0 6 0 0 1 1 1 1 1 6

0 1 1 1 7 1 1 1 0 0 0 0 7

1 0 0 0 8 1 1 1 1 1 1 1 8

1 0 0 1 9 1 1 1 0 0 1 1 9
Truth Table:

Table 10.3: Truth Table of BCD to 7-Segment (Active Low)

Input Output- Seven Segment Decoder

Decimal
BCD (Active Low -IC 7447) Display
Output
S0 S1 S2 S3 a b c d e f g

0 0 0 0 0 0 0 0 0 0 0 1 0

0 0 0 1 1 1 0 0 1 1 1 1 1

0 0 1 0 2 0 0 1 0 0 1 0 2

0 0 1 1 3 0 0 0 0 1 1 0 3

0 1 0 0 4 1 0 0 1 1 0 0 4

0 1 0 1 5 0 1 0 0 1 0 0 5

0 1 1 0 6 1 1 0 0 0 0 0 6

0 1 1 1 7 0 0 0 1 1 1 1 7

1 0 0 0 8 0 0 0 0 0 0 0 8

1 0 0 1 9 0 0 0 1 1 0 0 9
Task 2: BCD to Gray Code Conversion

The bit combination for the BCD and Gray code are listed in the table below. Since each code uses
four bits to represent a decimal digit, there must be four input variables and four output variables.

Truth Table:

Table 10.4: Truth Table of BCD to Gray Code

Input
Output Gray Code Observed Output
BCD

A B C D W x y z W x y z

0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 1

0 0 1 0 0 0 1 1

0 0 1 1 0 0 1 0

0 1 0 0 0 1 1 0

0 1 0 1 0 1 1 1

0 1 1 0 0 1 0 1

0 1 1 1 0 1 0 0

1 0 0 0 1 1 0 0

1 0 0 1 1 1 0 1
Logic Circuit Diagram:

D
Z

C
Y

B
X

A W

Figure 10.2: Logic Circuit Diagram of BCD to 7-Segment

Task 3: BCD to Excess-3 Conversion

The bit combination for the BCD and Excess-3 code are listed in the table below. Since each code
uses four bits to represent a decimal digit, there must be four input variables and four output
variables.

Truth Table:

Table 10.5: Truth Table of BCD to Excess-3

Input Output Excess-3 Observed Output


Code
BCD
A B C D w x y z

0 0 0 0 0 0 1 1

0 0 0 1 0 1 0 0
0 0 1 0 0 1 0 1
0 0 1 1 0 1 1 0

0 1 0 0 0 1 1 1

0 1 0 1 1 0 0 0

0 1 1 0 1 0 0 1

0 1 1 1 1 0 1 0

1 0 0 0 1 0 1 1

1 0 0 1 1 1 0 0

Simplify using K-MAP:

Obtain the simplified outputs with the help of K-MAP


Logic Circuit Diagram:

Procedure:
1. Insert the IC 74xx on the trainer’s breadboard.
2. Use any two Logic Switches (S2 to S9) of the trainer for Input and any one of the
LEDs (L0 to L15) of the trainer for Output indication.
3. Connect +5V to pin 14 (Vcc) and Ground to pin 7 (GND) of the IC.
4. By setting various combinations of the two switches verify that the output of the
gate is in accordance with the Truth Table shown above.
5. Record your observation.

Conclusion:

You might also like