UNIT 6
UNIT 6
Part A Q&A
8. Define MFC.
To accommodate the variability in response time, the processor
waits until it receives an indication that the requested read
operation has been completed. The control signal used for this
purpose is known as Memory-Function-Completed (MFC).
9. What is WMFC.
WMFC is the control signal that causes the processor’s control
circuitry to wait for the arrival of the MFC signal.
12. What are the two approaches used for generating the
control signals in proper sequence?
Hardwired control
Microprogrammed control
1. Fetch cycle
2. Decode cycle
3. Execute cycle
To perform fetch, decode and execute cycles the processor unit has to perform set of operations
called micro-operations.
Single bus organization of processor unit shows how the building blocks of processor unit are
organised and how they are interconnected.
They can be organised in a variety of ways, in which the arithmetic and logic unit and all
processor registers are connected through a single common bus.
It also shows the external memory bus connected to memory address(MAR) and data
register(MDR).
Singl
The registers Y,Z and Temp are used only by the processor unit for temporary storage during the
execution of some instructions.
These registers are never used for storing data generated by one instruction for later use by
another instruction.
The programmer cannot access these registers.
The IR and the instruction decoder are integral parts of the control circuitry in the processing
unit.
All other registers and the ALU are used for storing and manipulating data.
The data registers, ALU and the interconnecting bus is referred to as data path.
Register R0 through R(n-1) are the processor registers.
The number and use of these register vary considerably from processor to processor.
These registers include general purpose registers and special purpose registers such as stack
pointer, index registers and pointers.
These are 2 options provided for A input of the ALU.
The multiplexer(MUX) is used to select one of the two inputs.
It selects either output of Y register or a constant number as an A input for the ALU according
to the status of the select input.
It selects output of Y when select input is 1 (select Y) and it selects a constant number when
select input is 0(select C) as an input A for the multiplier.
The constant number is used to increment the contents of program counter.
For the execution of various instructions processor has to perform one or more of the
following basic operations:
a) Transfer a word of data from one processor register to the another or to the ALU.
b) perform the arithmetic or logic operations on the data from the processor registers and store the
result in a processor register.
c) Fetch a word of data from specified memory location and load them into a processor register.
d) Store a word of data from a processor register into a specified memory location.
To fetch a word of data from memory the processor gives the address of the memory location
where the data is stored on the address bus and activates the Read operation.
The processor loads the required address in MAR, whose output is connected to the
address lines of the memory bus.
At the same time processor sends the Read signal of memory control bus to indicate the
Read operation.
When the requested data is received from the memory its stored into the MDR, from
where it can be transferred to other processor registers.
Storing a word in memory
To write a word in memory location processor has to load the address of the desired memory
location in the MAR, load the data to be written in memory, in MDR and activate write operation.
Assume that we have to execute instruction Move(R2), R1.
This instruction copies the contents of register R1 into the memory whose location is specified
by the contents of register R2.
The actions needed to execute this instruction are as follows:
a) MAR [R2]
b) MDR [R1]
c) Activate the control signal to perform the write operation.
The various control signals which are necessary to activate to perform given actions in each step.
a) R2out, MARin
b) R1out, MDRinP
c) MARout, MDRoutM,Write
Signal MARin controls the connection to the internal processor address bus and signal MARout
controls the connection to the memory address bus.
Control signals read and write from the processor controls the operation Read and Write
respectively.
The address of the memory word to be read word from that location to the register R3,.
It can be indicated by instruction MOVE R3,(R2).
Various control signals which are necessary to activate to perform given actions in each step:
a) R2out, MARin
b) MARout, MDRinM, Read
c) MDRoutP,R3in
Let us find the complete control sequence for execution of the instruction Add R 1,(R2) for
the single bus processor.
o This instruction adds the contents of register R 1 and the contents of memory location
specified by register R2 and stores results in the register R1.
o To execute bus instruction it is necessary to perform following actions:
1. Fetch the instruction
2. Fetch the operand from memory location pointed by R2.
3. Perform the addition
4. Store the results in R1.
The sequence of control steps required to perform these operations for the single bus
architecture are as follows;
1.PCout, MARin Yin, select C, Add, Zin
2. Zout, PCin, MARout , MARinM, Read
3. MDRout P,MARin
4. R2out , MARin
5. R2out , Yin,MARout , MARinM, Read
6. MDRout P, select Y, Add, Zin
7. Zout, R1in
(i) Step1, the instruction fetch operation is initiated by loading the controls of the PC into
the MAR.
PC contents are also loaded into register Y and added constant number by activating
select C input of multiplexer and add input of the ALU.
By activating Zin signal result is stored in the register Z
(ii) Step2 , the contents of register Z are transferred to pc register by activating Z out and
pcin signal.
This completes the PC increment operation and PC will now point to next instruction,
In the same step (step2), MARout , MDR inM and Read signals are activated.
Due to MARout signal , memory gets the address and after receiving read signal and
activation of MDR in M Signal ,it loads the contents of specified location into MDR
register.
(iii) Step 3 contents of MDR register are transferred to the instruction register(IR) of the
processor.
The step 1 through 3 constitute the instruction fetch phase.
At the beginning of step 4, the instruction decoder interprets the contents of the IR.
This enables the control circuitry to activate the control signals for steps 4 through 7,
which constitute the execution phase.
(iv) Step 4, the contents of register R 2 are transferred to register MAR by activating R 2out
and MAR in signals.
The sequence of control steps required to perform these operations for the single bus
architecture are as follows;
1.PCout, MARin Yin, select C, Add, Zin
2. Zout, PCin, MARout , MARinM, Read
3. MDRout P,MARin
4. R2out , MARin
5. R2out , Yin,MARout , MARinM, Read
6. MDRout P, select Y, Add, Zin
7. Zout, R1in
(i) Step1, the instruction fetch operation is initiated by loading the controls of the PC into
the MAR.
PC contents are also loaded into register Y and added constant number by activating
select C input of multiplexer and add input of the ALU.
By activating Zin signal result is stored in the register Z
(ii) Step2 , the contents of register Z are transferred to pc register by activating Z out and
pcin signal.
This completes the PC increment operation and PC will now point to next instruction,
In the same step (step2), MARout , MDR inM and Read signals are activated.
Due to MARout signal , memory gets the address and after receiving read signal and
activation of MDR in M Signal ,it loads the contents of specified location into MDR
register.
(iii) Step 3 contents of MDR register are transferred to the instruction register(IR) of the
processor.
The step 1 through 3 constitute the instruction fetch phase.
At the beginning of step 4, the instruction decoder interprets the contents of the IR.
This enables the control circuitry to activate the control signals for steps 4 through 7,
which constitute the execution phase.
(iv) Step 4, the contents of register R2 are transferred to register MAR by activating R 2out
and MAR in signals.
(v) Step 5, the contents of register R 1 are transferred to register Y by activating R 1out and
Yin signals. In the same step, MARout, MDRinM and Read signals are activated.
Due to MARout signal, memory gets the address and after receiving read signal and
activation of MDRinM signal it loads the contents of specified location into MDR register.
(vi) Step 6 MDRoutP, select Y, Add and Z in signals are activated to perform addition of
contents of register Y and the contents of MDR. The result is stored in the register Z.
(vii) Step 7, the contents of register Z are transferred to register R 1 by activating Zout and
R1in signals.
Branch Instruction
The branch instruction loads the branch target address in PC so that PC will fetch the next
instruction from the branch target address.
The branch target address is usually obtained by adding the offset in the contents of PC.
The offset is specified within the instruction.
The control sequence for unconditional branch instruction is as follows:
1. PCout, MARin, Yin, SelectC, Add, Zin
2. Zout, PCin, MARout, MDRinM, Read
3. MDRoutP,IRin
4. PCout,Yin
5. Offset_field_Of_IRout,SelectY,Add,Zin
6. Zout,PCin
First 3 steps are same as in the previous example.
Step 4: The contents of PC are transferred to register Y by activating PC out and Yin
signals.
Step 5: The contents of PC and the offset field of IR register are added and result is saved
in register Z by activating corresponding signals.
Step 6: The contents of register Z are transferred to PC by activating Z out and PC in signals
The control units use fixed logic circuits to interpret instructions and generate control signals
from them.
The fixed logic circuit block includes combinational circuit that generates the required
control outputs for decoding and encoding functions.
Instruction decoder
It decodes the instruction loaded in the IR.
If IR is an 8 bit register then instruction decoder generates 28(256 lines); one for each
instruction.
According to code in the IR, only one line amongst all output lines of decoder goes
high (set to 1 and all other lines are set to 0).
Step decoder
It provides a separate signal line for each step, or time slot, in a control sequence.
Encoder
It gets in the input from instruction decoder, step decoder, external inputs and
condition codes.
It uses all these inputs to generate the individual control signals.
After execution of each instruction end signal is generated this resets control step
counter and make it ready for generation of control step for next instruction.
The encoder circuit implements the following logic function to generate Yin
Yin = T1 + T5 . Add + T . BRANCH+…
The Yin signal is asserted during time interval T1 for all instructions, during T5 for an
ADD instruction, during T4 for an unconditional branch instruction, and so on.
As another example, the logic function to generate Zout signal can given by
Zout = T2 + T7 . ADD + T6 . BRANCH +….
The Zout signal is asserted during time interval T2 of all instructions, during T7 for an
ADD instruction, during T6 for an unconditional branch instruction, and so on.
The micro programs for all instructions are stored in the control memory.
The address where these microinstructions are stored in CM is generated by microprogram
sequencer/microprogram controller.
The microprogram sequencer generates the address for microinstruction according to the
instruction stored in the IR.
The microprogrammed control unit,
- control memory
- control address register
- micro instruction register
- microprogram sequencer
The control address register holds the address of the next microinstruction to be read.
When address is available in control address register, the sequencer issues READ command to
the control memory.
After issue of READ command, the word from the addressed location is read into the
microinstruction register.
Now the content of the micro instruction register generates control signals and next address
information for the sequencer.
The sequencer loads a new address into the control address register based on the next address
information.
Disadvantages
A microprogrammed control unit is somewhat slower than the hardwired control unit, because
time is required to access the microinstructions from CM.
The flexibility is achieved at some extra hardware cost due to the control memory and its
access circuitry.
Microprogram sequencing
The task of microprogram sequencing is done by microprogram sequencer.
2 important factors must be considered while designing the microprogram sequencer:
a) The size of the microinstruction
b) The address generation time.
The size of the microinstruction should be minimum so that the size of control memory required
to store microinstructions is also less.
This reduces the cost of control memory.
With less address generation time, microinstruction can be executed in less time resulting better
throughout.
During execution of a microprogram the address of the next microinstruction to be executed has 3
sources:
i. Determined by instruction register
ii. Next sequential address
iii. Branch
Let us assume that the source operand can be specified in the following addressing modes:
a) Indexed
b) Autoincrement
c) Autodecrement
d) Register indirect
e) Register direct
Each box in the flowchart corresponds to a microinstruction that controls the transfers and
operations indicated within the box.
The microinstruction is located at the address indicated by the number above the upper right-hand
corner of the box.
During the execution of the microinstruction, the branching takes place at point A.
The branching address is determined by the addressing mode used in the instruction.
Techniques for modification or generation of branch addresses
i. Bit-ORing
The branch address is determined by ORing particular bit or bits with the current address of
microinstruction.
Eg: If the current address is 170 and branch address is 172 then the branch address can be
generated by ORing 02(bit 1), with the current address.
i. Using condition variables
It is used to modify the contents CM address register directly, thus eliminating whole or in part
the need for branch addresses in μμμμμμmicroinstructions.
Eg: Let the condition variable CY indicate occurance of CY = 1, and no carry when CY = 0.
Suppose that we want to execute a SKIP_ON_CARRY microinstruction.
It can be done by logically connecting CY to the count enable input of μpc at on appropriate point
in the microinstruction cycle.
It allows the overflow condition increment μpc an extra time, thus performing the desired skip
operation.
8. Explain the Microinstructions with Next-Address
Field.
The microprogram we discussed requires several
branch microinstructions, which perform no useful
operation in the datapath.
A powerful alternative approach is to include an
address field as a part of every microinstruction to
indicate the location of the next microinstruction to
be fetched.
Pros: separate branch microinstructions are virtually
eliminated; few limitations in assigning addresses to
microinstructions.
Cons: additional bits for the address field (around
1/6)
IR
External Condition
Inputs codes
Decoding circuits
AR
Control store
Next address I R
Microinstruction decoder
Control signals
F0 F1 F2 F3
F4 F5 F6 F7
F8 F9 F10