lOMoARcPSD| 58605085
+
COMPUTER ORGANIZATION & ARCHITECTURE
Van-KhoaPham (PhD.)
lOMoARcPSD| 58605085
+
Chapter 3
lOMoARcPSD| 58605085
A Top-Level View of Computer Function
and Interconnection
+
Computer Components
Hardwired program
The result of the process of connecting the various components in the desired
configuration
Hardwired systems are inflexible
Lots of work to re-wire, or re-toggle
General purpose hardware can do different tasks. Instead of re-wiring,
supply a new set of control signals
lOMoARcPSD| 58605085
+
Computer Components
von Neumann architecture is a simple structure, capable of executing
any kind of program, given a properly programmed control unit,
without the need of hardware modification
three key concepts:
Data and instructions are stored in a single read-write memory
The contents of this memory are addressable by location
Execution occurs in a sequential
fashion (unless explicitly modified)
from one instruction to the next
A control unit (control path) featuring a
program counter for controlling program
execution
An arithmetic and logic unit (ALU) also
called data path for program execution
Datapath
Controllpath
Processor or
Central processing unit
and
Instructions
Address
register
Memory
Instruction
register
PC
Address
Registers
lOMoARcPSD| 58605085
(a) Programming in
hardware
Figure 3.1
Hardware and Software Approaches
Levels of Representation
+
Hardware
and Software
Approaches
High Level Language
Program
Sequence of
arithmetic
and logic
functions
Data
Results
Instruction
codes
General-purpose
arithmetic
and logic
functions
Data
Control
signals
Results
(
b) Programming in software
Instruction
interpreter
lOMoARcPSD| 58605085
temp = v[k]; v[k] = v[k+1];
v[k+1] = temp; Compiler
lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15,
4($2)
0000 1001 1100 0110 1010 1111 0101 1000
1010 1111 0101 1000 0000 1001 1100 0110
1100 0110 1010 1111 0101 1000 0000 1001
0101 1000 0000 1001 1100 0110 1010 1111
°
°
Assembly Language
Program
7
Machine Language
Program
Control Signal
Specification
Assembler
Machine Interpretati
o
lOMoARcPSD| 58605085
+
Bottlenecks in VN Architecture
lOMoARcPSD| 58605085
The Von Neumann Computer
Advantage:
Simplicity.
Flexibility: any well coded program can be executed
Drawbacks:
Speed efficiency: Not efficient, due to the sequential program
execution (temporal resource sharing).
Resource efficiency: Only one part of the hardware resources is
required for the execution of an instruction. The rest remains idle.
Memory access: Memories are about 5 times slower than the
processor
CPU Main Memory
8
lOMoARcPSD| 58605085
Figure 3.2 Computer Components: Top-Level View
PC
MAR
IR
MBR
I/O AR
I/O BR
System
Bus
I/O Module
Buffers
Instruction
0
1
2
n
– 2
n
– 1
Data
Data
Data
Data
Instruction
Instruction
Program counter
=
PC
Instruction register
=
IR
=
Memory address register
MAR
=
Memory buffer register
MBR
I/O AR = Input/output address register
I/O BR = Input/output buffer register
Execution
unit
lOMoARcPSD| 58605085
MEMORY
MAR
lOMoARcPSD| 58605085
MBR
lOMoARcPSD| 58605085
lOMoARcPSD| 58605085
+
Fetch Execute Cycle
At the beginning of each instruction cycle
The processor fetches an instruction from memory
The program counter (PC) holds the address of the instruction to be
fetched next
The processor increments the PC after each instruction fetch so that it will
fetch the next instruction in sequence
The fetched instruction is loaded into the instruction register (IR)
The processor interprets the instruction and performs the required action
lOMoARcPSD| 58605085
0
3 4
15
Opcode
Address
(a) Instruction format
0
1
15
S
Magnitude
(b) Integer format
Program Counter (PC) = Address of instruction
Instruction Register (IR) = Instruction being executed
Accumulator (AC) = Temporary storage
(c) Internal CPU registers
0001 = Load AC from Memory
0010 = Store AC to Memory
0101 = Add to AC from Memory
(d) Partial list of opcodes
lOMoARcPSD| 58605085
Figure 3.4 Characteristics of a Hypothetical Machine
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
940
941
Step 1
0 0 0 3
0 0 0 2
CPU Registers
3 0 0 PC
AC
1 9 4 0 IR
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
940 0 0 0 3
941 0 0 0 2
Step 2
CPU Registers
3 0 1 PC
0 0 0 3 AC
1 9 4 0 IR
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
940
941
Step 3
0 0 0 3
0 0 0 2
CPU Registers
3 0 1 PC
0 0 0 3 AC
5 9 4 1 IR
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
940 0 0 0 3
941 0 0 0 2
Step 4
CPU Registers
3 0 2 PC
0 0 0 5 AC
5 9 4 1 IR
3 + 2 = 5
Memory
300
301
302
940
941
Step 5
1 9 4 0
5 9 4 1
2 9 4 1
0 0 0 3
0 0 0 2
CPU Registers
3 0 2 PC
0 0 0 5 AC
2 9 4 1 IR
Memory
300 1 9 4 0
301 5 9 4 1
302 2 9 4 1
940 0 0 0 3
941 0 0 0 5
Step 6
CPU Registers PC
AC
IR
3 0 3
0 0 0 5
2 9 4 1
lOMoARcPSD| 58605085
Figure 3.5 Example of Program Execution
(contents of memory and registers in hexadecimal)
Memory
N
Words
0
N
– 1
Data
Data
Address
Write
Read
I/O Module
M
Ports
External
Data
Address
Internal
Data
Data
Interrupt
Signals
Internal
Data
Write
Read
lOMoARcPSD| 58605085
Figure 3.15 Computer Modules
The interconnection structure must support the following
types of transfers:
CPU
Data
Data
Address
Instructions
Control
Signals
Interrupt
Signals
lOMoARcPSD| 58605085
lOMoARcPSD| 58605085
B
u
s
I
n
t
e
r
c
o
n
n
e
c
t
i
o
n
A communication pathway
connecting two or more
devices
•Key characteristic is that it is a
shared transmission medium
Signals transmitted by any
one device are available for
reception by all other
devices attached to the bus
•If two devices transmit during the
same time period their signals will
overlap and become garbled
Typically consists of multiple
communication lines
•Each line is capable of
transmitting signals representing
binary 1 and binary 0
Computer systems contain a
number of different buses
that provide pathways
between components at
various levels of the
computer system hierarchy
System bus
•A bus that connects major
computer components (processor,
memory, I/O)
The most common computer
interconnection structures
are based on the use of one
or more system buses
lOMoARcPSD| 58605085
Data Bus
Data lines that provide a path for moving data among system
modules
May consist of 32, 64, 128, or more separate lines
The number of lines is referred to as the width of the data bus
The number of lines determines how many bits can be transferred at
a time
The width of the data
bus is a key factor in
determining overall
system performance
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
data bus
If the processor wishes to
read a word of data from

Preview text:

lOMoAR cPSD| 58605085 +
COMPUTER ORGANIZATION & ARCHITECTURE Van-KhoaPham (PhD.) lOMoAR cPSD| 58605085 + Chapter 3 lOMoAR cPSD| 58605085
A Top-Level View of Computer Function and Interconnection + Computer Components ◼ Hardwired program
◼ The result of the process of connecting the various components in the desired configuration
◼ Hardwired systems are inflexible
◼ Lots of work to re-wire, or re-toggle
◼ General purpose hardware can do different tasks. Instead of re-wiring,
supply a new set of control signals lOMoAR cPSD| 58605085 + Computer Components
von Neumann architecture is a simple structure, capable of executing
any kind of program, given a properly programmed control unit,
without the need of hardware modification ◼ three key concepts:
◼ Data and instructions are stored in a single read-write memory
◼ The contents of this memory are addressable by location
◼ Execution occurs in a sequential
fashion (unless explicitly modified) Processor or Memory Central processing unit
from one instruction to the next Datapath Data Data Registers
A control unit (control path) featuring a and Instructions
program counter for controlling program execution Instruction Address PC Address register register
An arithmetic and logic unit (ALU) also Control path
called data path for program execution lOMoAR cPSD| 58605085 + Hardware and Software (a) Programming in hardware Approaches Sequence of arithmetic Data Results and logic functions Figure Instruction Instruction 3.1 codes interpreter Control signals General-purpose arithmetic Data Results and logic functions
( b) Programming in software
Hardware and Software Approaches Levels of Representation High Level Language Program lOMoAR cPSD| 58605085 temp = v[k]; v[k] = v[k+1];
v[k+1] = temp; Compiler 7 lw $15, 0($2) lw $16, 4($2) sw $16, 0($2) sw $15, 4($2) Assembly Language
0000 1001 1100 0110 1010 1111 0101 1000 Program
1010 1111 0101 1000 0000 1001 1100 0110
1100 0110 1010 1111 0101 1000 0000 1001
0101 1000 0000 1001 1100 0110 1010 1111 Assembler Machine Language ° Program °
Machine Interpretati o Control Signal Specification lOMoAR cPSD| 58605085 +
Bottlenecks in VN Architecture lOMoAR cPSD| 58605085
The Von Neumann Computer 8 ◼ Advantage: ◼ Simplicity. ◼
Flexibility: any well coded program can be executed ◼ Drawbacks: ◼
Speed efficiency: Not efficient, due to the sequential program
execution (temporal resource sharing). ◼
Resource efficiency: Only one part of the hardware resources is
required for the execution of an instruction. The rest remains idle. ◼
Memory access: Memories are about 5 times slower than the processor CPU Main Memory lOMoAR cPSD| 58605085 0 System 1 2 PC Bus MAR Instruction Instruction IR Instruction MBR I/O AR Data Execution unit I/O BR Data Data Data I/O Module n – 2 n – 1 PC = Pr ogram counter Buffers IR = Ins truction register
MAR = Memory address register
MBR = Memory buffer register
I/O AR = Input/output address register
I/O BR = Input/output buffer register
Figure 3.2 Computer Components: Top-Level View lOMoAR cPSD| 58605085 MEMORY MAR lOMoAR cPSD| 58605085 MBR lOMoAR cPSD| 58605085 lOMoAR cPSD| 58605085 + Fetch Execute Cycle
At the beginning of each instruction cycle
◼ The processor fetches an instruction from memory
◼ The program counter (PC) holds the address of the instruction to be fetched next
◼ The processor increments the PC after each instruction fetch so that it will
fetch the next instruction in sequence
◼ The fetched instruction is loaded into the instruction register (IR)
◼ The processor interprets the instruction and performs the required action lOMoAR cPSD| 58605085 0 3 4 15 Opcode Address (a) Instruction format 0 1 15 S Magnitude (b) Integer format
Program Counter (PC) = Address of instruction
Instruction Register (IR) = Instruction being executed
Accumulator (AC) = Temporary storage (c) Internal CPU registers 0001 = Load AC from Memory 0010 = Store AC to Memory 0101 = Add to AC from Memory (d) Partial list of opcodes lOMoAR cPSD| 58605085
Figure 3.4 Characteristics of a Hypothetical Machine Memory CPU Registers Memory CPU Registers 300 1 9 4 0 3 0 0 PC 300 1 9 4 0 3 0 1 PC 301 5 9 4 1 AC 301 5 9 4 1 0 0 0 3 AC 302 2 9 4 1 1 9 4 0 IR 302 2 9 4 1 1 9 4 0 IR • • • 940 • 0 0 0 3 940 0 0 0 3 941 0 0 0 2 941 0 0 0 2 Step 1 Step 2 Memory CPU Registers Memory CPU Registers 300 1 9 4 0 3 0 1 PC 300 1 9 4 0 3 0 2 PC 301 5 9 4 1 0 0 0 3 AC 301 5 9 4 1 0 0 0 5 AC 302 2 9 4 1 5 9 4 1 IR 302 2 9 4 1 5 9 4 1 IR • • • 3 + 2 = 5 940 • 0 0 0 3 940 0 0 0 3 941 0 0 0 2 941 0 0 0 2 Step 3 Step 4 Memory CPU Registers Memory CPU Registers PC 300 1 9 4 0 3 0 2 PC 300 1 9 4 0 3 0 3 AC 301 5 9 4 1 0 0 0 5 AC 301 5 9 4 1 IR 302 2 9 4 1 2 9 4 1 IR 302 2 9 4 1 0 0 0 5 • • 2 9 4 1 • 940 • 0 0 0 3 940 0 0 0 3 941 0 0 0 2 941 0 0 0 5 Step 5 Step 6 lOMoAR cPSD| 58605085
Figure 3.5 Example of Program Execution
(contents of memory and registers in hexadecimal) Read Memory Write N Words 0 Data Address Data N – 1 Read I/O Module Internal Data Write External Address M Ports Data Internal Data Interrupt Signals External Data lOMoAR cPSD| 58605085 Instructions Address Control Data CPU Signals Interrupt Data Signals
Figure 3.15 Computer Modules
The interconnection structure must support the following types of transfers: lOMoAR cPSD| 58605085 lOMoAR cPSD| 58605085 A communication pathway Signals transmitted by any connecting two or more one device are available for devices reception by all other
•Key characteristic is that it is a devices attached to the bus shared transmission medium
•If two devices transmit during the
same time period their signals will I overlap and become garbled n n e
Typically consists of multiple communication lines Computer systems contain a t number of different buses •Each line is capable of that provide pathways
transmitting signals representing B c binary 1 and binary 0 between components at various levels of the e computer system hierarchy u t r s i System bus c •A bus that connects major The most common computer
computer components (processor, o memory, I/O) interconnection structures are based on the use of one o or more system buses n n lOMoAR cPSD| 58605085 Data Bus
◼ Data lines that provide a path for moving data among system modules
◼ May consist of 32, 64, 128, or more separate lines
◼ The number of lines is referred to as the width of the data bus
◼ The number of lines determines how many bits can be transferred at a time ◼ The width of the data bus is a key factor in determining overall system performance
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved. data bus read a word of data from ◼
◼ If the processor wishes to