computer architecture lecture 12 fasih ur rehman

15
Computer Architecture Lecture 12 Fasih ur Rehman

Upload: candace-bridges

Post on 23-Dec-2015

228 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Computer Architecture Lecture 12 Fasih ur Rehman

Computer Architecture

Lecture 12Fasih ur Rehman

Page 2: Computer Architecture Lecture 12 Fasih ur Rehman

Last Class

• Multiple Bus Organization• Control Unit

Page 3: Computer Architecture Lecture 12 Fasih ur Rehman

Today’s Agenda

• Control Unit– Hardwired Control

Page 4: Computer Architecture Lecture 12 Fasih ur Rehman

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

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

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

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

Hardwired Control

Page 9: Computer Architecture Lecture 12 Fasih ur Rehman

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

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

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

Example (Zin)

• Zin = T1 + T6 • ADD + T4 • BR + …

Page 13: Computer Architecture Lecture 12 Fasih ur Rehman

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

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

Summary

• Control Unit– Hardwired control