Beruflich Dokumente
Kultur Dokumente
Organization:
L06: Instruction Cycle
1. Place the content of PC onto the bus by making the bus selection inputs
S2S1S0 equal to 010
2. Transfer the content of the bus to AR by enabling the LD input of AR
Memory Unit 7
1 Read Address
AR 1
1 LD
1 0 010 01 ……………0
……………0
T0 T1 ………… T15
PC 2
1 INR
Decoder
0 0 10 01
IR 3
Sequence Counter
1 LD Clock
During time T3, the control unit determines the type of instruction
that was just read from memory.
15 14 12 11 0
(b) Register reference instruction format 0 111 Register operation
(Opcode = 111)
15 14 12 11 0
(c) Input-output instruction format 1 111 I/O operation
(Opcode = 111)
9
Start
SC 0 T0
AR PC
T1
IR M[AR], PC PC+1
T2
Decode operation code in IR (12-14)
AR IR(0-11), I IR(15)
D7 I T3 T3 D7 I T3 T3 D7 I T3 T3 D7 I T3 T3
Execute Execute AR M[AR] Nothing
input-output Register-refernce
Instruction Instruction Execute
SC 0 SC 0 Memory-reference Instruction
SC 0
D7 I T3 T3 D7 I T3 T3 D7 I T3 T3 D7 I T3 T3
Execute Execute AR M[AR] Nothing
input-output Register-refernce
Instruction Instruction Execute
SC 0 SC 0 Memory-reference Instruction
SC 0
ADD to AC
D1T4: DR ← M[AR] read operand from memory and store it in DR
D1T5: AC← AC + DR, E ← Cout, SC ← 0 add AC with DR and save the result in AC.
LDA: Load to AC
D2T4: DR ← M[AR] read operand from memory and store it in DR
D2T5: AC ← DR, SC ← 0 transferee DR to AC.
STA: Store AC
D3T4: M[AR] ← AC , SC ← 0 save content of AC in memory.
address instruction
…….
……..
……..
135 CLA
Memory Memory
….. …..
Jump
….. …..
Return
Indirect
(a) Memory, PC, and AR branch (b) Memory, PC, and AR
at time T4 after17
execution.
ISZ: Increment and skip if Zero This instruction increments the word specified by the
effective address, and if the incremented value is zero,
PC is incremented by 1 in order to skip the next
instruction. Since it is not possible to increment a word
inside the memory, it is necessary to read the word into
DR, increment DR, and store the word back into
memory. D5T4: M[AR] ← PC, AR←AR+1
D6T4: DR ← M[AR]
D6T5: DR ← DR+1
D6T6: M[AR] ← DR, if (DR=0) then (PC ← PC+1), SC ← 0.
D0 T4 D1 T4 D2 T4
DR M[AR] DR M[AR] DR M[AR]
D0 T5 D1 T5 D2 T5
AC AC ∧ DR AC AC + DR AC DR
SC 0 E Cout SC 0
SC 0
19
Flowchart for memory-reference instructions
D3 T4 D4 T4 D5 T4 D6 T4
M[AR] AC PC AR M[AR] PC DR M[AR]
SC 0 SC 0 AR AR+1
D5 T5 D6 T5
PC AR DR DR+1
SC 0
D6 T6
M[AR] DR
IF (DR=0)
Then
(PC←PC+1)
SC 0
D7 I T3 T3 D7 I T3 T3 D7 I T3 T3 D7 I T3 T3
Execute Execute AR M[AR] Nothing
input-output Register-refernce
Instruction Instruction Execute
SC 0 SC 0 Memory-reference Instruction
SC 0
CAO, by Dr.for
Flowchart A.H. Abdul Hafez,
instruction CE Dept.
cycle (initial HKU
configuration) November
21 4, 2016
Input-Output Configuration
22
Input operation
Initially, FGI is cleared to 0. When a key is struck in the keyboard, an 8-bit code
is shifted into INPR and the input flag FGI IS SET TO 1. As long as the flag
FGI=1, the content of INPR cannot be changed with a new code. The computer
checks the FGI flag, if it is 1, the information in INPR is transferred into AC in
parallel and the FGI is cleared to 0. Once the flag is cleared, new information
code can be shifted into INPR by striking another key.
FGO
Receiver
Printer OUTR
interface
AC
Transmitter
Keyboard interface INPR
00110110
01110111
FGI 01
23
Output operation
Initially, FGO is set to 1. The computer checks the flag bit, if it is 1, the
information from AC is transferred in parallel into OUTR and FGO is cleared to 0.
The output device accepts the coded information, prints the corresponding
character, and when the operation is completed, it sets FGO to 1. As long as the
flag FGO is cleared, the computer does not load a new character code into OUTR.
FGO 10
Receiver
Printer OUTR
interface
AC
00110110
Transmitter
Keyboard interface INPR
FGI 0
p: SC ← 0 Clear SC
25
The end of the Lecture
Thanks for your time
Questions are welcome