Update Research Note Form
Research Note Topic:
Research Note Description:
THE BINARY NUMBER SYSTEM
All digital computers are basically collections of switches. Each switch has two possible positions: open, "0", or off; and closed, "1", or on. The two positions form the basis of the binary (or two-valued: 0, 1) number system. Otherwise, the computer uses numbers as we do in the familiar decimal system.
Any number can be represented in binary as well as in decimal form. For example, the number 1,985 expressed in binary form is 11111000001. As is the case with decimal numbers, we can interpret a binary number as the sum of a series of powers of the base number.
Numbers can be used to represent nonnumerical quantities, such as letters of the alphabet and punctuation marks. A standard code is often used to assign specific patterns of binary numbers to printable characters.
Binary numbers can also be used to represent the results of logical operations. For example, if 1 represents TRUE and 0 represents FALSE, we can represent all logical functions (except "maybe") by sequences of binary numbers. We can then arrange the circuits of a computer to make logical tests on statements given to the machine. These logic circuits enable the CPU (central processor unit) to react to an incoming instruction or piece of data.
For example, an important feature of the computer (and of the human mind) is the ability to decide between two alternatives. Suppose the computer must decide who in a group of people are at least 21 years of age. The computer examines the item of data labelled "age" for each member of the group. Each time it examines the age, a logic circuit in the CPU compares the binary number for the age with the binary number for 21. If the age number is equal to or greater than 21, the circuit produces a 1, for TRUE. If the age number is less than 21, the circuit produces a 0.
The type of circuit used for logical comparisons is called a gate because the circuit acts to pass on 1's, like a gate in a fence, only for the logical conditions for which it is set. There are two basic kinds of gate: AND and OR, representing the two basic kinds of logical decision to be made. In the simplest form, each gate has two inputs and one output. An AND gate produces a 1 at its output only if both of its inputs are also 1. An OR gate produces a 1 at its output if either or both of its inputs are 1's. A third kind of gate, called an XOR gate (exclusive OR), produces a 1 at its output only if one input but not the other is a 1. In other words, an AND gate produces 0's unless both inputs are 1's; an OR gate produces 0's only if both inputs are 0; an XOR gate demands one of each.
To see how this works, suppose a computer is in charge of baking a roast in a microwave oven. The owner of the oven programs it to stop cooking the roast when either the preset time has elapsed or the thermometer in the roast reads 140°F. The logic gate used by the computer in the oven for this task is an OR gate. At the start of the cooking process, neither the timer output nor the thermometer output satisfies the conditions set in the oven (timer output greater than or equal to 30 minutes, thermometer output greater than or equal to 140). Therefore, the OR gate will produce a 0 at its output, since both inputs are 0. At some point one or both of the conditions will be met and the OR gate will produce a 1, thereby shutting down the oven.
Now suppose the chef, knowing it is possible to get a thermometer reading that is too high if the thermometer is touching the bone in the roast, sets the oven to stop cooking when the thermometer has at least reached a certain point and the proper cooking time has elapsed. The difference between this and the previous situation is that an AND gate is used in the microwave computer: the gate produces the required 1 only when both the temperature has reached 140°F. and the roast has cooked for 30 minutes. All the complex logical operations of much more sophisticated computers can be reduced to combinations of logic-gate operations much like those described.
Prof. Ashay Dharwadker