Interpret | 0 as false |
1 as true |
Such circuits can be used to do binary arithmetic.
Such circuits can be used to implement memory.
Digits 0 to 9, powers of 10. Example:
2 | × | 100 | 2 | × | 102
245 | = | + | 4 | × | 10 | = | + | 4 | × | 101
| | | + | 5 | × | 1 | | + | 5 | × | 100
| |
When I turned two I was really anxious, because I'd doubled my age
in a year. I thought, if this keeps up, by the time I'm six
I'll be ninety. Steven Wright (Is he right?) |
Digits 0 to 1, powers of 2. Example:
1 | × | 4 | 1 | × | 22 | |||||
101 | = | + | 0 | × | 2 | = | + | 0 | × | 21 |
+ | 1 | × | 1 | + | 1 | × | 20 |
3 | 7 | 4 | |
+ | 4 | 6 | 8 |
Add the 1's column: 8 + 4 = 12, or 2 with 1 to carry
1 | |||
3 | 7 | 4 | |
+ | 4 | 6 | 8 |
2 |
Add the 10's column: 1 + 7 + 6 = 4 with 1 to carry
1 | 1 | ||
3 | 7 | 4 | |
+ | 4 | 6 | 8 |
4 | 2 |
Add the 100's column: 1 + 3 + 4 = 8
1 | 1 | ||
3 | 7 | 4 | |
+ | 4 | 6 | 8 |
8 | 4 | 2 |
0 | 1 | 1 | 1 | |
+ | 0 | 1 | 1 | 0 |
Add 1's column: 1 + 0 = 1
0 | 1 | 1 | 1 | |
+ | 0 | 1 | 1 | 0 |
1 |
Add 2's column: 1 + 1 = 0 with 1 to carry
1 | ||||
0 | 1 | 1 | 1 | |
+ | 0 | 1 | 1 | 0 |
0 | 1 |
Add 4's column: 1 + 1 + 1 = 1 with 1 to carry
1 | 1 | |||
0 | 1 | 1 | 1 | |
+ | 0 | 1 | 1 | 0 |
1 | 0 | 1 |
Add 8's column: 1 + 0 + 0 = 0
1 | 1 | |||
0 | 1 | 1 | 1 | |
+ | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 1 |
Confirmation that results match decimal arithmetic:
1 | 1 | ||||
0 | 1 | 1 | 1 | (0+4+2+1=7) | |
+ | 0 | 1 | 1 | 0 | (0+4+2+0=6) |
1 | 1 | 0 | 1 | (8+4+0+1=13) |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
2 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
3 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
4 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
5 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
6 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
7 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
8 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
9 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
0 | 1 | |
---|---|---|
0 | 0 | 1 |
1 | 1 | 10 |
We have already seen how to implement this with AND and XOR gates.
![]() |
The maximum number that can be stored in 64 bits
(~2×1018)
1018 bits: estimated storage capacity of iPods sold
in first 3 months of 2005. |
‘Bits of genetic info’ doesn't include information other than base-pair sequences (e.g., Sci. Am., 2003 Nov & Dec) | |
‘No. of brain synapses’ as a measure of brain complexity doesn't include control by glial cells (e.g., Sci. Am., 2004 Dec) |
The world is analogue: measurements vary continuously from one value to another as time advances continuously.
Digital computers are discrete: they use a finite precision (number of bits) to represent numbers at specific instants in time.
![]() | ![]() |
![]() |
A sound card's output is an example of digital-to-analogue
conversion.
Input from its microphone is an example of analogue-to-digital
conversion.
Scanners and digital cameras are also examples of
analogue-to-digital conversion.
Examples of analogue signals are ECG's, EEG's, EMG's, EOG's, ABR's, OAE's, ...
To digitize we must first choose a sampling frequency and the
number of bits/sample.
The results can be very poor if we have too few samples or too few bits.
A binary number can be converted to an analogue signal by adding values
which are powers of two.
A binary counting circuit (adding one at each cycle) as the
input to a digital-to-analogue converter will produce
a sawtooth wave.
We can convert an analogue signal to digital samples by comparing
it with the sawtooth wave and recording the binary number when the
sawtooth signal is first greater than the signal being converted.