Department of Computer Engineering University of California at Santa Cruz
How Do Computers Work? A Gentle Introduction
Curtsey of Dr. Arturo Sanchez
Forces on Computer Architecture
Technology
Department of Computer Engineering University of California at Santa Cruz
Programming Languages
Applications Computer Architecture
Operating systems
History
Department of Computer Engineering University of California at Santa Cruz
Amazing Underlying Technology Change
Department of Computer Engineering University of California at Santa Cruz
A take on Moore’s Law Bit-level parallelism
Instruction-level
Thread-level (?)
100,000,000
10,000,000
1,000,000
R10000
Pentium
Transistors
i80386
i80286
100,000
R3000
R2000
i8086
10,000 i8080 i8008 i4004
1,000 1970
1975
1980
1985
1990
1995
2000
2005
Department of Computer Engineering University of California at Santa Cruz
Technology Trends
Clock Rate: ~30% per year Transistor Density: ~35% Chip Area: ~15% Transistors per chip: ~55% Total Performance Capability: ~100% by the time you graduate... • 3x clock rate (3-4 GHz) • 10x transistor count (1 Billion transistors) • 30x raw capability
plus 16x dram density, 32x disk density
Department of Computer Engineering University of California at Santa Cruz
Performance Trends
100
Supercomputers
Performance
10 Mainframes Microprocessors Minicomputers 1
0.1 1965
1970
1975
1980
1985
1990
1995
Department of Computer Engineering University of California at Santa Cruz
CPU and Main Memory Central Processing Unit
Primary storage area for programs and data that are in active use Synonymous with RAM
Main Memory
Chip that executes program commands Intel Pentium 4 Sun ultraSPARC III
Department of Computer Engineering University of California at Santa Cruz
Secondary Memory Devices Secondary memory devices provide long-term storage
Hard disks Floppy disks ZIP disks Writable CDs Writable DVDs Tapes
Central Processing Unit
Information is moved between main memory and secondary memory as needed
Hard Disk Main Memory Floppy Disk
Department of Computer Engineering University of California at Santa Cruz
Input / Output Devices Monitor Keyboard Monitor screen Keyboard Mouse Joystick Bar code scanner Touch screen
Central Processing Unit
I/O devices facilitate user interaction
Hard Disk Main Memory Floppy Disk
What is “Computer Architecture”?
Department of Computer Engineering University of California at Santa Cruz
Application Operating System Compiler
Firmware
Instr. Set Proc. I/O system Datapath & Control Digital Design Circuit Design Layout
Coordination
of many levels of abstraction Under a rapidly changing set of forces Design, Measurement, and Evaluation
Instruction Set Architecture
Department of Computer Engineering University of California at Santa Cruz
Software Categories
Operating System • • • •
controls all machine activities provides the user interface to the computer manages resources such as the CPU and memory Windows XP, Unix, Linux, Mac OS
Application program • generic term for any other kind of software • word processors, missile control systems, games
Most operating systems and application programs have a graphical user interface (GUI)
Department of Computer Engineering University of California at Santa Cruz
Analog vs. Digital
There are two basic ways to store and manage data:
Analog • continuous, in direct proportion to the data represented • music on a record album - a needle rides on ridges in the grooves that are directly proportional to the voltages sent to the speaker
Department of Computer Engineering University of California at Santa Cruz
Analog vs. Digital
Digital • the information is broken down into pieces, and each piece is represented separately • music on a compact disc - the disc stores numbers representing specific voltage levels sampled at specific times
Department of Computer Engineering University of California at Santa Cruz
Digital Information
Computers store all information digitally: • • • • • •
numbers text graphics and images video audio program instructions
In some way, all information is digitized - broken down into pieces and represented as numbers
Department of Computer Engineering University of California at Santa Cruz
Representing Text Digitally
For example, every character is stored as a number, including spaces, digits, and punctuation
Corresponding upper and lower case letters are separate characters
Hi, Heather.
72 105 44 32 72 101 97 116 104 101 114 46
Department of Computer Engineering University of California at Santa Cruz
Binary Numbers
Once information is digitized, it is represented and stored in memory using the binary number system
A single binary digit (0 or 1) is called a bit
Devices that store and move information are cheaper and more reliable if they have to represent only two states
Department of Computer Engineering University of California at Santa Cruz
Binary Numbers
A single bit can represent two possible states, like a light bulb that is either on (1) or off (0)
Combinations of bits are used to store values
Department of Computer Engineering University of California at Santa Cruz
Bit Combinations 1 bit 0 1
2 bits 00 01 10 11
3 bits 000 001 010 011 100 101 110 111
4 bits 0000 1000 0001 1001 0010 1010 0011 1011 0100 1100 0101 1101 0110 1110 0111 1111
Each additional bit doubles the number of possible combinations
Department of Computer Engineering University of California at Santa Cruz
Bit Combinations
Each combination can represent a particular item
There are 2N combinations of N bits
Therefore, N bits are needed to represent 2N unique items
How many items can be represented by
1 bit ?
21 = 2 items
2 bits ?
2 2 = 4 items
3 bits ?
23 = 8 items
4 bits ?
24 = 16 items
5 bits ?
25 = 32 items
Department of Computer Engineering University of California at Santa Cruz
Bit Combinations
Suppose we have three bits … see how different numbers are represented with them 1
22 = 4
0
22 = 4
0
+ 1
1
+
1
5
+
1
1
21 = 2
5
= 7
+
1
=
7
Department of Computer Engineering University of California at Santa Cruz
Bit Combinations
Since you were very small, people have told you that you can count up to 10 with your two hands, right?
Well … you can do better than this …
With one hand you can count up to 31 …
With two hands you can count up to 1023 …
How
Department of Computer Engineering University of California at Santa Cruz
Bit Combinations 23 = 8 24 = 16
21 = 2
22 = 4 3
2
1
20 = 1
4 0
Department of Computer Engineering University of California at Santa Cruz
NOT Showing Bit Combinations SHOWING!
1
What number is this??
Department of Computer Engineering University of California at Santa Cruz
NOT Showing Bit Combinations SHOWING!
NOT Showing
2
What number is this??
Department of Computer Engineering University of California at Santa Cruz
A Computer Specification
Consider the following specification for a personal computer: • • • • • •
2.8 GHz Pentium 4 Processor 512 MB RAM 80 GB Hard Disk 48x CD-RW / DVD-ROM Combo Drive 17” Video Display with 1280 x 1024 resolution 56 Kb/s Modem
What does it all mean?
Department of Computer Engineering University of California at Santa Cruz
Storage Capacity
Every memory device has a storage capacity, indicating the number of bytes it can hold
Capacities are expressed in various units: Unit
Symbol
Number of Bytes
kilobyte
KB
210 = 1024
megabyte
MB
220 (over 1 million)
gigabyte
GB
230 (over 1 billion)
terabyte
TB
2
40
(over 1 trillion)
Department of Computer Engineering University of California at Santa Cruz
Memory
A magnetic tape is a sequential access device since its data is arranged in a linear order - you must get by the intervening data in order to access other information
Department of Computer Engineering University of California at Santa Cruz
RAM vs. ROM
RAM - Random Access Memory (direct access)
ROM - Read-Only Memory
The terms RAM and main memory are basically interchangeable
ROM could be a set of memory chips, or a separate device, such as a CD ROM
Department of Computer Engineering University of California at Santa Cruz
RAM vs. ROM
Both RAM and ROM are random (direct) access devices!
RAM probably should be called Read-Write Memory
Department of Computer Engineering University of California at Santa Cruz
Compact Discs
A CD-ROM is portable read-only memory
A microscopic pit on a CD represents a binary 1 and a smooth area represents a binary 0
A low-intensity laser reflects strongly from a smooth area and weakly from a pit
Department of Computer Engineering University of California at Santa Cruz
Compact Discs
A CD-Recordable (CD-R) drive can be used to write information to a CD once
A CD-Rewritable (CD-RW) can be erased and reused
The speed of a CD drive indicates how fast (max) it can read and write information to a CD
Department of Computer Engineering University of California at Santa Cruz
DVDs
A DVD is the same size as a CD, but can store much more information
The format of a DVD stores more bits per square inch Meaning and Pronunciation
DVD = Digital Versatile Disk Read More HERE
Department of Computer Engineering University of California at Santa Cruz
DVDs
A CD can store 650 MB, while a standard DVD can store 4.7 GB • A double sided DVD can store 9.4 GB • Other advanced techniques can bring the capacity up to 17.0 GB
Like CDs, there are DVD-R and DVD-RW discs
Department of Computer Engineering University of California at Santa Cruz
Levels of Representation temp = v[k]; v[k] = v[k+1]; High Level Language Program
v[k+1] = temp;
lw $15, lw $16, sw$16, sw$15,
Compiler Assembly Language Program Assembler
0000 1010 1100 0101
Machine Language Program Machine Interpretation
1001 1111 0110 1000
1100 0101 1010 0000
0($2) 4($2) 0($2) 4($2)
0110 1000 1111 1001
1010 0000 0101 1100
1111 1001 1000 0110
0101 1100 0000 1010
1000 0110 1001 1111
ALUOP[0:3]