Basic Computer Notions Hardware

Basic logic gates

Interpret 0 as false
1 as true



And gate
Or gate
Xor gate
Add circuit

Such circuits can be used to do binary arithmetic.

Such circuits can be used to implement memory.

Binary arithmetic

Decimal number system

Digits 0 to 9, powers of 10. Example:
2×100 2×102
245 = +4× 10 = +4×101
+5× 1 +5×100

Binary number system

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

Decimal addition

374
+468

Add the 1's column: 8 + 4 = 12, or 2 with 1 to carry
1
374
+468

2

Add the 10's column: 1 + 7 + 6 = 4 with 1 to carry
11
374
+468

42

Add the 100's column: 1 + 3 + 4 = 8
11
374
+468

842

Binary addition

0111
+0110

Add 1's column: 1 + 0 = 1
0111
+0110

1

Add 2's column: 1 + 1 = 0 with 1 to carry
1
0111
+0110

01

Add 4's column: 1 + 1 + 1 = 1 with 1 to carry
11
0111
+0110

101

Add 8's column: 1 + 0 + 0 = 0
11
0111
+0110

1101

Confirmation that results match decimal arithmetic:
11
0111(0+4+2+1=7)
+0110(0+4+2+0=6)

1101(8+4+0+1=13)

Decimal addition table

 0123456789
0 0123456789
1 12345678910
2 234567891011
3 3456789101112
4 45678910111213
5 567891011121314
6 6789101112131415
7 78910111213141516
8 891011121314151617
9 9101112131415161718

Binary addition table

 01
0 01
1 110

We have already seen how to implement this with AND and XOR gates.

Memory and storage devices








The maximum number that can be stored in 64 bits (~2×1018)
‘is enough to provide a unique ID for one transaction per second for every person on the planet for the next 50 years. It is also the number of grains in about a cubic mile of sand.’
(From Special Edition Using Java, 2nd Edition)

1018 bits: estimated storage capacity of iPods sold in first 3 months of 2005.
(J. Cole (2005): Computer 38(9): 103)

‘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)

Analogue vs. digital

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.
Sound card Microphone
Speaker

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.

Scanner guy Digital camera Scanners and digital cameras are also examples of analogue-to-digital conversion.

ECG signal Examples of analogue signals are ECG's, EEG's, EMG's, EOG's, ABR's, OAE's, ...

Sampling parameters To digitize we must first choose a sampling frequency and the number of bits/sample.

Sampled ECG The results can be very poor if we have too few samples or too few bits.

Digital-to-analogue conversion

Digital-to-analogue conversion A binary number can be converted to an analogue signal by adding values which are powers of two.

Analogue-to-digital conversion

Sawtooth wave A binary counting circuit (adding one at each cycle) as the input to a digital-to-analogue converter will produce a sawtooth wave.

Analogue-to-digital converter 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.


Bacon home page
R. Funnell
Last modified: Sat, 2007 Mar 17 11:02:36