You are on page 1of 10

Code convertor

Aim:

To construct a code convertor using IC 7486 and convert

a)BCD to gray code

b)BCD to excess 3 code

c)Excess 3 code to BCD

d)Gray to excess 3 code

Apparatus:

IC 7486,IC 7483,battery etc.

Procedure:

The connections are made as given in the circuit. For BCD to gray and BCD to excess 3
code convertors, the BCD input is given directly and in each case, the corresponding output is measured.
For gray to BCD the gray input is given to the input pins and the BCD output is measured. For gray to
excess 3 convertors, the gray outputs of the BCD to gray convertors are connected to it as the inputs.
Such that the excess 3 output can be measured. For gray to excess 3 and BCD to excess 3,the pins 1,3,8
and 10 are kept at 0,0,1,1 respectively. But for excess 3 code to BCD, they are kept at 1,1,0,1 states
respectively and for various BCD inputs, the output is measured and tabulated.
Binary coded decimal

In computing and electronic systems, binary coded decimal is a class of binary


encodings of decimal numbers where each decimal digit is represented by fixed number of BCD. Special
bit patterns are sometimes used for a sign or for digital indications.

BCD's main virtue is its more accurate representation and rounding of decimal
quantities as well as an ease of conversation into human- readable representations, in comparsion to
binary positional systems. The drawbacks of BCD's principle are a small increase in computing the
circuits needed to implement based on arithmetic and a slightly less dense storage. BCD was used
mainly in decimal computing.

Decimal Binary coded decimal(BCD)

0 0000

1 0001

2 0010

3 0011

4 0100

5 0101

6 0110

7 0111

8 1000

9 1001

10 1010

11 1011

12 1100

13 1101

14 1110

15 1111
Gray code

Gray code is also known as reflected binary code.It is an ordering of binary numerical system
such that two successive values differ in only one bit.The reflected binary code was originally designed
to prevent spurious output from electromechanical switches.Today,Gray codes are widely used to
facilitate error correction in digital communications such as digital terrestial television and some cable
TV systems.

Decimal Binary coded decimal Gray code

0 0000 0000

1 0001 0001

2 0010 0011

3 0011 0010

4 0100 0110

5 0101 0111

6 0110 0101

7 0111 0100

8 1000 1100

9 1001 1101

10 1010 1111

11 1011 1110

12 1100 1010

13 1101 1011

14 1110 1001

15 1111 1000
Excess 3 code

Excess 3 code is a non weighted code used to express decimal numbers. It is a self-
complementary binary coded decimal(BCD) code and numerical system which has biased
representations. There are following excess 3 code for decimal digits.

Decimal BCD Carry Excess 3Code

S3 S2 S1 S0

0 0000 0 0 0 1 1

1 0001 0 0 1 0 0

2 0010 0 0 1 0 1

3 0011 0 0 1 1 0

4 0100 0 0 1 1 1

5 0101 0 1 0 0 0

6 0110 0 1 0 0 1

7 0111 0 1 0 1 0

8 1000 0 1 0 1 1

9 1001 0 1 1 0 0

10 1010 0 1 1 0 1

11 1011 0 1 1 1 0

12 1100 0 1 1 1 1

13 1101 1 0 0 0 0

14 1110 1 0 0 0 1

15 1111 1 0 0 1 0
PIN CONFIGURATION:

IC 7486

IC 7483
a)BCD to Gray code

b)BCD to Excess 3 code

c)Excess 3 code to BCD

d)Gray code to Excess 3 code


a)BCD to gray code:

Truth table:

Decimal BCD Gray code


A B C D A’ B’ C’ D’
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

Measured table:

Decimal BCD Gray code


A B C D A’ B’ C’ D’
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
b)BCD to excess 3 code

Truth table:

Decimel BCD code B Excess 3 code


A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0
0 0 0 0 0 0 0 1 1 0 0 0 1 1
1 0 0 0 1 0 0 1 1 0 0 1 0 0
2 0 0 1 0 0 0 1 1 0 0 1 0 1
3 0 0 1 1 0 0 1 1 0 0 1 1 0
4 0 1 0 0 0 0 1 1 0 0 1 1 1
5 0 1 0 1 0 0 1 1 0 1 0 0 0
6 0 1 1 0 0 0 1 1 0 1 0 0 1
7 0 1 1 1 0 0 1 1 0 1 0 1 0
8 1 0 0 0 0 0 1 1 0 1 0 1 1
9 1 0 0 1 0 0 1 1 0 1 1 0 0
10 1 0 1 0 0 0 1 1 0 1 1 0 1
11 1 0 1 1 0 0 1 1 0 1 1 1 0
12 1 1 0 0 0 0 1 1 0 1 1 1 1
13 1 1 0 1 0 0 1 1 1 0 0 0 0
14 1 1 1 0 0 0 1 1 1 0 0 0 1
15 1 1 1 1 0 0 1 1 1 0 0 1 0

Measured table:

Decimel BCD code B Excess 3 code

A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
c)Excess 3 code to BCD

Truth table:

Decimel Excess 3 code B BCD code


A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0
3 0 0 1 1 1 1 0 1 1 0 0 0 0
4 0 1 0 0 1 1 0 1 1 0 0 0 1
5 0 1 0 1 1 1 0 1 1 0 0 1 0
6 0 1 1 0 1 1 0 1 1 0 0 1 1
7 0 1 1 1 1 1 0 1 1 0 1 0 0
8 1 0 0 0 1 1 0 1 1 0 1 0 1
9 1 0 0 1 1 1 0 1 1 0 1 1 0
10 1 0 1 0 1 1 0 1 1 0 1 1 1
11 1 0 1 1 1 1 0 1 1 1 0 0 0
12 1 1 0 0 1 1 0 1 1 1 0 0 1
13 1 1 0 1 1 1 0 1 1 1 0 1 0
14 1 1 1 0 1 1 0 1 1 1 0 1 1
15 1 1 1 1 1 1 0 1 1 1 1 0 0
16 0 0 0 0 1 1 0 1 0 1 1 0 1
17 0 0 0 1 1 1 0 1 0 1 1 1 0
18 0 0 1 0 1 1 0 1 0 1 1 1 1

Measured table:

Decimel Excess 3 code B BCD code

A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
d)Gray to Excess 3 code

Truth table:

Decimel Binary Gray code B Excess 3 code


A B C D A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0
0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1
1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0
2 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 0
3 0 0 1 1 0 0 1 0 0 0 1 1 0 0 1 0 1
4 0 1 0 0 0 1 1 0 0 0 1 1 0 1 0 0 1
5 0 1 0 1 0 1 1 1 0 0 1 1 0 1 0 1 0
6 0 1 1 0 0 1 0 1 0 0 1 1 0 1 0 0 0
7 0 1 1 1 0 1 0 0 0 0 1 1 0 0 1 1 1
8 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1
9 1 0 0 1 1 1 0 1 0 0 1 1 1 0 0 0 0
10 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 1 0
11 1 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0 1
12 1 1 0 0 1 0 1 0 0 0 1 1 0 1 1 0 1
13 1 1 0 1 1 0 1 1 0 0 1 1 0 1 1 1 0
14 1 1 1 0 1 0 0 1 0 0 1 1 0 1 1 0 0
15 1 1 1 1 1 0 0 0 0 0 1 1 0 1 0 1 1

Measured table:

Decimel Binary Gray code B Excess 3 code


A B C D A3 A2 A1 A0 B3 B2 B1 B0 Carry S3 S2 S1 S0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

RESULT

The code converters were constructed and the performances were studied.

You might also like