2013: Advent Computing: More things with numbers

by on December 4, 2013

The last two posts have been about how a computer converts between the numbers it stores and letters and symbols you see on your screen or out of your printer. But computers don’t just use numbers for storing text. Computers use numbers for everything. One of the most important things a computer uses numbers for is instructions.

Any computer will only have a number of things it can do at any one point. If we think back to the Turing machine, the only options it has are to move left one space, move right one space, to write a one or a zero, or to stop. If we were to assign each of those options a number, we could write a computer program (which is really just a whole bunch of instructions for the computer to follow) just by writing out a bunch of numbers. And fundamentally, that’s exactly what computer programs are.

Of course, just as real computers are more complicated than that simple Turing machine, real programs are more complicated than Turing machine programs. We call the correlation between different numbers and what they tell your computer to do a “machine language”.

When your computer comes across a number, it might mean it should write some specific number (which might be pre-determined, or might be read from, say, your keyboard) to a bit of memory. Alternatively, it might mean the computer should add the numbers that are in some bit of memory then store the result somewhere. Or it might mean the computer should compare two numbers and jump to a completely different bit of the program if they’re equal.

To make things more complicated, different computers have different machine languages. You’ll often find different machine languages in use on the same computer, even. For example, a PC graphics card will mostly be performing some very specific sorts of calculations, so the calculations we expect it will do often can be done as a single instruction in its machine language, despite them requiring some complex sequence on the main processor (i.e. something that would require a long sequence of numbers for your regular processor to understand can be done with a single number on your graphics card). This is not dissimilar to how some spoken languages have a single word which requires a lengthy sentence to explain in English (such as “Desenrascanco”, a Portuguese word meaning the improvisation of a dubious but effective emergency solution to a problem).

And now we understand a little bit more about what we can do with numbers, we’ll be able to talk about what the real difference between 32-bit and 64-bit is, how computer programs are made, and how we’re making lives a bit more difficult for computer viruses.

Leave a Reply