CA_Unit_3
CA_Unit_3
Contents:
Control Design Instruction sequencing Interpretation
Hard wired control Design methods and CPU control unit.
Micro programmed Control - Basic concepts, minimizing
microinstruction size, multiplier control unit.
Micro programmed computers - CPU control unit
# MICRO-OPERATIONS
Execution of a program consists of a sequence of instruction cycles, with one machine instruction per cycle.
Each instruction cycle is made up of a number of smaller units e.g. , fetch, indirect, execute, and
interrupt, with only fetch and execute cycles always occurring.
To design a control unit, however, it needs to break down the description further. In fact, each of the smaller
cycles involves a series of steps, each of which involves the four processor registers.
Memory address register (MAR): Is connected to the address lines of the system bus. It specifies the
address in memory for a read or write operation.
Memory buffer register (MBR): Is connected to the data lines of the system bus. It contains the value
to be stored in memory or the last value read from memory.
Program counter (PC): Holds the address of the next instruction to be fetched.
Instruction register (IR): Holds the last instruction fetched.
To summarize, the execution of a program consists of the sequential execution of instructions. Each
instruction is executed during an instruction cycle made up of shorter sub-cycles (e.g., fetch, indirect, execute,
interrupt).The execution of each sub-cycle involves one or more shorter operations, that is, micro-operations
shown in figure below.
Fetch Cycle:
The fetch cycle occurs at the beginning of each instruction cycle and causes an instruction to be
fetched from memory.
The sequence of events for the fetch cycle from the point of view of its effect on the processor registers.
An example shown in Figure, at the beginning of the fetch cycle, the address of the next instruction to be
executed is in the program counter (PC); in this case, the address is 1100100.
The first step is to move that address to the memory address register (MAR) because this is the only
register connected to the address lines of the system bus.
The second step is to bring in the instruction. The desired address (in the MAR) is placed on the address
bus, the control unit issues a READ command on the control bus, and the result appears on the data bus and is
copied into the memory buffer register (MBR). It also needs to increment the PC by the instruction length to get
ready for the next instruction. Because these two actions (read word from memory, increment PC) do not
interfere with each other and do simultaneously to save time.
The third step is to move the contents of the MBR to the instruction register (IR).This frees up the
MBR for use during a possible indirect cycle.
Indirect Cycle:
Once an instruction is fetched, the next step is to fetch source operands. Let us assume a one-address
instruction format, with direct and indirect addressing allowed.
If the instruction specifies an indirect address, then an indirect cycle must precede the execute cycle.
The address field of the instruction is transferred to the MAR. This is then used to fetch the address of the
operand. Finally, the address field of the IR is updated from the MBR, so that it now contains a direct rather than
an indirect address. The IR is now in the same state as if indirect addressing had not been used, and it is ready
for the execute cycle.
Interrupt Cycle:
At the completion of the execute cycle, a test is made to determine whether any enabled interrupts have
occurred. If so, the interrupt cycle occurs. The nature of this cycle varies greatly from one machine to another.
In the first step, the contents of the PC are transferred to the MBR, so that they can be saved for return from the
interrupt.
Then the MAR is loaded with the address at which the contents of the PC are to be saved, and the PC is
loaded with the address of the start of the interrupt-processing routine. These two actions may each be a single
micro-operation. However, it may take one or more additional micro-operations to obtain the Save _Address and
the Routine_Address before they can be transferred to the MAR and PC, respectively.
In any case, once this is done, the final step is to store the MBR, which contains the old value of the PC,
into memory. The processor is now ready to begin the next instruction cycle.
Execute Cycle:
The fetch, indirect, and interrupt cycles are simple and predictable. Each involves a small, fixed sequence of
micro-operations and, in each case, the same micro-operations are repeated each time around.
This is not true of the execute cycle. Because of the variety opcodes, there are a number of different
sequences of micro-operations that can occur.
Unit-3: Page | 3 Dr S K Singh
First, consider an add instruction:
ADD R1, X
Which adds the contents of the location X to register R1. The following sequence of micro-operations might
occur:
Control Signals: For the control unit to perform its function, it must have inputs that allow it to determine
the status of the system and outputs that allow it to control the activities of the system. These are the
external specifications of the control unit. Internally, the control unit must have the logic required to perform its
sequencing and execution functions.
Let us consider the fetch cycle to see how the control unit maintains control. The control unit keeps
track of where it is in the instruction cycle. At a given point, it knows that the fetch cycle is to be performed
next.
The first step is to transfer the contents of the PC to the MAR. The control unit does this by activating
the control signal that opens the gates between the bits of the PC and the bits of the MAR.
The next step is to read a word from memory into the MBR and increment the PC.
The control unit does this by sending the following control signals simultaneously:
A control signal that opens gates, allowing the contents of the MAR onto the address bus
A memory read control signal on the control bus
A control signal that opens the gates, allowing the contents of the data bus to be stored in the MBR
Control signals to logic that add 1 to the contents of the PC and store the result back to the PC
Following this, the control unit sends a control signal that opens gates between the MBR and the IR.
This completes the fetch cycle except for one thing: The control unit must decide whether to perform an
indirect cycle or an execute cycle next. To decide this, it examines the IR to see if an indirect memory reference
is made.
The indirect and interrupt cycles work similarly. For the execute cycle, the control unit begins by
examining the opcode and, on the basis of that, decides which sequence of micro-operations to perform for the
execute cycle.
Control signals for an instruction execution have to be generated not in a single time point but during the entire
time interval that corresponds to the instruction execution cycle. Following the structure of this cycle, the
suitable sequence of internal states is organized in the control unit.
A number of signals generated by the control signal generator matrix are sent back to inputs of the next
control state generator matrix.. This matrix combines these signals with the timing signal
signals,
s, which are generated
by the timing unit based on the rectangular patterns usually supplied by the quartz generator. When a new
instruction arrives at the control unit is in the initial state of new instruction fetching. Instruction decoding
allows the control
ntrol unit enters the first state relating execution of the new instruction, which lasts as long as the
timing signals and other input signals as flags and state information of the computer remain unaltered. A change
of any of the earlier mentioned signals stimulates the change of the control unit state.
This causes that a new respective input is generated for the control signal generator matrix. When an
external signal appears, (e.g. an interrupt) the control unit takes entry into a next control state that is the state
concerned with the reaction to this external signal (e.g. interrupt processing). The values of flags and state
variables of the computer are used to select suitable states for the instruction execution cycle.
The last states in the cycle are control states that commence fetching the next instruction of the program:
sending the program counter content to the main memory address buffer register and next, reading the
instruction word to the instruction register of computer. When the ongoing instr
instruction
uction is the stop instruction that
Unit-3: Page | 6 Dr S K Singh
ends program execution, the control unit enters an operating system state, in which it waits for a next user
directive.
In this way, unnecessary storing of the same operation parts of microinstructions is avoided. In this case,
microinstruction word can be much shorter than with the single level control store store.. It gives a much smaller
size in bits of the microinstruction memory and, as a result, a much smaller size of the entire control memory.
The microinstruction memory contains the control for selection of consecutive microinstructions, while those
control signals are generated at the basis of nano
nano-instructions. In nano-instructions,
instructions, control signals are frequently
encoded usingg 1 bit/ 1 signal method that eliminate decoding.
Hardwired control unitt generates the control signals Micrprogrammed control unit generates the control
needed for the processor using logic circuits signals with the help of micro instructions stored in
control memory
Hardwired control unit is faster when compared to This is slower than the other as micro instructions are
microprogrammed control unit as the required control used for generating signals here
More costlier as everything has to be realized in terms Less costlier than hardwired control as only micro
It cannot handle complex instructions as the circuit It can handle complex instructions
Only limited number of instructions are used due to the Control signals for many instructions can be
Used in computer that makes use of Reduced Used in computer that makes use of Complex
References:
1. Computer Organization and Architecture: Designing for Performance, 8th Edition, Authors: William
Stallings Publisher: Prentice-Hall India.