Cast of Characters:
Tech Wannabe, a young tech student training for A+ Certification
Surly Old Tech, a surly old tech
Bambi Tech, resident tech goddess
____________
Scene opens on a clear day in Houston (okay, there's a slight yellowish tint to the sky, but it's just a little ozone), deep inside the Total Seminars Tower (a.k.a., The Lair). A young student tech stares in horror at the faintly glowing CRT and reaches for the Panic Button.
Surly Old Tech: (exaggerated sigh into the speaker phone) Whadda ya want now, kid?
Tech Wannabe: Help me, O Great One! An error popped up on my screen with Windows complaining about an error at 0001:C406. What does that mean?
SOT: It's just a memory address. Deal with it and get on with your life.
Tech Wannabe: But wait! I have other questions! I was in Device Manager and it shows my modem with an I/O address of 03F8, but it says here in Mike's book that COM1 is 3F8. What gives?
SOT: Look, kid, it's just an I/O base address. It's not rocket science or anything. Don't you have monitors to polish somewhere?
Tech Wannabe: Please, O Ancient, Wise, and Venerable Tech Master, please just tell me what's up with the LETTERS!!!!
SOT: (sputters) What? Don't they teach you anything at University? It's hex, shorthand for binary notation. Got it? Now go bug somebody else for a change! (CLICK and dial tone)
Just then, Bambi swoops in to the rescue of the poor, shivering, clueless student.
Bambi Tech: You have much to learn, young one, and I have much to teach you. But first, let's talk about hexadecimal, binary, and how it all relates to the PC. SOT doesn't really understand all this, which is why he hung up on you. Don't take it personally.
Bambi turns from the wide-eyed newbie and saunters over to the whiteboard. Grabbing a hot red marker, she whirls around and begins her lecture.
Wires, Wires, Everywhere
Everything in the PC flows through wires, little electrons zipping about hither and thither, merrily making magic happen. Communication within the PC always runs in parallel, meaning multiple wires transfer the data at the same time. You know all this, right?
When a Pentium 4 CPU uses the address bus to tell the chipset to grab a specific line of code in RAM, it uses 32 wires for the communication. What could that command look like?
10101001001010111010110010010101
That tells you a lot, doesn't it?
Binary
Each of the 32 wires can be in one of two states, either with electricity or without. You'll commonly hear that in shorthand as on or off, and as 1 or 0, respectively. With 32 wires, you can have over 4 million unique combinations of 1 and 0.
Which brings us to the real problem. The computer has no problem handling strings of 32 or 64 ones and zeros in rapid succession, but what if we binarily-challenged humans had to speak that way? For example, try telling another person to write down the following series of ones and zeros as you dictate them:
0010010001001001001000100100100100100
0010011111110101010101010000101011100
I guarantee that they will mess up somewhere as they try to write them down. Forget it! Although your computer is very good at talking in ones and zeros, we human beings find it very difficult.
What we need is some kind of shorthand, some way to talk about ones and zeros so that our fellow human beings can understand. This is where hexadecimal becomes very useful. We use hexadecimal as a shorthand description of the state of wires.
Hexadecimal
Pretend that you have a computer with a 4-wire address bus. How many different patterns can you create? Well, look at all the possibilities of ones and zeros with four wires:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
There are 16 different possibilities. Although no computer has only a 4-wire address bus, just about every processor ever built has an address bus with a multiple of four wires (8, 16, 20, 24, 32). The largest common denominator of all these address bus sizes is four.
You can use this four-binary-digit grouping to create shorthand by representing any combination of four ones and zeros with a single character. Since there are 16 different combinations, the 16 unique characters of the base-16 numbering system called hexadecimal were the natural choice. The hex shorthand looks like this:
| Binary Number | Hexadecimal Value | |
| 0000 | All wires off | 0 |
| 0001 | Only 4th wire on | 1 |
| 0010 | Only 3rd wire on | 2 |
| 0011 | 3rd and 4th on | 3 |
| 0100 | Only 2nd wire on | 4 |
| 0101 | 2nd and 4th wire on | 5 |
| 0110 | 2nd and 3rd wire on | 6 |
| 0111 | Only 1st wire off | 7 |
| 1000 | Only 1st wire on | 8 |
| 1001 | 1st and 4th on | 9 |
| 1010 | 1st and 3rd on | A |
| 1011 | Only 2nd off | B |
| 1100 | 1st and 2nd on | C |
| 1101 | Only 3rd off | D |
| 1110 | Only 4th off | E |
| 1111 | All wires on | F |
So, when we talk about a particular 16-bit pattern being sent to a device on the address bus, we do not say things like:
0000000111110000
First, mentally break these sixteen digits into four sets of four:
0000 0001 1111 0000
Then give each four-character set its hex shorthand (refer to the table above): 0000 (0), 0001 (1), 1111 (F), 0000 (0). So, instead of a bunch of ones and zeros, you can say something like 01F0.
Where you might see hex in modern PCs: I/O Addresses and Memory Addresses
PCs use 16 bits for I/O addressing, displayed as four hexadecimal characters. They range from all zeros—0000 (0), 0000 (0), 0000 (0), 0000 (0)—to all ones—1111 (F), 1111 (F), 1111 (F), 1111 (F). All of the possible I/O addresses can be represented by four-digit hexadecimal values, starting at 0000 and ending at FFFF.
Old DOS-based memory management relied on 20 wires, displayed as five hexadecimal characters: 00000-FFFFF. With 20 wires, you could generate 220 or 1,048,576 different combinations of ones and zeros, from: 00000000000000000000 to 11111111111111111111—with about 1,048,574 combinations in between.
Each combination of charged and uncharged wires represents one memory location. IBM declared that each memory location should be 8 bits long. Since 8 bits = 1 byte, the original DOS PC could address 1,048,576 different one-byte memory locations. This number is 1 megabyte (1 MB).
Current systems use 32 bits for memory addressing, using eight hexadecimal characters to display addresses. It's a bit unwieldy, but better than the binary equivalent!
In a real world setting, most techs need simply to record the memory addresses listed in error messages and check the numbers for patterns. If you find the same locations cropping up in multiple error messages, it indicates potentially bad RAM rather than the more common buggy software issues.
Finale
Bambi finishes the lecture, caps her red marker, and smiles beatifically.
Bambi Tech: Any questions?
Tech Wannabe: Gaaaaaa
Bambi Tech: (frowning slightly) Hello? Did you catch any of that?
Tech Wannabe: Gaaaaaa... (clicks his mouth shut twice before words come) Thank you, thank you, thank you! You made my day and possibly the next week or two!
Bambi Tech: (smiles brightly) I'm sooo glad! Any time.
Bambi saunters out of the room.
Young tech student finally blinks.
- Thibodeaux/Meyers