ITBP205 Digital Design and Computer Organization
ITBP205 Digital Design and Computer Organization
ITBP205 Digital Design and Computer Organization
Outline
Architecture vs. Organization
Computer Components
Instruction cycle
Interrupts
2
Architecture vs.
Organization
Architect
ure
Organiza
tion
Architecture vs.
Organization
All Intel x86 family share the same basic
architecture
The IBM System/370 family share the same
basic architecture
Organization differs between different
versions
This gives code backward compatibility
A new member of the family can still run the software
designed for old versions
For example, programs designed for Pentium I, can still
run on Pentium II, III, and IV.
Internal Organization of
Computers
Internal workings of every computer can be
broken down into three parts
CPU (central processing unit).
Main Memory.
I/O (input/output) devices.
Address Bus
CPU
CU
ALU
Regist
ers
RA
M
RO
M
Print
er
Disk
Data Bus
Control Bus
Monit
or
Keybo
ard
Computer Components
Central Processing Unit (CPU)
consists of:
Control Unit (CU)
Arithmetic and Logic Unit (ALU)
Registers
Main Memory
RAM
ROM
System Bus
For a device (memory or I/O) to be recognized by
the CPU, it must be assigned an address.
No two devices can have the same address.
The address assigned to a given device must be unique.
Data Bus
The Data Bus
is used to
carry
information
in/out of a
CPU.
Data buses
are
bidirection
al
control
Decode
Decode
rr
Address
Main Memory
Bus width
Data
CPU
Address Bus
The address bus is used to carry the address
bits from the CPU to the devices.
Binary
Usually
represente
d by
assembly
codes
Elements of an Instruction
Operation code (Op code)
Do this
Source Operand reference
To this
Result Operand reference
Put the answer here
Next Instruction Reference
When you have done that, do this...
8 bits
Op-Code
ADD
16 bits
16 bits
Operand Reference
A
Operand Reference
B
16
Instruction Cycle
Two steps:
Fetch
Execute
Fetch Cycle
Program Counter (PC) holds
address of next instruction to be
fetched
CU puts the address on the
address bus and send a read
signal to memory
Memory puts the content of the
address on the data bus
CU reads the data bus and store
the content into Instruction
Register (IR).
The CU decode the instruction
Execute Cycle
The CU generates the control signals
to perform the required actions:
Processor-memory
Processor I/O
Data processing
Control
Combination of above
address
calculati
on
Instructi
on fetch
Instructi
on
decoding
Result
store
Result
address
calculati
on
Operand
address
calculati
on
Data
operatio
n
Operand
Fetch
20
Example of Program
ExecutionEnd of Fetch
End of Execute
Cycle
PC
30
0
30
1
1 940
5 941
2 942
30
2
LDA,
940
ADD,
941
STR,
942
20
17
Cycle
PC
IR
IR
AC
AC
MAR
MBR
PC
IR
AC
MAR
94
0
MBR
94
1
PC
94
300
IR
1 940
301
20
5 941
302
3
7
2 942
300
301
1 94
940
0
MAR
20
MBR
301
302
PC
IR
5 94
941
31
7
AC
MAR
302
MBR
2 94
942
32
PC
IR
7
22
Exercise
Consider the following simple program
is stored in memory starting from
address 500. You are required to show
the content of the IR, PC, MAR, MBR,
and the accumulator (AC) at the end of
each fetch and execute cycle.
500 1 620
LDA,
620
501 7 621
MUL,
621
502 2 622
STR,
622
23
Interrupts
Mechanism by which other modules (e.g.
I/O) may interrupt normal sequence of
processing
Program
Timer
I/O
Hardware
failure
Program Timing
Interrupt Cycle
Added to instruction cycle
Processor checks for interrupt
Indicated by an interrupt signal
Fetch
Execut
e
Check
for
Interrup
t
Execute
ISR
Exercise
halt
fetch next instruction
check for interrupts
none of the above