
Preliminary Concepts: Binary NumbersComputers operate by using millions of electronic switches (transistors), each of which is either on or off (similar to a light switch, but much smaller). The state of the switch (either on or off) can represent binary information, such as yes or no, true or false, 1 or 0. The basic unit of information in a computer is thus the binary digit, or bit. Although computers can represent an incredible variety of information, every representation must finally be reduced to on and off states of a transistor. Let's start with representation of numbers, perhaps the simplest information to represent in a computer. When you see the string of digits 1297, you most likely interpret this as "one thousand two hundred ninetyseven." You use the base10 system (although not all cultures in history have done so), which means the rightmost digit represents the number of "ones," the next digit to the left represents the number of "tens," then "hundreds," and so forth. More formally, we could write the string as:
Notice that each place to the left represents a higher power of 10 (the base). Binary numbers work similarly, but with 2 as the base. For example, the string 10010 in binary is interpreted as follows:
which is eighteen. Another example is 101, which is interpreted as:
This is five. Using binary numbers, we can store any whole number in the computer, as long as we have enough transistors (switches) to represent all the bits. Many microprocessors use 32 bits to represent numbers, which means they can store any value from 0 up to 4,294,967,295. If larger numbers are needed, then more switches must be used to represent the additional bits. Let's count, starting from 1 in both base10 and base2:
In base10, there are ten digits (0 through 9) and after these are used, a new place (the 10s place) must be added to the left. In base2, there are two digits (0 and 1), after after these are used, a new place (the 2s place) must be added to the left. One more note: notice the pattern running vertically in the base2 count. The rightmost column alternates 0, 1, 0, 1, 0, 1. . . . The next column alternates two 0s and then two 1s: 0, 0, 1, 1, 0, 0, 1, 1. . . . The next column alternates four 0s and then four 1s, and so on. 



If you encounter technical errors, contact rit@calvin.edu. 