Another result from engineering that has influenced the core nature of computers is that the design of devices that can distinguish between two alternatives is far easier than in the case of many alternatives. The device will be simpler and cheaper to manufacture as well. This difference can be seen, for example, in the relative complexity of Charles Babbage's difference engine, which operated in the decimal number system, and comparable modern "calculators" that use the binary number system. As a result, virtually every device within a computer is capable of making only binary distinctions.
While this might seem like a severe limitation, the power of symbolic representation allows us to codify a broad range of such distinctions in a simple, uniform fashion. Consider the types of binary distinctions we might want to make: a current might have a voltage that is either high or low; a magnetic field might be polarized either positively or negatively; a switch might be either open or closed; a device might be on or off. There are even some binary distinctions not motivated by hardware considerations: a statement might be either true or false; your answer might be either yes or no; a symbol might be either 0 or 1.
In fact the symbols 0 and 1 have been chosen to represent all of the binary distinctions that ever exist in a computer! They also serve as the building blocks for other codes and representations. For this reason we say that a computer uses binary representations. A single binary digit (0 or 1) is called a bit. (Eight of them are called a byte.)
One of the most obvious binary representations is the binary number system. This is where a sequence of ones and zeros is interpreted a code for some natural number. We will examine the following aspects of the binary number system: counting, base-conversion, and addition. All of arithmetic could, in principle, be translated to binary.
Before we can begin looking at the binary number system, we need to understand something called radix notation. Radix notation is a generalization of the idea we all learned in elementary school in which every column of a number represents a power of the base. You most likely leaned it in terms of there being a one's-place, a ten's-place, a hundred's-place, etc., where ten is the base of our decimal number system. In other words we learned that 4379 = 4 * 1000 + 3 * 100 + 7 * 10 + 9. Or that 4379 = 4 * 103 + 3 * 102 + 7 * 101 + 9 * 100. Notice that 10 is the base of the exponents in each term. This is because we are assuming the decimal number system (also known as base-10). The binary number system uses a similar radix notation, but with 2 as the base (it is also called base-2). For example, 11012 = 1 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 8 + 4 + 1 = 1310 (We will use subscripts to identify the base of a number). In binary there is a one's-place, a two's-place, a four's-place, an eight's-place, etc.
As you can see the only difference between the two number systems is the base. Actually, the decimal number system is as much a code or representation for numbers as binary is. When there is only one system we tend to forget that there is a difference between a number and its representation. Because both systems are based on the radix notation it is easy to understand one if you already understand the other.
Take counting for example. The decimal number system has ten symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9).
To count you start, first, by listing all the symbols in order, then adding a column and starting over
in the first column. You continue by incrementing a column every time you run out of symbols in the
column to its right. Counting in binary is exactly the same, only with fewer symbols.
| Decimal | Binary |
|---|---|
![]() |
![]() |
| Binary | Radix Conversion | Simplify | Decimal |
|---|---|---|---|
| 0 | 0 * 20 | 0 | 0 |
| 1 | 1 * 20 | 1 | 1 |
| 10 | 1 * 21 + 0 * 20 | 2 | 2 |
| 11 | 1 * 21 + 1 * 20 | 2 + 1 | 3 |
| 100 | 1 * 22 + 0 * 21 + 0 * 20 | 4 | 4 |
| 101 | 1 * 22 + 0 * 21 + 1 * 20 | 4 + 1 | 5 |
| 110 | 1 * 22 + 1 * 21 + 0 * 20 | 4 + 2 | 6 |
| 111 | 1 * 22 + 1 * 21 + 1 * 20 | 4 + 2 + 1 | 7 |
| 1000 | 1 * 23 + 0 * 22 + 0 * 21 + 0 * 20 | 8 | 8 |
| 1001 | 1 * 23 + 0 * 22 + 0 * 21 + 1 * 20 | 8 + 1 | 9 |
| 1010 | 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 | 8 + 2 | 10 |
| 1011 | 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20 | 8 + 2 + 1 | 11 |
Another technique involves repeatedly dividing the decimal number by 2 and keeping the remainders:
| 167 ÷ 2 = 83 R 1 |
| 83 ÷ 2 = 41 R 1 |
| 41 ÷ 2 = 20 R 1 |
| 20 ÷ 2 = 10 R 0 |
| 10 ÷ 2 = 5 R 0 |
| 5 ÷ 2 = 2 R 1 |
| 2 ÷ 2 = 1 R 0 |
| 1 ÷ 2 = 0 R 1 |
Finally, let's look at how the elementary school algorithm for addition carries over to binary numbers. In decimal, 347 + 95 = 442. Using the above algorithm we can convert 34710 into 1010110112 and 9510 into 10111112. In decimal addition the only way we know how to add two single digit numbers is to memorize all the combinations. For example we have all memorized that 7 + 5 = 12. In binary there are eight such combinations we need to know.


Numbers and arithmetic are only one of the many possible applications of binary representations. Unfortunately, it is one of the few circumstances in which a pre-existing representation (decimal) will provide such enormous clues in developing a binary encoding. For example, there is little rhyme or reason to the way in which characters are encoded into a binary form. Various standards have been developed simply to provide compatibility.
The most common character code standard has been the ASCII (American Standard Code for Information Interchange) code, which assigns a unique 1-byte pattern of bits to each character. Since each bit in a byte can be either a one or a zero, there are 28, or 256, unique patterns available. Originally, only seven of the bits were used, allowing for 128 characters in the ASCII set. Eventually, the eighth bit was used, resulting in Extended ASCII. There is also a relatively new standard called Unicode, that uses two bytes to represent a character, allowing for as many as 65,536 unique patterns! For another explanation of binary representations click here. Later in the quarter we will even look at how things like color graphics and sounds are encoded in a binary format.
Before we leave this topic to take a look under the hood of a PC, let's make sure that we have some terminology straight. We have defined bit and byte, but there are several related terms that are commonly used: kilobyte, megabyte, gigabyte, etc. For a very good and complete explanation of these terms (and some more exotic ones also) click here.