Professional Documents
Culture Documents
Converting 10 To BCD
Converting 10 To BCD
see now you can do this when the value is above 9 , because in BCD you
can represent from 0-9 only.
Converting 10 to BCD
Binary of 10 -- 1 0 1 0
6 -- 0 1 1 0
------------
0 0 0 1 0 0 0 0 // the carry is padded with “0”.
1 0
Converting 16 to BCD
Binary of 16 -- 1 0 0 0 0
0 0 0 1 0 0 0 0
+ 0 1 1 0
---------
0 1 1 0
now
0 0 0 1 0 1 1 0 // NO carry generated
1 6
Converting 20 to BCD
Binary of 20 -- 1 0 1 0 0
0 0 0 1 0 1 0 0
+0 1 1 0
---------
1 0 1 0 -> the ans is above 9 again add it with 6
+0 1 1 0
---------
0 0 0 1 0 0 0 0 // Carry is added with the Spilt MSB
+0 0 0 1
------------
0 0 1 0 0 0 0 0
2 0