6/7/10

Who Needs More Than 640kB?

I am thinking about bit representations in my compiler, and I wonder about the x86-64 bit model. Most modern desktops have about 4-16GB memory, I think. A byte is 8 bits, therefore encoding one out of 28 values. A kilobyte is 10241 = 210 bytes, a megabyte is 10242 = 220 bytes, a gigabyte is 10243 = 230 bytes. At least according to binary number interpretation, your local vendor may disagree.

Now, in a 32 bit address space, you can index 232 bytes, or 22 x 230, is 4GB of data. Thing is, for desktop models, we are somewhat at the end of what we need for memory. The 64 bit encoding generates pretty fat binaries, and I am really clueless where all the memory goes. At the other end, the computer word to address space ratio is ridiculous at the moment. Why do we address individual bytes on a 64 bit address space machine? It is just as ridiculous as being able to address individual bits on a 64kB machine.

In my opinion, they shouldn't have doubled the address space, but they should have quadrupled the word size first.

On a 32 bit machine with 32 bit words, you can have 16GB of byte data which is just enough for current standards. My best guess is they didn't want to because the C language, in which most operating systems are written, just assumes characters are 8 bits wide, and because high-end systems will want more addressable space. But still, 32 bit words are a good choice, and in the Internet era it makes sense to standardize on 32 bit wide characters and just bit pack older data.

Then again, who cares about 2 bits when you got 64 of em?