DLD Week 3
DLD Week 3
• (1 0100)10 = (?)BCD
• 100100110 = (?)BCD
• (1 0100)10 = (1 4)BCD
• 100100110 = (4 9)BCD
PACKED
BCD
Expectation vs Reality:
Unweighted code
Reference Link
Data
Representation
Magnitude Complement
1’s 2’s
Unsigned Signed
Complement Complement
• -6 = No representation
Range: 0 to 2n
Signed representation
• +6=0 110
• -6= 1 110
• 10's complement of 25 is = 75
• 9's complement of 25 is = 74
A-B
Steps
1. Take 10′s complement for B
2. Add it to A using BCD addition
3. If addition is invalid BCD then add 6
4. If carry then add it to the next bits
5. In final result,
a. if carry is occurred then it is ignored
b. If there is no any carry over, then take 10′s complement of the result and it
is negative.
Lec Raiyan Rahman, Dept. of CSE 39
10/9/2023
BCD Subtraction