Computers Speak Binary
Contents
2.3.3. Computers Speak Binary#
As electronic computers became faster and more available, scientists began to rely on electronic computers to automatically perform their calculations instead of on human computers.
But computers don’t speak human languages like the human computers did. Instead, computers speak binary:
I speak English, and so I can come up with an English statement of what I want the computer to do, like:
“Retweet all tweets that mention me.”
But a computer only understands instructions that are written in binary, which is composed entirely of 0s and 1s. So somehow I’ll need to turn my English instruction into binary instructions, so the computer can understand.
Binary#
Early in the history of computers, the designers of computers decided that the easiest way of making them work was to use the binary numbering system, since the 0s and 1s could be represented easily through physical means like a switch being on (which represents 1) or off (which represents 0).
These 0s and 1s, can then be used to represent numbers, like this:
decimal 0 → binary 0
decimal 1 → binary 1
decimal 2 → binary 10
decimal 3 → binary 11
decimal 4 → binary 100
decimal 5 → binary 101
decimal 6 → binary 110
decimal 7 → binary 111
decimal 8 → binary 1000
decimal 9 → binary 1001
decimal 10 → binary 1010
…
But these binary 0s and 1s can be used for more than just representing numbers. In 1842, Ada Lovelace realized that a full computer (which was only a theoretical possibility at the time) could represent and work with all sorts of things:
[Computers] might act upon other things besides number […] Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the [computer] might compose elaborate and scientific pieces of music of any degree of complexity or extent.
Augusta Ada King, Countess of Lovelace (1815-1852). Fun fact for those of you who are interested English Poetry: Ada Lovelace was the daughter of the poet Lord Byron.
Everything a modern computer does happens through binary. So all information is stored in binary, such as:
Text (like in this book). For example: “A” can be stored as “1000001” and “B” can be stored as “1000010”
Images are represented as a grid of points called pixels, and each pixel has a number representing it’s color in terms of Red, Green, and Blue. So a pixel with the color of “000000001111111100000000” would be green.
Social media connections. For example, somewhere in Facebook’s computer systems is information stored with your ID number, and it has a list of the ID numbers of the people you are friends with.
Additionally, all the instructions which tell a computer what to do are stored in binary as well. For example, in the Intel 8080 computer:
“00010100” means “add 1 to the number stored in register #2”
“11010010” means “jump to another set of instructions if condition #2 is true”
These instructions and information are combined together to make any website you use, any computer game you play, and any online textbook you read.
So how do people turn their ideas into binary computer instructions?