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

Mct-212: Digital Logic Design

Code converters are combinational digital circuits that convert one type of code to another. Common codes include binary, excess-3, and gray codes. This document discusses binary-to-excess-3 and binary-to-gray code converters. Binary-to-excess-3 converters add a small bias of 3 to binary numbers. Truth tables and logic equations are provided to demonstrate the conversion. Binary-to-gray code converters preserve the distance between codes when converting to prevent errors during transmission. Logic circuits are presented to perform both the binary-to-gray and gray-to-binary conversions.

Uploaded by

Farah Huma
Copyright
© Attribution Non-Commercial (BY-NC)
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)
43 views

Mct-212: Digital Logic Design

Code converters are combinational digital circuits that convert one type of code to another. Common codes include binary, excess-3, and gray codes. This document discusses binary-to-excess-3 and binary-to-gray code converters. Binary-to-excess-3 converters add a small bias of 3 to binary numbers. Truth tables and logic equations are provided to demonstrate the conversion. Binary-to-gray code converters preserve the distance between codes when converting to prevent errors during transmission. Logic circuits are presented to perform both the binary-to-gray and gray-to-binary conversions.

Uploaded by

Farah Huma
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 17

MCT-212: DIGITAL LOGIC DESIGN

CODE CONVERTERS
0000 = 0011 [o_0]?

CODE CONVERTERS
In the digital domain, data or information is represented by a combination of 0s and 1s. A code is basically the pattern of these 0s and 1s used to represent the data.

Code converters are a class of combinational digital circuits that are used to convert one type of code in to another.

CODE CONVERTERS
Some of the most prominently used codes in digital systems are Natural Binary Sequence, Binary Coded Decimal, Excess-3 Code, Gray Code, ASCII Code etc. Like any combinational digital circuit, a code converter can be implemented by using a circuitry of AND, OR and NOT gates.

We will be studying the following conversions:


Binary-to-Excess3 Conversion Binary-Gray code conversion

BINARY-to-EXCESS-3 CONVERSION
In excess-3 code, a small value of bias (3) is added to the binary numbers. The representation shifts each number by a value of three. when the sum of two XS-3 digits is greater than 9, the carry bit of a four bit adder will be set high.

BINARY-to-EXCESS-3 CONVERSION
The truth table shows the conversion parameters. A,B,C,D represent a binary/BCD number, while the output w,x,y,z represent the excess-3 code.

A
0 0 0 0

B
0 0 0 0

C
0 0 1 1

D
0 1 0 1

w
0 0 0 0

x
0 1 1 1

y
1 0 0 1

z
1 0 1 0

0
0 0 0 1 1

1
1 1 1 0 0

0
0 1 1 0 0

0
1 0 1 0 1

0
1 1 1 1 1

1
0 0 0 0 1

1
0 0 1 1 0

1
0 1 0 1 0

BINARY-to-EXCESS-3 CONVERSION
AB

CD

00

01

11

10

A
0 0 0 0

B
0 0 0 0

C
0 0 1 1

D
0 1 0 1

w
0 0 0 0

00 01
11 10

0 0

0 1 X

0 1 X X

0 1 X

0
0 0 0

1
1 1 1

0
0 1 1

0
1 0 1

0
1 1 1

X
1

1
1

0
0

0
0

0
1

1
1

= + +

BINARY-to-EXCESS-3 CONVERSION
AB

CD

00

01

11

10

A
0 0 0 0

B
0 0 0 0

C
0 0 1 1

D
0 1 0 1

x
0 1 1 1

00 01
11 10

0 1

1 0 X

1 0 X X

1 0 X

0
0 0 0

1
1 1 1

0
0 1 1

0
1 0 1

1
0 0 0

X
0

1
1

0
0

0
0

0
1

0
1

= + +

BINARY-to-EXCESS-3 CONVERSION
AB

CD

00

01

11

10

A
0 0 0 0

B
0 0 0 0

C
0 0 1 1

D
0 1 0 1

y
1 0 0 1

00 01
11 10

1 1

0 0 X

1 1 X X

0 0 X

0
0 0 0

1
1 1 1

0
0 1 1

0
1 0 1

1
0 0 1

X
1

1
1

0
0

0
0

0
1

1
0

= +

BINARY-to-EXCESS-3 CONVERSION
AB

CD

00

01

11

10

A
0 0 0 0

B
0 0 0 0

C
0 0 1 1

D
0 1 0 1

z
1 0 1 0

00 01
11 10

1 1

0 0 X

0 0 X X

1 1 X

0
0 0 0

1
1 1 1

0
0 1 1

0
1 0 1

1
0 1 0

X
1

1
1

0
0

0
0

0
1

1
0

BINARY-to-EXCESS-3 CONVERSION

= = + = + +
= + + = ( + ) +( + )

= + +
= + ( + )

BINARY-to-EXCESS-3 CONVERSION

BINARY- GRAY CODE CONVERTERS


Convert binary code into gray code, or gray code into binary code. What are some uses of gray code??

Binary
0
0 0 0 0 0 0 0 1 1 1

Gray Code
0
1 0 1 0 1 0 1 0 1
0

0
0 0 0 1 1 1 1 0 0 0

0
0 1 1 0 0 1 1 0 0 1

0
0 0 0 0 0 0 0 1 1 1

0
0 0 0 1 1 1 1 1 1 1

0
0 1 1 1 1 0 0 0 0 1

0
1 1 0 0 1 1 0 0 1 1

1
1 1 1 1

0
1 1 1 1

1
0 0 1 1

1
0 1 0

1
1 1 1 1

1
0 0 0 0

1
1 1 0 0

0
0 1 1 0

BINARY- GRAY CODE CONVERTERS


Binary to- Gray:

Binary
0
0 0 0 0 0 0 0 1 1 1

Gray Code
0
1 0 1 0 1 0 1 0 1
0

0
0 0 0 1 1 1 1 0 0 0

0
0 1 1 0 0 1 1 0 0 1

0
0 0 0 0 0 0 0 1 1 1

0
0 0 0 1 1 1 1 1 1 1

0
0 1 1 1 1 0 0 0 0 1

0
1 1 0 0 1 1 0 0 1 1

1
1 1 1 1

0
1 1 1 1

1
0 0 1 1

1
0 1 0

1
1 1 1 1

1
0 0 0 0

1
1 1 0 0

0
0 1 1 0

BINARY- GRAY CODE CONVERTERS


Gray to- Binary:

Binary
0
0 0 0 0 0 0 0 1 1 1

Gray Code
0
1 0 1 0 1 0 1 0 1
0

0
0 0 0 1 1 1 1 0 0 0

0
0 1 1 0 0 1 1 0 0 1

0
0 0 0 0 0 0 0 1 1 1

0
0 0 0 1 1 1 1 1 1 1

0
0 1 1 1 1 0 0 0 0 1

0
1 1 0 0 1 1 0 0 1 1

1
1 1 1 1

0
1 1 1 1

1
0 0 1 1

1
0 1 0

1
1 1 1 1

1
0 0 0 0

1
1 1 0 0

0
0 1 1 0

ANY QUESTIONS?

Anyone willing to present? Time allowed : 5 mins Topic : Any Bonus Points : +3

REFERENCES
Chapter no 4: Combinational Logic
Digital Logic Design by Morris Mano

Chapter no 6: Functions of Combination Logic


Digital Fundamentals by Floyd

You might also like