# Introduction to Computers

## II. Data Representations: On/Off

• Codes and Numbering systems
• Samuel F. B. Morse invented the Morse Code for telegraph

A =· -
B = -···
C = -· -·
D = -··
E =·
. . .
1 =· - - - -
2 =·· - - -
3 =··· - -
4 =···· -
5 = ·····

• Good example of digital vs. analog
• Telegraph was digital
• Telephone is analog

• Binary system is the numbering system universally used in computers
• Is base 2 (vs. base 10 for the decimal system)
• Contains two digits: 0 and 1
• 0 is also called "OFF", False, 0.0 volts
• 1 is called "ON", TRUE, 5.0 volts

• Compare to base 10 numbering system place values
```

104        103    102      101     100
---------------------------------------
10,000   1,000   100      10       1
```

For instance, 365 = 3 x102 + 6 x101 + 5 x100

Base 2 place values:

```
24        23        22       21      20
---------------------------------------
16        8        4        2        1
```

For instance, 101 = 1 x22 + 0 x21 + 1 x20

• Counting in base 2 system:

Decimal Binary

```	0	  0
1	  1
2	 10
3 	 11
4	100

```
• n bits allows counting 2 n objects

• Bits, bytes, and words
• One bit = 1 binary digit, e.g., a "1" or a "0"
• One byte = set of 8 binary digits, e.g., "1101 0010"
• One byte is used to store one character, e.g., "A", or "a", or "5", or "\$"
• One word = set of 1,2,4, or 8 bytes, e.g., a legitimate 32-bit word is
```
10010010 11010110 01010010 11110010

```
• Binary Coding Scheme

• ASCII = American Standard Code for Information Interchange
• Is generally a 7-bit code
• Can represent 128 characters
• ASCII code for "A" is 6510 = 10000012
• ASCII-8 is the universal code for communications (text files)

### Operations with Binary Numbers

• Arithmetic

• Operations are just like those with decimal numbers
• Subtraction
• Multiplication
• Division

• Examples

Subtract

Multiply

### Boolean Logic

• All operations of arithmetic can be done with Logic Gates

• The three most common logic gates are AND, OR, and NOT

AND gate sysmbol is

OR gate symbol is

NOT gate symbol is

• Truth Tables for these three gates

• AND gate Truth Table (The math symbol for AND is "*")

• OR gate Truth Table (The math symbol for OR is "+")

• NOT Gate Truth Table (The math symbol for NOT is "")
• Remarkably, with these simple gates we can compute anything a computer can

• It takes about 8 transistors to build 1 gate
• Given enough gates you can build a computer

## III. Personal Computer Chips

• Computer chips fall into three classes
• Microprocessors
• RAM
• ROM

### Microprocessors

• A microprocessor = computer on a chip
• They typically contain 3-6 million transistors
• The main types are
• Pentium by Intel
• PowerPC by Motorola/IBM/Apple
• Alpha Chip by Digital Equipment Corp (now Compact)

### Random Access Memory (RAM)

• Is volatile (i.e., information "boils off" when power is turned off)
• Can access any location as fast as any other location
• Measured in bytes - typically 64MB - 256 MB

• Is permanent information, programmed in at the factory
• Used to store bootup information, critical parts of the operating system
• Some ROMs are PROMs = programmable read-only memory

## IV. Speed and Power

### Faster Clock Speeds

• Clock speeds started at 1 MHz [Apple, Atari, Commodore]
• PC ran at 4.77 MHz
• Zenith increased this to 8 MHz
• The Mac II and PC-AT moved this up to 16 MHz
• Then 25, 75, 166, and now, 200-450 MHz.
• New PowerPC and Pentium machines run at between 400-1400 MHz

• This gives MIPS (million instructions/second) in the range of 1 - 500
• Another measure of speed is the MFLOP (million floating point operations/second)
• The Macintosh G4 chip is rated at 2000-4000 MFLOPs (supercomputer)

### Increase in bus size and word size

• Started with 8-bit words, data bus, 16 bit address
• Has migrated to 32 bit words, data, and address
• This allows addressing 4 GB
• The 16 bit word length and data buses are slow
• The trend is to 64 bit words
• The G4 used 128 bit bus

### Memory Management - Cache memory

• Virtual memory concept --> Substitute disk for RAM
• Done with paging
• Allows many applications to be active at once
• The Mac runs with 15 MB of virtual memory
• This allows 4-6 active applications

• Cache memory
• Put often-used code in local memory
• Typical caches are 16K--256K
• The Mac lets you, the user, set it
• The G3 Mac gets its superior performance from 0.5-1.0 MB of "back-side" cache

### Reduced Instruction Set Computers - RISC

• Standard I80486 and M68040s are CISC machines
• The Idea of RISC, on the other hand, is to
• Have fewer instructions
• Make them run at warp speed

• The jury is still out, but RISC is definitely IN
• The new APPLE/IBM/Motrola PowerPC Chip is RISC
• Compare 120 Mhz Pentium (Windows 95) to 120 Mhz PowerPC
• About the same with numbers
• PowerPC is 30%--50% faster on scientific computing
• PowerPC is ~twice as fast doing graphics

### Trends in Parallel Processing

• The sad tale of Thinking Machines Corporation Connection Machine
• Contained 65,000 processors
• Fastest machine in the world
• Now bankrupt.

• The future is most likely symmetric parallel processing, using machines like you see here

or

• The Internet as Computer, a.k.a., "NC", browser box, net-top box
• The latest entry is the \$500 Internet Computer, or Web PC
• Proposed by Oracle, Sun Microsystems, and IBM
• Viewed as an "Internet Appliance"
• Simplify hardware and software maintainance

• Four necessary conditions for a successful NC