UNSIGNED BINARY AND
BINARY-CODED DECIMAL
REPRESENTING INTEGER
DATA
BCD: binary-coded decimal
Each decimal digit individually converted
to binary
Requires 4 bits per digit
8-bit location hold 2 BCD digits 00 to 99
6810 01101000BCD
Hexa: 4 bits can hold 16 values, 0 to F
A to F not used in BCD
SIGN-AND-MAGNITUDE
REPRESENTATION
Nines Decimal Representation
Examples 9s complement
9s compl. Repr. For:
3-digit nb 467?
999
467
532
4-digit nb 467?
9999
467
9532
Sign-and-magnitude value 9990?
9999
9990
9
9990 represents the value 9
Figure 4.6 Addition as a counting process
Figure 4.7 Addition with wraparound
Ones complement
Figure 4.8 Addition with modulus crossing
Add in 1s complement
Overflow
Tens complement scale
Overflow sign of result sign both operands
Examples
Twos complement
10s complement of
247 is 1000 247 = 753
17 is 1000 017 = 983
Sign and magnitude of 777
Begins with a 7 ( 5) negative
1000 777 = 223
The sign-magnitude value is 223
Alternative 10s comp = 9s comp + 1
2s complement = 1s complement+1
Examples of 2s complement