Working with Numbers: Binary and Hexadecimal 811
A
There is one 64 in 88, so column 7 is 1 and 24 is the remainder. There are no 32s in 24
so column 6 is 0.
There is one 16 in 24 so column 5 is 1. The remainder is 8. There is one 8 in 8, and so
column 4 is 1. There is no remainder, so the rest of the columns are 0.
Column 87654321
Power 27 26 25 24 23 22 21 20
Value 1286432168421
882 01011000
Value 0640168000
To test this answer, convert it back:
1 * 64 = 64
0 * 32 = 0
1 * 16 = 16
1 * 8 = 8
0 * 4 = 0
0 * 2 = 0
0 * 1 = 0
88
Why Base 2? ..................................................................................................
Base 2 is important in programming because it corresponds so cleanly to what a com-
puter needs to represent. Computers do not really know anything at all about letters,
numerals, instructions, or programs. At their core they are just circuitry, and at a given
juncture there either is a lot of power or there is very little.
To keep the logic clean, engineers do not treat this as a relative scale (a little power,
some power, more power, lots of power, tons of power), but rather as a binary scale
(“enough power” or “not enough power”). Rather than saying “enough” or “not enough,”
they simplify it to “yes” or “no.” Yes or no, or true or false, can be represented as 1 or 0.
By convention, 1 means true or Yes, but that is just a convention; it could just as easily
have meant false or no.
After you make this great leap of intuition, the power of binary becomes clear: With 1s
and 0s, you can represent the fundamental truth of every circuit (there is power or there
isn’t). All a computer ever knows is, “Is you is, or is you ain’t?” Is you is = 1; is you
ain’t = 0.
29 0672327112_app_a.qxd 11/19/04 12:30 PM Page 811