The shortcut version is to take the original binary number, 1011000111010111, and
break it into groups of four: 1011 0001 1101 0111. Each of the four then is evaluated as
a hexadecimal number:
1011 =
1 x 1 = 1
1 x 2 = 2
0 x 4 = 0
1 x 8 = 8
Total 11
Hex: B
0001 =
1 x 1 = 1
0 x 2 = 0
0 x 4 = 0
0 x 8 = 0
Total 1
Hex: 1
1101 =
1 x 1 = 1
0 x 2 = 0
1 x 4 = 4
1 x 8 = 8
Total 13
Hex = D
0111 =
1 x 1 = 1
1 x 2 = 2
1 x 4 = 4
0 x 8 = 0
Total 7
Hex: 7
Total Hex: B1D7
Hey! Presto! The shortcut conversion from binary to hexadecimal gives us the same
answer as the longer version.
You will find that programmers use hexadecimal fairly frequently in advanced program-
ming; but you’ll also find that you can work quite effectively in programming for a long
time without ever using any of this!
816 Appendix A
One common place to see the use of hexadecimal is when working with
color values. This is true in your C++ programs or even in other areas such as
HTML.
NOTE
29 0672327112_app_a.qxd 11/19/04 12:30 PM Page 816