Chapter 2
Computer system
organizations
MS.CHIT SU MON
Central Processing Unit
The organization of a simple computer with
one CPU and two I/O devices
Central Processing Unit
The CPU (Central Processing Unit) is the ‘‘brain’’
of the computer. Its function is to execute programs
stored in the main memory by fetching their
instructions, examining them, and then executing
them one after another.
The components are connected by a bus, which is a
collection of parallel wires for transmitting
address, data, and control signals. Buses can be
external to the CPU, connecting it to memory and I/O
devices, but also internal to the CPU
The control unit is responsible for fetching
instructions from main memory and determining
their type.
The arithmetic logic unit performs operations such as
addition and Boolean AND needed to carry out the
instruction
Central Processing Unit
The CPU also contains a small, high-speed memory used
to store temporary results and certain control
information. This memory is made up of a number of
registers, each of which has a certain size and function.
Usually, all the registers have the same size. Each
register can hold one number, up to some maximum
determined by its size.
Registers can be read and written at high speed since
they are internal to the CPU
Two most important registers are the Program Counter
(PC), which points to the next instruction to be
fetched for execution, and
Instruction Register (IR), which holds the instruction
currently being executed.
Most computers have numerous other registers as well,
some of them general purpose as well as some for
specific purposes.
CPU Organization
The data path of a typical Von Neumann machine.
CPU Organization
The internal organization of part of a simple von
Neumann CPU
The part shown is called data path and consists of the
registers (Typically 1 to 32), the ALU (Arithmetic Logic
Unit) and several buses connection the piece.
The registers deed into two ALU input registers,
Labeled A and B in the figure.
These registers hold the ALU input while ALU is
performing some computation.
The data path is important in all machines.
Two types of instructions- Register-memory and
Register-Register
Instruction Execution
Steps
1.Fetch next instruction from memory into instr. register
2. Change program counter to point to next instruction
3. Determine type of instruction just fetched
4. If instructions uses word in memory, determine where Fetch word,
if needed, into CPU register
5. Execute the instruction
6. Go to step 1 to begin executing following instruction
This sequence of steps is frequently referred to as the fetch-decode-
execute cycle. It is central to the operation of all computers.
Interpreter (1)
...
An interpreter for a simple computer (written in Java).
Interpreter (2)
An interpreter for a simple computer (written in Java).
interpreter
Simple computers with interpreted instructions
also had other benefits. Among the most
important were
1. The ability to fix incorrectly implemented
instructions in the field, or even make up for
design deficiencies in the basic hardware.
2. The opportunity to add new instructions at
minimal cost, even after delivery of the machine.
3. Structured design that permitted efficient
development, testing, and documenting of
complex instructions.
CPU Design types
Two general CPU designs are used today:
Complex Instruction Set Computing (CISC)
Reduced Instruction Set Computing (RISC)
Main difference between the two design types is
the number of different instructions the chip
can process
CPUs can process as many as 20 million (low-
end) to several billion (high-end) operations per
second
Instruction set – list of commands the CPU
can understand and carry out
CISC
How a CISC CPU operates
When the CPU gets a command it assigns specific instructions
to different parts of the chip
When a command is finished and the next command is
received, the CPU uses the same parts of the chip it used
before
Advantages of CISC
Only needs general-purpose hardware to carry out commands
versus hardware designed for a specific purpose
Chip is driven mainly by software, which is cheaper to produce
Disadvantages of CISC
Complexity of on-chip software needed to make the hardware
do the right thing
The need to continually reprogram the on-chip hardware
CISC chips can be a little slower than RISC chips
CISC
Because general hardware is used, functions
will not be executed in the most efficient way
Hardware modules can be added that are
optimized to perform certain functions
Example – A math coprocessor can be added in
order to help perform all computational
functions
CPU performance is increased
Increases price
RISC
How a RISC CPU operates
Typically use a technique called pipelining, which
allows the processor to operate on instructions
while retrieving more instructions from the OS or
application
Advantage of RISC
Requires very little setup for specific tasks
because it has hardware on the chip to perform
specific functions
Disadvantage of RISC
Need more hardware to carry out instructions which
makes the chip more expensive
CISC versus RISC
processing
Design Principles for Modern
Computers
That architects of general-purpose CPUs do their best to follow.
External constraints, such as the requirement of being backward
compatible with some existing architecture, often require compromises
from time to time, but these principles are goals that most designers
strive to meet.
All instructions directly executed by hardware
They are not interpreted by microinstructions. Eliminating a level of
interpretation provides high speed for most instructions.
Maximize the Rate at Which Instructions Are Issued
Modern computers resort to many tricks to maximize their performance, chief
among which is trying to start as many instructions per second as possible.
Instructions Should be Easy to Decode
A critical limit on the rate of issue of instructions is decoding individual
instructions to determine what resources they need.
The fewer different formats for instructions, the better.
Design Principles for
Modern Computers
Only Loads and Stores Should Reference
Memory
One of the simplest ways to break operations into
separate steps is to require that operands for
most instructions come from—and return to—CPU
registers.
Since access to memory can take a long time,
and the delay is unpredictable
Only LOAD and STORE instructions should
reference memory. All other instructions should
operate only on registers.
Provide Plenty of Registers
Since accessing memory is relatively slow, many
registers need to be provided, so that once a
word is fetched, it can be kept in a register until it
Parallelism
Parallelism comes in two general forms, namely,
instruction-level parallelism and processor-level
parallelism.
In the former, parallelism is exploited within individual
instructions to get more instructions/sec out of the
machine.
In the latter, multiple CPUs work together on the same
problem
Pipelining
It has been known for years that the actual fetching
of instructions from memory is a major bottleneck in
instruction execution speed.
Instead of dividing instruction execution into only two
parts, it is often divided into many (often a dozen or
more) parts, each one handled by a dedicated piece
of hardware, all of which can run in parallel.
Instruction-Level Parallelism
A five-stage pipeline
The state of each stage as a function of time. Nine clock cycles
are illustrated
Superscalar Architectures
If(1)
one pipeline is good, then surely two pipelines are better.
To be able to run in parallel, the two instructions must not conflict
over resource usage (e.g., registers),
and neither must depend on the result of the other.
Dual five-stage pipelines with a common instruction fetch unit.
Superscalar Architectures
(2)
A superscalar processor with five functional units.
Processor-Level Parallelism
(1)
An array processor consists of a large number of identical processors t
perform the same sequence of instructions on different sets of data.
An array processor of the ILLIAC IV type
Processor-Level
Parallelism (2)
A single-bus multiprocessor.
A multicomputer with local memories.
Primary Memory
The memory is that part of the computer where
programs and data are stored.
Without a memory from which the processors can
read and write information, there would be no stored-
program digital computers.
Bits
The basic unit of memory is the binary digit, called a
bit. A bit may contain a 0 or a 1.
Memories consist of a number of cells (or
locations) each of which can store a piece of
information.
Data Representation in the
Computer
Binaryrepresentation (characters &
integers we will see)
Image Data Representation
Audio Data Representation
Data Safety (examples: parity code)
Data Compression
Counting in Different Bases
Counting in base 10 (digits 1-9):
23.7 (101 * 2) (100 *3) (10 1 *7)
Counting in base 5 (digits 1-4):
124.31 (1*52 ) (2*51 ) (4*50 ) (3*51 ) (3*52 )
Representing Characters
ASCII encoding (American Standard Code for
Information Interchange)
Each character is represented by a byte
Other representations possible too (Unicode,
EBCDIC)
Representing Integers
Computers represent integers using a base-2 positional
notation.
So the number 101011 means:
125 + 024 + 123 + 022 + 121 + 120
132 + 016 + 18 + 04 + 12 + 11=
43
Representing Integers
The first few binary numbers are:
0000....................0
0001....................1
0010....................2
0011....................3
0100....................4
0101....................5
0110....................6
0111....................7
1000....................8
1001....................9
1010....................10
1011....................11
1100....................12
1101....................13
Converting decimal to
binary
123 1111011
÷2
61 remainder 1
÷2
30 remainder 1
÷2
15 remainder 0
÷2
7 remainder 1
÷2
3 remainder 1
÷2
1 remainder 1
÷2
0 remainder 1
Converting decimal to
binary
102 1100110
÷2
51 remainder 0
÷2
25 remainder 1
÷2
12 remainder 1 Most
÷2
6 remainder 0 significant
÷2 bit
3 remainder 0
÷2
1 remainder 1
÷2
0 remainder 1
Converting decimal to
binary
102 1100110
÷2
51 remainder 0
÷2
25 remainder 1
÷2
12 remainder 1 Least
÷2
6 remainder 0 significant
÷2 bit
3 remainder 0
÷2
1 remainder 1
÷2
0 remainder 1
Memory Addresses
Memories consist of a number of cells (or
locations), each of which can store a piece of
information
Each cell has a number, called its address, by
which programs can refer to it.
If a memory has n cells, they will have addresses
0 to n − 1.
All cells in a memory contain the same number of
bits.
If a cell consists of k bits, it can hold any one of 2k
different bit combinations. Following figure shows
three different organizations for a 96-bit memory.
Primary Memory
Memory Addresses (1)
Three ways of organizing a 96-bit memory.
Memory Addresses
Computers that use the binary number system (including
octal and hexadecimal notation for binary numbers)
express memory address as binary numbers.
If an address has m bits, the maximum number of cells
addressable is 2m . For example, an address used to
reference the memory of Fig.(a) needs at least 4 bits in
order to express all the numbers from 0 to 11. A 3-bit
address is sufficient for Fig.(b) and (c), however.
The number of bits in the address determines the
maximum number of directly addressable cells in the
memory and is independent of the number of bits per
cell. A memory with 212 cells of 8 bits each and a
memory with 212 cells of 64 bits each need 12-bit
addresses.
In recent years, nearly all computer manufacturers have
standardized on an 8-bit cell, which is called a byte. The
term octet is also used. Bytes are grouped into words.
Memory Addresses
A computer with a 32-bit word has 4
bytes/word, whereas a computer with a 64-bit
word has 8 bytes/word.Thus,32-bit machine will
have 32-bit registers and instructions for
manipulating 32-bit words, whereas a 64-bit
machine will have 64-bit registers and
instructions for moving, adding, subtracting,
and otherwise manipulating 64-bit words.
Memory Address
Number of bits per cell for some historically interesting
commercial computers.
Error Correcting Codes
Computer memories can make errors
occasionally due to voltage spikes on the power
line or other causes.
To guard against such errors, some memories
use error-detecting or error-correcting codes.
When these codes are used, extra bits are
added to each memory word in a special way.
When a word is read out of memory, the extra
bits are checked to see if an error has occurred.
Error Correcting Codes
(1)
Number of check bits for a code that can correct a
single error
Error Correcting Codes
(2)
(a) Encoding of 1100
(b) Even parity added
(c) Error in AC
Error Correcting Codes
(3)
Construction of the Hamming code for the memory word
11110000010101110 by adding 5 check bits to the 16 data bits.
Cache Memory
The cache is logically between the CPU and main memory.
Physically, there are several possible places it could be located.
Memory Packaging and
Types
A single inline memory module (SIMM) holding 256 MB.
Two of the chips control the SIMM.
Memory Hierarchies
A five-level memory hierarchy.
Memory Hierarchies
As we move down the hierarchy, three key parameters
increase.
First, the access time gets bigger.
◦ CPU registers can be accessed in a few nanoseconds.
◦ Cache memories take a small multiple of CPU registers.
◦ Main memory accesses are typically a few tens of
nanoseconds.
◦ Now comes a big gap, as disk access times are at least 10
msec, and tape or optical disk access can be measured in
seconds if the media have to be fetched and inserted into a
drive.
Second, the storage capacity increases as we go
downward.
◦ CPU registers are good for perhaps 128 bytes, caches for a
few megabytes, main memories for tens to thousands of
megabytes, magnetic disks for a few gigabytes to tens of
gigabytes.
◦ Tapes and optical disks are usually kept off-line, so their
capacity is limited only by the owner’s budget.
Memory Hierarchies
Third, the number of bits you get per dollar
spent increases down the hierarchy.
Although the actual prices change rapidly, main
memory is measured in dollars/megabyte,
magnetic disk storage in pennies/megabyte, and
magnetic tape in dollars/gigabyte or less.
Magnetic Disks (1)
A portion of a disk track. Two sectors are illustrated.
Magnetic Disks (2)
A disk with four platters.
Magnetic Disks (3)
A disk with five zones. Each zone has many
tracks.
SCSI Disks
Some of the possible SCSI parameters.
RAID (1)
Redundant Array of Inexpensive Disks
RAID levels 0 through 2.
Backup and parity disks are shown shaded.
RAID (1)
Redundant Array of Inexpensive Disks
RAID levels 3 through 5.
Backup and parity disks are shown shaded.
CD-ROMs (1)
Recording structure of a Compact Disk or CD-ROM.
CD-ROMs (2)
Logical data layout on a CD-ROM.
CD-Recordables
Cross section of a CD-R disk and laser (not to scale). A CD-ROM
has a similar structure, except without the dye layer and with
a pitted aluminum layer instead of a reflective layer.
DVD
A double-sided, dual layer DVD disk.
Input/Output
Buses (1)
Physical structure of a personal computer.
Input/Output
Buses (2)
Logical structure of a simple personal computer.
Input/Output
Buses (3)
A typical modern PC with a PCI bus and an ISA bus.
CRT Monitors
(a) Cross section of a CRT
(b) CRT scanning pattern
Flat Panel Displays
(a) The construction of an LCD screen.
(b) The grooves on the rear and front plates are perpendicular to
one another.
Mice
A mouse being used to point to menu items.
Printers (1)
(a) The letter “A” on a 5 x 7 matrix.
(b) The letter “A” printed with 24 overlapping needles.
Printers (2)
Operation of a laser printer.
Printers (3)
Halftone dots for various gray scale ranges.
(a) 0 – 6. (b) 14 – 20. (c) 28 – 34.
(d) 56 – 62. (e) 105 – 111. (f) 161 – 167.
Telecommunications
Transmission of the binary number 01001010000100 over a
telephone line bit by bit. (a) Two-level signal. (b) Amplitude
modulation. (c) Frequency modulation. (d) Phase modulation.
Digital Subscriber Lines
(1)
Operation of ADSL.
Digital Subscriber Lines
(2)
A typical ADSL equipment configuration.
Internet over Cable (1)
Frequency allocation in a typical cable TV system
used for Internet access
Internet over Cable (2)
Typical details of the upstream and downstream channels in North
America. QAM-64 (Quadrature Amplitude Modulation) allows 6
bits/Hz but only works at high frequencies. QPSK (Quadrature
Phase Shift Keying) works at low frequencies
but allows only 2 bits/Hz.
Digital Cameras
A digital camera.
ASCII Character Codes
(1)
The ASCII Character set: characters 0 – 31.
ASCII Character Codes
(2)
The ASCII Character set: characters 32 – 127.