BA 471 - Hardware & Binary Systems
- Hardware: Physical parts of the system.
- Our hardware is a system: elements, relations, input, output.
- Systems view: three types of elements:
- Input devices: keyboard, mouse, light pen, scanner, microphone,
touch-sensitive screen, etc.
- Output devices: printer, speaker, screen, etc.
- Processing devices: process inputs and generate outputs:
- Central Processing Unit (CPU): orchestrates arithmetic
and
logical operations:
- Arithmetic Logic Unit (ALU): performs all logical and
arithmetic operations.
- Control unit: orchestrates the ALU.
- Memory (registers, cache, etc.).
- Memory:
- Permanent.
- Disks (hard, floppy, etc.).
- Tapes.
- Read Only Memory (ROM).
- Erasable Programmable Read Only Memory (EPROM).
- Electrically Erasable Programmable Read Only Memory
(EEPROM) (flash
memory).
- Temporary:
- CPU-resident memory.
- Other 'processor-resident' memory; e.g., video card memory.
- Random Access Memory (RAM).
- Virtual Memory, RAM disk, swap space, etc.
- Bus.
- Video card.
- Network Interface Card.
- Etc.
- Performance:
- Clock speed: Hz, KHz, MHz, GHz, THz, etc.
(Heinrich
R. Hertz
(1857-1894); experimentally confirmed the existence
of electromagnetic waves).
- Instructions Per Second: MIPS, BIPS.
- FLoating Point Operations Per Second: MFLOPS, GFLOPS, TFLOPS.
- However, must factor in:
- CPU architecture (CISC,
RISC p. 97, single/multicore).
- Number of bits used per CPU cycle - wordlength (Stair &
Reynolds, p. 94-95): 16-bit, 32-bit, 64-bit, etc.:
- First, a word on bits and bytes:
- Computers are logical machines --> all data consists
of
true/false, on/off combinations.
- A simple switch (or bit) has two states: on/off
(true/false).
- An array of eight such switches (byte) has 28
= 256
possible states.
- (Digital) computers represent things in numbers --> binary
number representation:
- Let: a bit be on (1) or off (0).
- Let: a bit represent a power of 2.
- Let: the right most bit represent the lowest power (0):
- 1112 = 20 (110) + 21
(210) + 22
(410) = 710
- 1012 = 20 (110)
+ 22 (410) = 510
- 1002 = 22 (410) = 410
- Note that in this binary system, we have only
two symbols:
0 and 1.
- In our decimal system we have ten symbols: 0,
1, 2, 3, 4,
5, 6, 7, 8, 9.
- In both systems the same counting rules hold:
- 11110 = 100 (1) + 101
(10) + 102
(100)
- 10110 = 100 (1) + 102
(100)
- 17310 = 3 * 100 (3) + 7 * 101
(70) + 1 * 102 (100)
- Problem:
Can you do some yourself? e.g.,
convert 11310 and 9910 to binary?
- Moreover, arithmetic works identically in both
systems!!:
- Binary: 11 (3) + 10 (2) = 101 (5) (use 'carry').
- Decimal: 97 + 10 = 107 (use 'carry').
- Isn't this something that only computer scientists have
to know?
- History is filled with nondecimal-based counting
systems (20, 16, 60, etc.).
- How about negative numbers?
- Option: reserve one bit (most left one) for the sign?
- Largest and smallest numbers we can store in a byte:
-12810 <= x
<= 12710
- one byte = 8 bits.
- one bit required for sign ==> 7 bits available
for value ==> 27 = 128 combinations.
- One combination (all bits off) reserved for zero.
- All remaining bits on: 26 + 25
+ 24 + 23 + 22 + 21 + 20
= 27 - 1 = 12710
- But what about zero? Are 0 and -0 both zero?
(nasty).
- Two's complement: Invert the (positive)
binary number and add 1.
- Before you try this, always make sure you have
plenty of bits to work with.
- -1310 ==> 0000 1101 ==> 1111 0010
==> + 1 = 1111 00112.
- Read this number as follows:
- Since all two's complement numbers starting with
a 1 (left most bit) are negative, 1111 0011 is negative.
- To find its value, apply Two's complement (again):
- 1111 0011 ==> 0000 1100 ==> + 1 = 0000
1101 = 1310
- -010 ==> 0000 ==> 1111 ==> + 1
= (1)0000 = 0000 (odometer)
- Smallest 1-byte value under two's complement = -128!!
- Arithmetic rules still work fine:
- 710 + -210 = 510
- 0000 0111 + (0000 0010 => 1111 1101 ==> + 1
=) 1111 1110) =
- (1)00000101 = +510
- Floating point numbers; e.g., 1.99 or 123.56789 can be
represented
likewise, but in multiple parts.
- Other counting systems; e.g.,
hexadecimal or 'hex'
counting: 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
- 1010 ==> A16
- Font color in HTML: one byte for each of R(ed), G(reen)
and B(lue) = RxGxB = 2563 = 16,777,216 colors.
- White in RGB10: 255, 255, 255
- White in RGB16: FF, FF, FF
- Need fewer symbols for larger numbers : e.g., 1500000010
= E4E1C016
- Problem:
What about 'irrational' numbers such as pi?
- Memory addressing:
- 16 bit --> 216 --> 65,536 Bytes = 64KB (1
KB = 1,024 Bytes).
- 32 bit --> 232 --> 4.29e09 = 4,294,967,296 = 4,194,304 KB = 4,096 MB.
- 64-bit --> 264 --> 1.84e19 = ... rather
a lot.
- Problem: on p.
89, Stair & Reynolds state that Porsche AG bought "two HP Superdome servers, each with 24
processors and 28 GB of RAM."
- Question: are these Superdome servers 32-bit or 64-bit
computers?
- Precision of numbers, speed of floating point computation.
- Bus bandwith: bus width * bus speed.
- Amount and speed of (virtual) memory.
- Examples:
- 1.8 GHz.
- 32-bit computing.
- Intel dual core.
- 1GB RAM.
- 250GB HD.
- Microsoft Vista.
- $899.
- Apple Power Mac G5
(no display):
- 2.0 GHz.
- 64-bit computing.
- 2 Intel dual core.
- 1GB RAM.
- 160GB HD.
- MAC OS X.
- $2,200.
- Apple Mac Mini
(no display, no mouse, no keyboard)
- 1.83 GHz.
- 32-bit computing.
- Intel dual core.
- 512M RAM.
- 80GB HD.
- MAC OS X.
- $799.