COA Chapter 01
COA Chapter 01
Computer
Systems
Architecture
These slides are provided with permission from the copyright for CS2208 use only.
1 The slides must not be reproduced or provided to anyone outside the class.
All downloaded copies of the slides are for personal use only.
Students must destroy these copies within 30 days after receiving the course’s
final assessment.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Computer Architecture
Computer architecture is a set of rules that describe the functionality
of a computer system
o Characterized by its instruction set architecture (ISA)
An ISA is concerned with the computer’s register set, instruction set, and
addressing modes
An ISA defines the model of a computer from the programmer viewpoint
The computer’s assembly language embodies its ISA
An ISA is an abstract entity because it does not consider
the specific design or implementation of a computer
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Computer Organization
Computer organization is concerned with the implementation of an ISA
Any given ISA can have many different organizations
• Examples
In theory, architecture and organization are orthogonal;
that is, they are entirely independent
Computer manufacturers regularly modify the organization
of a processor while keeping its ISA essentially constant
Today, a computer’s organization is often referred to as its microarchitecture
You could say that
• architecture tells you what a computer does and
• organization tells you how it does it
5
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Computer Structure
Figure 1.1 describes the structure of a computer.
The term computer describes the entire system.
The CPU is the Central Processing Unit that reads instructions and executes them.
The CPU is often synonymous with microprocessor.
Modern microprocessors usually include cache (high-speed) memory on-chip.
A key component of computers is the bus (or family of busses) that moves
information around the computer between different functional units (data highway).
Static RAM (faster and
more expensive than DRAM)
Dynamic
RAM
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Processor Register
A processor register is a memory element that holds a single unit data
(a word of data).
A processor register is specified in terms of the number of bits it holds,
which is typically, 8, 16, 32, or 64.
o Currently, most of computers either have 32-bit or 64-bit-wide registers.
Each processor has a specified number or registers.
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
ADD
10
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
The Clock
Most digital electronic circuits have a clock that generates a continuous stream of
regularly spaced electrical pulses.
It’s called a clock because the pulses are used to time or sequence all events within
the computer; for example, a processor might start executing a new instruction each
time a clock pulse arrives.
A clock is defined in terms of its repetition rate i.e., frequency.
Typical clock frequencies in computers range from 1 MHz to about 4.5 GHz.
Clocks are also defined in terms of the width of a clock pulse, which is the
reciprocal of its frequency; that is f = 1/T;
for example, a 1 MHz clock has a duration of 1 µs (i.e., 10-6s),
and a 1 GHz clock has a duration of 1 ns (i.e., 10-9s).
A 5 GHz clock has a period of 0.2 ns or simply 200 ps (picoseconds)—1 ps = 10-12 s
11
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
12
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
13
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
State Diagram
Each circle represents a possible state
There are two states: In a Run and Not in a Run
A state change takes place each time we examine a new digit
A state transition can
o take you from the current state to a new state or
o keep you in the current state.
14
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
State Diagram
Figure 1.9 shows the state we are in after picking up each digit
We start at the left hand end
15
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
State Diagram
Table 1.1 represents the problem in a table form
The top line gives the position or location of each digit from 1 to 17
The second line gives the value of each element (i.e., the string itself)
The third line gives the current run value. This is the same as the previous digit.
16
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
State Diagram
Table 1.2 is an extension of table 1.1
We have added a new row at the bottom: the length of the current run
17
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
State Diagram
Table 1.3 adds a new bottom line, the length of the longest run found so far
We can now look at how we would solve the problem mechanically.
18
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
The Data
We now invent some names for the variables in Table 1.3
i The current position in the string
New_Digit The value of the current digit just read from the string of digits
Current_Run_Value The value of the elements in the current run
Current_Run_length The length of the current run
Max_Run The length of the longest run we’ve found so far
19
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
23
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Stored_program_machine
Point to the first instruction in memory
REPEAT
1. Read the instruction at the memory location pointed at
2. Point to the next instruction
3. Decode the instruction just read from memory
4. Execute the instruction
FOREVER
End
24
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
End
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
26
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Terms definition
Constant – a value that doesn’t change during the execution of a program.
For example, if c = 2πr, then both ‘2’ and ‘π’ are constants.
Variable – a value that can change during the execution of a program.
In the previous example, both c and r are variables.
Symbolic name – we often refer to a variable or a constant by a name that
makes it easier for us to remember.
For example, we give the irrational number 3.1415926 the symbolic name π.
When a program is compiled, symbolic names are replaced by actual values.
Address – information in a computer is stored in memory locations and each
location has a unique address. Think of computer memory as if it is an array
and the index of this array is the address of the memory locations.
Rather than trying to remember actual address locations in memory, we give
addresses symbolic names; in this case the address may be called r.
Value and Location – When we write c = 2πr, what is r? We (humans) see r
as the symbolic name for the value of the radius, say 5. But the computer sees
r as the symbolic address 1234 which has to be read to provide the value. If
we write r = r + 1, do we mean r = 5 + 1 = 6 or do we mean r = 1234 + 1 =
1235?
It is very important to distinguish between an address and its contents.
This factor becomes significant when we introduce pointers.
Pointer – A pointer is a variable whose value is an address. If you modify the
value of a pointer, it points to a different value.
In conventional arithmetic we write xi where i is really a pointer; we just 27
call it an index. If you change the pointer (index) we can step through
the elements of a table, array or matrix, i.e., x1, x2, x3, x4.
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
30
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
31
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Memory Hierarchy
An important characteristic of modern computers is the wide range of technologies
used to implement computers.
Figure 1.16 illustrates memory hierarchy that covers the memory system of a typical
computer.
At the top are small amounts of on-chip register memory.
At the bottom are the large quantities of storage provides by hard disks.
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
The Bus
Buses link together two or more functional parts of a computer and allow the
exchange of data;
o for example, the bus between the CPU and its graphics card.
Buses also link computers to external peripherals;
o for example, the USB bus that connects a printer to a computer.
Figure 1.17 illustrates the structure of a hypothetical system without a bus. Imagine
that the blue circles are processing units that must communicate with each other.
In this example some units communicate directly with only one other unit, whereas
other units must communicate with several devices.
34
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
The Bus
Figure 1.18 illustrates the structure of a system with a bus.
Functional units may
request the bus,
use it to communicate with other units and then
relinquish the bus.
Internal buses (within the CPU or on the motherboard) and
external buses (USB, FireWire) are vital components of the computer system and
contribute to its overall performance.
35
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
The Bus
Figure 1.19 illustrates the structure of a system with two buses.
Multiple buses permit parallel operation because transactions on each bus can take
place simultaneously.
Each bus may be optimized for its specific application (e.g., a high-speed bus for
graphics and a lower speed bus for peripherals).
36
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.
Computer Organization and Architecture: Themes and Variations, 1st Edition Clements
Bus Terminology
Width The width of a bus is defined as the number of parallel data paths.
A 64-bit bus can carry 64-bits (8 bytes) of data at a time.
However, the same term can also be used to indicate the total
number of wires (connections) that make up a bus. For example, a
bus may have 50 information paths of which 32 of them carry data
(the rest may be paths for control signals or even power lines).
Latency Latency is the waiting period between a data transfer request and
the actual data transmission completed.
Typically, a bus’s latency includes the time taken to arbitrate
for the bus before transmission can take place. 37
This slide is a modified version of the original author’s slide (A. Clements) and is used with permission. All new contents added are copyrighted by © Mahmoud R. El-Sakka.