Java Reference
In-Depth Information
All number systems with bases greater than 10 use letters as digits. For exam-
ple, base 12 has the digits 0 through B and base 19 has the digits 0 through I.
However, beyond having a different set of digits and a different base, the rules
governing each number system are the same.
Keep in mind that when we change number systems, we are simply changing
the way we represent values, not the values themselves. If you have 18 10 pencils,
it may be written as 10010 in binary or as 12 in hexadecimal, but it is still the
same number of pencils.
Figure B.4 shows the representations of the decimal values 0 through 20 in
several bases, including base 8, which is also called octal. Note that the larger the
base, the higher the value that can be represented in a single digit.
Binary
(base 2)
Octal
(base 8)
Decimal
(base 10)
Hexadecimal
(base 16)
0
1
0
1
0
1
0
1
10
11
100
2
3
4
2
3
4
2
3
4
101
110
111
5
6
7
5
6
7
5
6
7
1000
1001
1010
10
11
12
8
9
8
9
A
10
11
12
1011
1100
1101
13
14
B
C
D
15
16
17
13
14
15
1110
1111
E
F
10000
10001
10010
20
21
22
16
17
18
10
11
12
10011
10100
23
24
19
20
13
14
FIGURE B.4 Counting in various number systems
 
Search WWH ::




Custom Search