|
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 ninety-seven." You use the base-10 system (although not all cultures in history have done so), which means the right-most 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 base-10 and base-2:
In base-10, 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 base-2, 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 base-2 count. The right-most 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 computing@calvin.edu. |