wunder · Library

Part 17

Computers—the Machines We Think With · D. S. Halacy — chapter 17 of 67 · ~1,454 words · public domain

Read in the Wunder reader — free

There is an interesting extension of this process called duplication by which multiplication can be done quite simply. Let us multiply 95 times 36. We will halve our 95 as we did in the earlier example, while doubling the 36. This time when we have an even number in the left column, we will simply cancel out the corresponding number in the right column.

95 36 47 72 23 144 11 288 5 576 2 **** 1 2304 —— 3420

This clever bit of mathematics is called Russian peasant multiplication, although it was also known to early Egyptians and many others. It permits unschooled people, with only the ability to add and divide, to do fairly complex multiplication problems. Actually it is based on our old stand-by, the binary system. What we have done is to represent the 95 “dyadically,” or by twos, and to multiply 36 successively by each of these powers as applicable. We will not digress further, but leave this as an example of the tricks possible with the seemingly simple binary system.

Even after we have learned to convert from the decimal numbers we are familiar with into binary notation almost by inspection, the results are admittedly unwieldy for human handling. An employee who is used to getting $105 a week would be understandably confused if the computer printed out a check for him reading $1101001. For this reason the computer programmer has reached a compromise with the machine. He speaks decimal, it speaks binary; they meet each other halfway with something called binary-coded decimal. Here’s the way it works.

A little thought will show that the decimal numbers from 0 through 9 can be presented in binary using four bits. Thus:

Decimal Binary 0 0 1 1 2 110 3 111 4 1100 5 1101 6 1110 7 10111 8 11000 9 11001

In the interest of uniformity we fill in the blanks with 0’s, so that each decimal number is represented by a four-digit block, or word, of binary code. Now when the computer programmer wants to feed the number 560 into the computer in binary he breaks it into separate words of 5, 6, and 0; or 0101, 0110, and 0000. In effect, we have changed $5 words into four-bit words! The computer couldn’t care less, since it handles binary digits at the rate of millions a second; and the human is better able to keep his marbles while he works with the computer. Of course, there are some computers that are classed as pure binary machines. These work on mathematical problems, with none of the restrictions imposed by human frailty. For the computer the pure binary system is more efficient than the binary decimal compromise.

The four-digit words can be made to represent not only numbers, but letters as well. When this is done it is called an alpha-numeric or alphameric code. Incidentally, it is conceivable that language could be made up of only 1’s and 0’s, or perhaps a’s and b’s would be better. All it would take would be the stringing together of enough letters to cover all the words there are. The result would be rather dull, with words like aabbababaabbaaba, bbaabbaabababaaabab, and aaaaaaaaabaaa; it is doubtful that the computer will make much headway with a binary alphabet for its human masters.

In the early days of binary computer work, the direct conversion to binary code we have discussed was satisfactory, but soon the designers of newer machines and calculating methods began to juggle the digits around for various reasons. For one thing, a decimal 0 was represented by four binary 0’s. Electrically, this represents no signal at all in the computer’s inner workings. If trouble happened, say a loose connection, or a power failure for a split second, the word 0000 might be printed out and accepted as a valid zero when it actually meant a malfunction. So the designers got busy trying other codes than the basic binary.

One clever result is the “excess-3” code. In this variation 3 is added to each decimal number before conversion. A decimal 30 is then represented by the word 0011 instead of 0000. There is, in fact, no such computer word as 0000 in excess-3 code. This eliminates the possibility of an error being taken for a 0. Excess-3 does something else too. If each digit is changed, that is, if 1’s become 0’s and 0’s become 1’s, the new word is the “9’s complement” of the original. For example, the binary code for 4 in excess-3 is 0111. Changing all the digits, we get 1000, which is decimal 5. This is not just an interesting curiosity, but the 9’s complement of 4 (9 minus 4). Anyone familiar with an adding machine is used to performing subtraction by using complements of numbers. The computer cannot do anything but add; by using the excess-3 code it can subtract by adding. Thus, while the computer cannot subtract 0110 from 1000, it can quite handily add 1001 to 1000 to get the same result.

There are many other reasons for codes, among them being the important one of checking for errors. “Casting out nines” is a well-known technique of the bookkeeper for locating mistakes in work. Certain binary codes, containing what is called a “parity bit,” have the property of self-checking, in a manner similar to casting out nines. A story is told of some pioneer computer designers who hit on the idea of another means of error checking not as effective as the code method.

The idea was clever enough, it being that identical computers would do each problem and compare answers, much like the pairs of abacus-wielders in Japan’s banks. In case both computers did not come up with the same answer, a correction would be made. With high hopes, the designers fed a problem into the machines and sat back to watch. Soon enough a warning light blinked on one machine as it caught an error. But simultaneously a light blinked on the other. After that, chaos reigned until the power plugs were finally pulled. Although made of metal and wires, the computers demonstrated a remarkably human trait; each thought the other was wrong and was doing its best to change its partner’s answer! The solution, of course, was to add a third computer.

Binary decimal, as we have pointed out, is a wasteful code. The decimal number 100 in binary decimal coding is 0001 0000 0000, or 12 digits. Pure binary is 1100100, or only 7 digits. By going to a binary-octal code, using eight numbers instead of ten, the words can be 3-bit instead of 4-bit. This is called an “economy” code, and finds some application. There are also “Gray” codes, reflected binary codes, and many more, each serving a particular purpose. Fortunately for the designer, he can be prodigal with his use of codes. With 4-bit words, 29 billion codes are available, so a number of them are still unused.

Having translated our decimal numbers into code intelligible to our computer, we still have the mathematical operations to perform on it. With a little practice we can add, subtract, multiply, and divide our binary numbers quite easily, as in the examples that follow.

Addition: 1100 (12) 0111 ( 7) —— —— 10011 (19)

Subtraction: 1010 (10) - 0010 ( 2) ——— —— 1000 (8)

Multiplication: 0110 (6)

× 0011 (3)

——— –——

0110

0110

0000

0000

———

10010 (18)

TN1 Division: 1010 ÷ 10 = 0101 (10 ÷ 2 = 5)

The rules should be obvious from these examples. Just as we add 5 and 5 to get 0 with 1 to carry, we add 1 and 1 and get 0 with 1 to carry in binary. Adding 1 and 0 gives 1, 0 and 0 gives 0. Multiplying 1 times 1 gives 1, 1 times 0 gives 0, and 0 times 0 gives 0. One divides into 1 once, and into 0 no times. Thus we can manipulate in just the manner we are accustomed to.

The computer does not even need to know this much. All it is concerned with is addition: 1 plus 1 gives 0 and 1 to carry; 1 plus 0 gives 1; and 0 plus 0 gives 0. This is all it knows, and all it needs to know. We have described how it subtracts by adding complements. It can multiply by repetitive additions, or more simply, by shifting the binary number to the left. Thus, 0001 becomes 0010 in one shift, and 0100 in two shifts, doubling each time. This is of course just the way we do it in the decimal system. Shifting to the right divides by two in the binary system.

← Previous chapterAll chaptersNext chapter →

Computers—the Machines We Think With · The Wunder Library — complete classics, free to read, with narration.

© 2026 Wunder Learning LLC · Terms & Privacy