Professional Documents
Culture Documents
Chapter 1
Introduction
23:12:08
Chapter outline
Decimal numbers
• Ten digits to use: 0 - 9.
• Value representation
where 0 ≤ di < b, 0 ≤ i ≤ n − 1.
Binary numbers
• Two digits to use: 0 - 1.
• Value representation:
11012 = 1 ∗ 23 + 1 ∗ 22 + 0 ∗ 21 + 1 ∗ 20 = 1310
1011
1001
0100
Microcomputer principles and applications
23:12:08
1.2 Binary digital system
Signed-magnitude representation
• For an n-bit signed binary number, the MSB is the sign bit and
the remaining (n − 1) bits denote the magnitude of the number.
• the sign bit is 0 for a positive number and 1 for a negative
number. n
X
n−i
d 2 if dn−1 = 0
n−i
i=2
A= X n
dn−i 2n−i if dn−1 = 1
−
i=2
For example:
0011 = +310 , 1011 = −310
• Disadvantage: There are two representations of 0: 0000 (+0)
and 1000 (-0).
0001 = +110
1110 = −110
• Disadvantage: There are two representations of 0: 0000 (+0)
and 1111 (-0).