Escolar Documentos
Profissional Documentos
Cultura Documentos
and Design
5-1
Instruction
Cycle
15
12 11
0
Operation Code :
Address
z The most basic part of an instruction code Op. Code
z A group of bits that define such operations as add, subtract, multiply, shift, and
complement(bit 12-15 : 24 = 16 distinct operations)
Computer System Architecture
5-2
The operation is performed with the memory operand and the content of AC
Store each instruction code(program) and operand (data) in 16-bit memory word
Addressing Mode
z Immediate operand :
the second part of an instruction code(address field) specifies an operand
z
I=0 : Direct,
I=1 : Indirect
One bit of the instruction code is used to distinguish between a direct and an
indirect address : Fig. 5-2(a)
5-3
Effective Address
z The operand address in computation-type instruction or the target address in a
branch-type instruction
5-4
z
z
5-5
Accumulator(AC) : 3 Path
s2
s1
s0
Memory unit
409616
Write
LD
LD
D2T5 : AC DR, SC 0
CLR
INR
CLR
DR
3) INPR : Device
(Adder & Logic )
Adder
and
logic
INR
3
CLR
E
AC
LD
INR
4
CLR
INPR
INR
PC
LD
Read
AR
D2T4 : DR M [ AR ]
Address
Bus
IR
TR
LD
LD
INR
CLR
OUTR
LD
Clock
5-6
I=0 : Direct,
I=1 : Indirect
15 14
12 11
Opcode
Address
Register-reference instruction
7xxx (7800 ~ 7001) : CLA, CMA, .
15 14
12 11
Register Operation
Input-Output instruction
Fxxx(F800 ~ F040) : INP, OUT, ION, SKI, .
15 14
12 11
Symbol
AND
ADD
LDA
STA
BUN
BSA
ISZ
CLA
CLE
CMA
CME
CIR
CIL
INC
SPA
SNA
SZA
SZE
HLT
INP
OUT
SKI
SKO
ION
IOF
Hex Code
I=0 I=1
0xxx 8xxx
1xxx 9xxx
2xxx Axxx
3xxx Bxxx
4xxx Cxxx
5xxx Dxxx
6xxx Exxx
7800
7400
7200
7100
7080
7040
7020
7010
7008
7004
7002
7001
F800
F400
F200
F100
F080
F040
Description
And memory word to AC
Add memory word to AC
Load memory word to AC
Store content of AC in memory
Branch unconditionally
Branch and Save return address
Increment and skip if zero
Clear AC
Clear E
Complement AC
Comp
m
e
Circulate right AC and E
Circulate left AC and E
Increment AC
Skip next instruction if AC positive
Skip next instruction if AC negative
Skip next instruction if AC zero
Skip next instruction if E is 0
Halt computer
Input character to AC
Output character from AC
Skip on input flag
Skip on output flag
Interrup
Inter
I/O Operation
5-7
5-8
11 - 0
38
decoder
7 6 5 4 3 2 1 0
I
Other inputs
D0
.
.
D7 .
12
Control
logic
gates
Control
outputs
T15
T0
.
.
.
13
15 14
.
.
.
14
.
.
.
15
10
416
decoder
4-bit
sequence
counter
(SC)
Increment(INR)
Clear(CLR)
Clock
5-9
Instruction Cycle
z 1) Instruction Fetch from Memory
z 2) Instruction Decode
z 3) Read Effective Address(if indirect addressing mode)
z 4) Instruction Execution
z 5) Go to step 1) : Next Instruction[PC + 1]
Continue
indefinitely
unless HALT
instruction is
encountered
T0 = 1
T0 : AR PC
1) Place the content of PC onto the bus by making the bus selection inputs S2S1S0=010
2) Transfer the content of the bus to AR by enabling the LD input of AR
Computer System Architecture
5-10
T1 = 1
T1 : IR M [ AR ], PC PC + 1
Instruction Decode : T2
T2 : D0 ,...., D7 Decode IR (12 14), AR IR (0 11), I IR (15)
Op.code
T1=1
s2
T0=1
s1
Address Di/Indirect
Memory
Memory unit
unit
>
Bus
s0
Address
Read
Read effective
Register(I=0)
D7IT3(Execute)
Address
I/O
(I=1)
D7IT3 (Execute)
D7IT3( AR M [ AR ] )
D7=0 : Memory Ref. Indirect(I=1)
Direct (I=0)
nothing in T3
> Register I/O T3 Memory Ref.
T3 Operand effective address
D7=1
>
AR
PC
LD
INR
IR
LD
Clock
Common bus
0
1
0
1
1
1
5-11
PC
T1
IR
M[AR], PC
PC+1
IR(12,13,14)
3X8
Decoder
D7 : Register or I/O = 1
= 111
D6 - D0 : 7 Memory Ref.
Instruction(Tab. 5-4)
T2
Decode operation code in IR(12-14)
AR
IR(0-11), I
I(15)
(Register or I/O) = 1
0 = (Memory-reference
I
AND to AC
(I/O) = 1
D0T4 : DR M [ AR ]
0 = (register)
(indirect) = 1
D0T5 : AC AC DR, SC 0
T3
Execute
input-output
instruction
SC
0
ADD to AC
D1T4 : DR M [ AR ]
0 = (direct)
I
T3
Execute
register-reference
instruction
SC
0
T3
AR
M[AR]
T3
Nothing
Execute
memory-reference
instruction
SC
0
5-12
D3T4 : M [ AR ] AC , SC 0
PC = 20
PC = 21
0
BSA 135
next instruction
D4T4 : PC AR, SC 0
D5T4 : M [ AR ] PC , AR AR + 1
D5T5 : PC AR, SC 0
z
z
BUN 135
D6T4 : DR M [ AR ]
D6T5 : DR DR + 1
D6T6 : M [ AR ] DR, if ( DR = 0) then ( PC PC + 1), SC 0
5-13
1 : Ready
0 : Not ready
5-14
Instruction cycle
Interrupt cycle
=1
Execute
instruction
IEN
=1
=1
Branch to location 1
PC
1
FGI
=0
=0
=1
R = 0 : instruction cycle
R = 1 : Interupt cycle
IEN
R
FGO
0
0
=0
0
PC = 1
Save Return
Address(PC) at 0
Jump to 1(PC=1)
256(return address)
0
BUN 1120
Main Program
Interrupt
Here!
255
256
Fig. 5-14
RT0 : AR 0, TR PC
RT1 : M [ AR ] TR, PC 0
RT2 : PC PC + 1, IEN 0, R 0, SC 0
Interrupt
1120
Service Routine
1
BUN
5-15
5-16
Register Control : AR
z Control inputs of AR : LD, INR, CLR
AR ? z Find all the statements that change the AR
in Tab. 5-6
R ' T0 : AR PC
z Control functions
R ' T2 : AR IR(0 11)
LD ( AR ) = R ' T0 + R ' T2 + D7 ' IT3 D7 ' IT3 : AR M [ AR ]
CLR ( AR ) = RT0
RT0 : AR 0
INR( AR ) = D5T4
From Bus
12
12
AR
To Bus
Clock
D'7
I
T3
LD
INR
CLR
T2
R
T0
D5
T4
D5T4 : AR AR + 1
? M [ AR ]
J
0
1
KQ(t+1)
1
0
0
1
pB7 : IEN 1
pB6 : IEN 0
RT2 : IEN 0
Computer System Architecture
5-17
Bus Control
z Encoder for Bus Selection : Tab. 5-7
S0 = x1 + x3 + x5 + x7
S1 = x2 + x3 + x6 + x7
S2 = x4 + x5 + x5 + x7
z x1 = 1 : Bus AR = Find ? AR
D T : PC AR
4 4
D5T5 : PC AR
Control Function : x1 = D4T4 + D5T5
z
x1
x2
x3
x4
x5
x6
x7
S0
Encoder
S1
S2
Multiplexer
Bus Select
Input
x2 = 1 : Bus PC = Find ? PC
5-18
Fig. 5-21
Fig. 2-11
16
16
From DR
8
From INPR
Adder and
logic
circuit
Accumulator
register
(AC)
16
LD
Fig. 5-20
INR
16
To Bus
CLR Clock
Control
gates
5-19
16
16
AC
To Bus
Clock
D0
AND
LD
INR
CLR
T5
D0T5 : AC AC DR
D1
ADD
D2
DR
D1T5 : AC AC + DR
D2T5 : AC DR
pB11 : AC (0 7) INPR
T5
LD
rB9 : AC AC
INPR
B11
r
COM
B9
SHR
rB11 : AC 0
CLR
rB5 : AC AC + 1
INR
B7
SHL
B6
INC
B5
CLR
B11
5-20
ADD
FA
Ci+1
From
INPR
bit(i)
J
0
1
LD
Ii (Fig.2-11)
DR
KQ(t+1)
1
0
0
1
AC(i)
INPR
Clock
COM
* Fig. 2-11
Increment, Clear,
Count
SHR
AC(i+1)
SHL
AC(i-1)
5-21
Mano Machine
Integration !
Due Date : 1
5-22
T0
T15
15 14
10
416
decoder
4-bit
sequence
counter
(SC)
Increment(INR)
Clear(CLR)
Clock
D3T4 : SC 0