Module_1.3_Gray code_BCDques
Module_1.3_Gray code_BCDques
It Far n =a Wt
Stnary Gray Birmy GriiJ Bi,-y Gjray.
01 10 001 00 mx.1 000
ll l 01 01
1
001 001
101 11 OJlO O.l l
ll
.
10 on OJ!!D
]l(N] llO
lllrl lll
llO 101
ll1 100
EXAMPLE 1.55. Add (83) 10 and (34) 10 in BCD.
Solution:
Decimal BCD
(83)10 1000 0 0 11
+ + 0011 0100
(34)10
Carry
(117)10 Sum: 10 1 1 0 111 Sum > 9, Carry = O
Invalid Valid
BCD BCD Hence, correction is required
Thus, we add 6 to the invalid BCD, for correction
1011 0111
+ 0110 0000 6 is added only to the invalid BCD.
Carry 11
0001 0111
~
'----v---' ~
J, J,
0001 0001 0 111 ~ Correct BCD result.
'--v---' '--v---' ~
1 1 7
Therefore, (83)i 0 + (34)i 0 = (11 7)i 0 Ans.
EXAMPLE 1.56. Add (569) 10 and (687) 10 in BCD.
Solution:
569 0 101 0110 ·100 1
+687 0110 1000 0 111
0 1, 1 1 1
1011 1111 10000
1256 _____, '--v--' '--..--' Incorrect answer
Invalid Invalid Valid BCD
BCD BCD with
carry 1
We add (0110) to only the invalid BCD nuinbers to get correct answer.
2
10 11 11 1 1 0000 Incorrect sum
+ 0110 0110 0110
1111 11
~
0001
'-.,,---J
0010
'--.r---'
0010
'--.r---'
' 10100
'--.r---'
0101
~
5
0110
'--v--'
0110
~
6
Correct BCD answer
1 2
Ans.
Therefore, (569)i 0 +(687)10 = (1256ho