2013: Advent Computing: Bytes and bigger

by on December 5, 2013

We now know a single “1” or “0” is called a bit, and eight of them is a byte, the standard unit most computers use for handling numbers. But that’s not actually true. Or at least it’s an over-simplification.

See, our Turing machine only ever looks at one point on its roll of tape; getting to another point of the tape is just a case of moving so many times to the left or right. But think about looking up a word in the dictionary. You’re at “Constant” and want to look up “Mill”. But rather than being able to just skip to the middle of the dictionary, you have to turn through every page and check every entry between the two. That’s what a Turing machine does.

Real computers take a shortcut and do what we’d do: they turn straight to the correct page. And because they’re working with consecutive numbers, there aren’t any gaps so they can actually turn to the correct page, rather than opening the book somewhere around “M” and flicking through from there.

If I’m writing a program for a real computer, I’ll want to look up some number in memory a lot. Like, really, a lot. Whether it’s some interim value in a calculation, the text of a message to display on screen, or simply the next instruction to perform, computers do a lot of memory look-ups. And it does that by giving each byte an “address”, which means exactly what you’d expect it to – a specific place to go and look up that value.

Now if my computer only handles one byte at a time, that means the biggest number it can handle is 255. That means the biggest memory address it can have is 255, so any program running on it had better not want to look up more than 255 bytes of memory. Not very useful.

Thus modern computers will handle much bigger numbers. A 32-bit computer will routinely handle 32-bit numbers, i.e. between 0 and 4,294,967,296. That means a program running on a 32-bit computer can easily address things in up to four gigabytes of memory.

Once, 32 bits was plenty, but 4GB isn’t a lot any more. A 64-bit computer can, without jumping through any extra hoops, look things up in up to 16 exabytes of memory. It can also perform a whole bunch of calculations on 64-bit numbers a lot faster than its 32-bit equivalent could.

Of course, in the same way that we can use a more convoluted series of steps from one machine language to do things on another, we can use a 32-bit computer to work with numbers that can’t fit into a mere 32 bits. But it’s considerably slower and harder work.

The reverse isn’t true, though – a 64-bit computer can generally do anything a 32-bit computer can very nearly as quickly. Some things don’t work, but most do, because the machine languages used by 64-bit processors were designed to include everything the 32-bit processors had. You can consider it like having a language where most people can only cope with words that only have three syllables or less. When you add people who can understand four-syllable words, the three-syllable words still make sense, but if you have two people who both understand words with four syllables, you can use them to make your conversations a lot easier.

Leave a Reply