Java Reference
In-Depth Information
The binary system is the simplest possible set of symbols with which
we can count and perform positional arithmetic. Hexadecimal numbers,
also called hex, are a convenient shorthand for representing groups of
fourbinarydigits. Figure3-1 showstherelationbetweenagroupoffour
electronic cells and various number systems.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Hex
Binary
Decimal
Figure 3-1 Decimal, Binary, and Hex Numbers
If we think of each cell as a miniature light bulb, then the binary num-
ber 1 can be used to represent the state of a charged cell (light bulb ON)
and the binary number 0 to represent the state of an uncharged cell (light
bulb OFF). In this sense, we say that a bit is set if its binary value is 1 and
that a bit is reset, or clear, if its binary value is 0.
Hex numbers
Therightmostcolumnin Figure3-1 containsthehexnumbers.Hexnum-
bers are convenient because they are a shorthand way for representing
groups of four binary digits. These groups of four electronic cells are the
 
Search WWH ::




Custom Search