Experiment No 1 Code Convertor
Experiment No 1 Code Convertor
EXPERIMENT NO. :1
APPARATUS REQUIRED: X-OR Gate IC 7486 ( 1 no.s), AND Gate IC 7408 ( 1), OR Gate IC 7432
(1), NOT Gate IC 7404 (1), IC TRAINER KIT – 1, PATCH CORDS
THEORY:
The availability of large variety of codes for the same discrete elements of information results in the use of
different codes by different systems. A conversion circuit must be inserted between the two systems if each
uses different codes for same information. Thus, code converter is a circuit that makes the two systems
compatible even though each uses different binary code.
8421 BCD Code
In the 8421 Binary Coded Decimal (BCD) representation each decimal digit is converted to its 4-bit pure
binary equivalent. For example: 57dec = 0101 0111bcd
Addition is analogous to decimal addition with normal binary addition taking place from right to left. For
example,
6 0110 BCD for 6 42 0100 0010 BCD for 42
+3 0011 BCD for 3 +27 0010 0111 BCD for 27
____ __________
1001 BCD for 9 0110 1001 BCD for 69
Where the result of any addition exceeds 9(1001) then six (0110) must be added to the sum to account for
the six invalid BCD codes that are available with a 4-bit number. This is illustrated in the example below
Note that in the last example the 1 that carried forward from the first group of 4 bits has made a new 4-bit
number and so represents the "1" in "15". In the examples above the BCD numbers are split at every 4-bit
boundary to make reading them easier. This is not necessary when writing a BCD number down. This
coding is an example of a binary coded (each decimal number maps to four bits) weighted (each bit
represents a number, 1, 2, 4, etc.) code.
Excess-3 code
• Although this code is not weighted, it has an arithmetic relationship with the BCD code.
• The code word for each decimal digit is the corresponding BCD code word plus 0011 2.
0010 = 2 in BCD
+ 00112
---------------------------------------
= 0101 = 2 in excess-3
Procedure: -
Truth table:
Conclusion:
In this way we are designed, implement and Tested BCD to Excess 3 code convertor.
NOTE: Remaining outputs are don’t cares ‘X’ for inputs 0000 to 0010 and inputs 1101 to
1111 in Kmap.
K_Maps:
Conclusion :
In this way we are designed, implement and Tested 04 Bit BCD to Excess 3 code convertor and Excess 3 to
BCD Code convertor.
Ans : 1 0 1 0 1 1 0 0
----------------------------------------
1 1 1 1 1 0 1 0
4. What is Difference between binary and gray code.
Ans : binary codes appers sequentially and it is weighted codes
Gray code unweighted code , Gray code is a unit distance code in which two consecutive
(adjacent) codes differ only one bit position.
For example 1
binary 0000 gray 0000
binary 0001 gray 0001
0001 0101
8. What are Rules of BCD Addition? Explain with Example
Ans:if Sum > 9 & Carry=0 ,ADD 6(0110)
if Sum \< 9 & Carry=1, ADD 6(0110)
if Sum\< 9 & Carry=0 ,ADD 0(0000) (no correction needed)
Examples: