Up until now the labs have dealt with electricity in its analog form where a quantity is described by the amount of voltage, or current, or charge... expressed as a real number. However a large proportion of electronic equipment, including computers, uses digital electronics where the quantities (usually voltage) are described by two states; on and off. These two states can also be represented by true and false, 1 and 0, and in most physical systems are represented by the voltages 5V and 0V, or something close to that. While the restriction to two states seems limiting it makes many things easier because problems due to noise are minimized. It is generally very easy to reliably distinguish between logic 1 or logic 0.
Since many quantities cannot be represented by two states, more than one binary digit can be used to represent a number. For example the number 2510 (twenty five base 10) can be represented by the binary number 110012. It is easy to convert back and forth from binary to decimal by remembering that each digit in a binary number simply corresponds to a power of 2, as every digit in a decimal number corresponds to a power of 10. Using the previous example: 101 | | 100 | | 24 | | 23 | | 22 | | 21 | | 20 | (10) | | (1) | | (16) | | (8) | | (4) | | (2) | | (1) | 2 | | 5 | = | 1 | | 1 | | 0 | | 0 | | 1 | 2*10 | + | 5*1 | = | 1*16 | + | 1*8 | + | 0*4 | + | 0*2 | + | 1*1 |
In general an n digit binary number can represent numbers from 0 to 2n-1. For instance a byte is 8 bits and can represent numbers from 0 to 255 (28-1). Combinatorial Logic
Another advantage of digital electronics is the ability to express signals in terms of logic equations using standard terms from logic: and, or, and not. These functions can be represented by truth tables as shown below with A and B as inputs and C as output. and | | or | | not | A | B | C | | A | B | C | | A | C | 0 | 0 | 0 | | 0 | 0 | 0 | |