COA-CH2
COA-CH2
+ Number System
Number System
+
+
The Decimal System
System based on decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
to represent numbers
For example the number 83 means eight tens plus three:
83 = (8 * 10) + 3
The number 4728 means four thousands, seven hundreds,
two tens, plus eight:
83 = (8 * 101) + (3 * 100)
+ (6 * 10-3)
Most significant digit
The leftmost digit (carries the highest value)
02 = 010
12 = 110
Decimal notation
to binary notation:
Integer and fractional
parts are handled
separately
Converting
Between Binary
and Decimal
For the integer part, recall that in binary notation, an integer represented by
bm-1bm-2 . . . b2b1b0 bi = 0 or 1
N = 2 * N1 + R0 R0 = 0 or 1
N1 = 2 * N2 + R1 R1 = 0 or 1
so that
If next
N2 = 2N3 + R2
we have
Continued . . .
N = (N3 * 23) + (R2 * 22) + (R1 * 21) + R0
Integer
Because N >N1 > N2 . . . , continuing this
sequence will eventually produce a quotient Nm-1 s
= 1 (except for the decimal integers 0 and 1,
whose binary equivalents are 0 and 1,
respectively) and a remainder Rm-2, which is 0 or
1. Then
Table 9.3
Decimal,
Binary, and
Hexadecimal
Hexadecimal Notation
In most computers,
binary data occupy It is extremely easy to
It is more compact some multiple of 4 bits, convert between
than binary notation and hence some binary and
multiple of a single hexadecimal notation
hexadecimal digit