AIM :
To design and implement a digital combinational circuit that converts the given code
in
Components Required :
1.
2.
3.
4.
5.
6.
1

1
1
1
1
Required quantity
Theory :
While the binary system of representation is the most extensively used one in digital
systems, including computers, octal and hexadecimal number systems are commonly used for
representing groups of binary digits. The binary coding system, called the straight binary
code becomes very cumbersome to handle when used to represent larger decimal numbers. To
overcome this shortcoming, and also to perform many other special functions, several binary
codes have evolved over the years. Some of the betterknown binary codes, including those
used efficiently to represent numeric and alphanumeric data, and the codes used to perform
special functions, such as detection and correction of errors. Coding was defined as the use of
groups of bits to represent items of information that are multivalued. Assigning each item of
information a unique combination of bits makes a transformation of the original information.
This we recognize as information being processed into another form. Moreover, we have seen
that there are many coding schemes exist. Different digital systems may use different coding
schemes. It is sometimes necessary to use the output of one system as the input to other.
Therefor a sort of code conversion is necessary between the two systems to make them
compatible for the same information. A code converter is a combinational logic circuit that
changes data presented in one type of binary code to another type of binary code. A general
block diagram of a code converter is shown in Fig.
Gray Code
The Gray code was designed by Frank Gray at Bell Labs and patented in 1953. It is an
unweighted binary code in which two successive values differ only by 1 bit. Owing to this
feature, the maximum error that can creep into a system using the binary Gray code to encode
data is much less than the worstcase error encountered in the case of straight binary
encoding. An examination of the fourbit Gray code numbers shows that the last entry rolls
over to the first entry. That is, the last and the first entry also differ by only 1 bit. This is
known as the cyclic property of the Gray code.
determined by adding 3 to each decimal digit in the given number and then replacing each
digit of the newly found decimal number by its fourbit binary equivalent. It may be
mentioned here that, if the addition of 3 to a digit produces a carry, as is the case with the
digits 7, 8 and 9, that carry should not be taken forward. The result of addition should be
taken as a single entity and subsequently replaced with its excess3 code equivalent. Another
significant feature that makes this code attractive for performing arithmetic operations is that
the complement of the excess3 code of a given decimal number yields the excess3 code for
9s complement of the decimal number. As adding 9s complement of a decimal number B to
a decimal number A achieves A B, the excess3 code can be used effectively for both
addition and subtraction of decimal numbers.
4bit Binary to Gray code conversion
1. The block diagram of a 4bit binary to gray code converter is shown in Fig.
If has four inputs (B3B2B1B0) representing 4bit binary numbers and four outputs (G3G2G1G0)
representing 4bit gray code.
Truth table for binary to gray code converters
solving all the gray outputs distantly with respect to binary inputs From the truth table; the
logic expressions for the gray code outputs can be written as
G3 = (8, 9, 10, 11, 12, 13, 14, 15)
B3
B3 B2
B2 B1
B1 B0.
Now the above expressions can be implemented using XOR gates to yield the desired code
converter circuit shown in Fig.
If has four inputs (G3G2G1G0) representing 4bit Gray code and four outputs (B3B2 B1B0)
representing 4bit Binary number.
TRUTH TABLE:
GRAY INPUT
G3
G2
G1
0
0
0
0
0
0
0
0
1
0
0
1
0
1
0
0
1
0
0
1
1
0
1
1
1
0
0
1
0
0
1
0
1
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
G0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
B3
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
BINARY OUTPUT
B2
B1
0
0
0
0
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
0
1
0
0
0
0
0
0
1
0
1
B0
0
1
1
0
1
0
0
1
1
0
0
1
0
1
1
0
Now we solve all the Binary outputs. From the truth table, the logic expressions for the
Binary coded outputs can be written as :
B3 =
B2 =
B1 =
B0 =
Map for B3
B3 = G3
Map for B2
Map for B1
Map for B0
B3 =
B2 =
B1 =
B0 =
G3
G3 G2
G3 G2G1
G3 G2 G1 G0.
Now the above expressions can be implemented using XOR gates to yield the desired code
converter circuit shown in Fig.
XS3 codes are obtained from BCD code by adding 3 to each coded number. Moreover 4
binary variables may have 16 combinations, but only 10 are listed. The six not listed are dont
carecombinations. Since they will never occur, we are at liberty to assign to the output
variable either a 1 or a 0, whichever gives a simpler circuit. In this particular example, the
unused i/o combinations are listed below the truth table.
Truth Table for XS3 to BCD code converter
Now we solve all the BCD outputs. From the truth table, the logic expressions for the BCD
coded outputs can be written as :
B3 =
B2 =
B1 =
B0 =
B3 = E3 E2 + E3E1E0
Map for B2
Map for B1
B1 = E1' E0 + E1 E0'
= E1 E0
Map for B0
B0 = E0'
B3 =
B2 =
B1 =
B0 =
E3 E2 + E3 E1 E0
E2' E0' + E2 E1 E0 + E2'E1'
E1 E0
E0'
The expressions for BCD outputs (B3 B2 B1 B0) can be implemented for terms of inputs
(E3 E2 E1 E0) to form a XS3 to BCD code converter circuit as below
E3
E2
E1
E0
6
5
E1 E0
4
2
3
2
B2 = E2' E0' + E2 E1 E0 +
E2'E1'
3
B1
B0 = E50'
B3 = E3 E2 + E3
2
2
E0
6
E1
The truth table, lists the values of the output (that is the excess3 code) for all possible
combinations of the binary code. Note that, these codes are codes for decimal digits 09. In
other words, even though the 4 bits of the input can represent up to 16 different combinations,
ONLY 10 combinations are used to represent the 10 decimal digits. Thus, a total of 6 input
combinations are not likely to occur. Since these inputs will never occur, we use dont cares
for the corresponding output codes.
Excess 3 Output
Decimal
B3
B2
B
1
B0
E3
E2
E1
E0
1015
As the procedure for simplification of a Boolean function suggests, we will minimize the four
output functions using Kmaps. Thus we will be having four Kmaps, one for each output
function. Each of these Kmaps are given below
KMap for E3
KMap for E2
KMap for E1
KMap for E0
E3=B3+B2(B0+B1)
E2=B2B1+B2B0+B2B1B0
= B2(B1+B0)+B2B1B0
E2=B2(B1+B0)
The expressions for Excess3 outputs (E3E2E1E0) can be implemented for terms of inputs
(B3B2B1B0) to form a BCD to XS3 code converter circuit as below
Molto più che documenti.
Scopri tutto ciò che Scribd ha da offrire, inclusi libri e audiolibri dei maggiori editori.
Annulla in qualsiasi momento.