2 Feb 1995
Computers store information in bits. A bit has two values: on and off, or 0 and 1. Each time you add another bit it has two possible new values, so the number of possible total values doubles. Two bits have 4 values. Three bits have 8 values. Four bits have 16 possible values.
A long string of zeros and ones is hard to read. It is simpler to group things in packages that are easy to read and write. The first generation of computers in the early 1960's had no particular memory architecture, and it was common to cluster the bits in groups of three. This allowed the possible values to be represented from the set 0,1,2,3,4,5,6,7 ("octal notation"). As modern computers came to be built around bytes, each containing eight bits, the idea of three-bit groupings became intolerable.
A byte is more naturally divided into two halves, each with four bits. However, four bits have 16 possible values, so it is necessary to extend the ordinary set of digits. What happens next should not be a great surprise to anyone who can recognize the sequence:
2 3 4 5 6 7 8 9 10 J Q K A
Playing cards create a system of numbers with 13 values. They pick up the extra values using letters for Jack, Queen, King, and Ace. Computers create a system with 16 possible numbers, but they do it somewhat more smoothly using the sequence:
0 1 2 3 4 5 6 7 8 9 A B C D E F
This is the hexadecimal number system, commonly called hex. In this system, "A" is one more than "9" and represents the value we normally call "ten". Similarly, "B" is really eleven, and "F" is really fifteen. Just as adding one to "9" in the normal number system produces "10", so adding one to "F" in hex produces "10". The difference is that "10" in hex is the value we normally call "sixteen".
Each group of four bits can be represented by a single digit or letter. Each byte, therefore, can be represented by two such hex-digits. Hex becomes a convenient notation for representing numbers that have special meaning to the computer. For example, the one megabyte address has the value 100000. Hex values are not separated by commas. This number would usually be pronounced as "one, zero, zero, zero, zero, zero" and never as "one hundred thousand" because the latter is an ordinary decimal number. To avoid confusing hex with ordinary numbers, they are sometimes written preceded by a zero and an "x" ("0x", a convention borrowed from the C programming language). Thus 0x100000 is a way to make sure that the value is one megabyte and not one hundred thousand.
Copyright 1995 PC Lube and Tune -- Das Boot -- H. Gilbert
This document generated by SpHyDir another fine product of PC Lube and Tune.