computer architecture lecture 12 fasih ur rehman
TRANSCRIPT
![Page 1: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/1.jpg)
Computer Architecture
Lecture 12Fasih ur Rehman
![Page 2: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/2.jpg)
Last Class
• Multiple Bus Organization• Control Unit
![Page 3: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/3.jpg)
Today’s Agenda
• Control Unit– Hardwired Control
![Page 4: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/4.jpg)
Control Unit
• Basic Tasks– To go through a control sequence for each instruction– To generate appropriate control signals for each task (or
control step)
• Control unit is driven by the processor clock• Generated Control signal depends on
– The actual step to be executed– The condition and status flag of the processor– The actual instruction executed– Any external signal received (such as interrupts)
![Page 5: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/5.jpg)
Control Unit
• To execute instructions, a processor must have arrangement to generate control signals in proper sequence
• How control signals can be generated– Hard-wired Control– Micro-programmed Control– Programmable Logic Array
![Page 6: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/6.jpg)
Hardwired Control
• A hardwired control is called a finite state machine– Sequences using a counter and produces
control signals at the right time– Control signals are functions of the IR, external
inputs and condition codes• Hardwired system can operate at high speed; but
with little flexibility.
![Page 7: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/7.jpg)
Generation of Signals
• Each step in sequence of execution is completed in one clock cycle.
• A counter (called step counter) is used to keep track of the control steps
• Control signals are function of– Contents of step counter– Contents of IR– Condition codes– External signal (MFC or interrupts etc)
![Page 8: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/8.jpg)
Hardwired Control
![Page 9: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/9.jpg)
Detailed Diagram
Externalinputs
Figure 7.11. Separation of the decoding and encoding functions.
Encoder
ResetCLK
Clock
Control signals
counter
Run End
Conditioncodes
decoder
Instruction
Step decoder
Control step
IR
T1 T2 Tn
INS1
INS2
INSm
![Page 10: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/10.jpg)
Generation (cont.)
• Step decoder provides a separate signal line for each step in the control sequence
• The o/p of the instruction decoder comprises separate lines for each machine instruction.
• For any instruction loaded in Instruction Register, only one of the output line INS1 – INSm is HIGH (i.e. 1) all other lines will be LOW (i.e. 0)
• The decoder inputs are combined to generate individual control signals
![Page 11: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/11.jpg)
Example (Zin)
• Zin is implemented by
• Zin = T1 + T6 • ADD + T4 • BR + …
• This signal is asserted in 1st step, 6th step in Add and 4th step of branch
Step Action
1 PCout, MAR in , Read,Select4,Add, Zin
2 Zout, PC in , Y in , WMF C
3 MDRout, IR in
4 R3out , MAR in , Read
5 R1out , Y in , WMF C
6 MDRout, SelectY,Add, Zin
7 Zout, R1in , End
Figure7.6. Control sequenceforexecutionof theinstructionAdd (R3),R1.
StepAction
1 PCout, MAR in , Read,Select4,Add, Zin
2 Zout, PCin , Yin, WMF C
3 MDRout , IRin
4 Offset-field-of-IRout, Add, Zin
5 Zout, PCin, End
![Page 12: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/12.jpg)
Example (Zin)
• Zin = T1 + T6 • ADD + T4 • BR + …
![Page 13: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/13.jpg)
Example (END)
• END causes new instruction fetch by resetting control step counter– RUN = 1 counter increments by one at each clock– RUN = 0 counter stops counting
• Needed when processor is WMFC signal
![Page 14: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/14.jpg)
Example (END)
Figure 7.13. Generation of the End control signal.
T7
Add BranchBranch<0
T5
End
NN
T4T5
End = T7 • ADD + T5 • BR + (T5 • N + T4 • N) • BRN +…
![Page 15: Computer Architecture Lecture 12 Fasih ur Rehman](https://reader036.vdocuments.mx/reader036/viewer/2022081804/56649dac5503460f94a9c46f/html5/thumbnails/15.jpg)
Summary
• Control Unit– Hardwired control