Coa Module 4 Part 1
Coa Module 4 Part 1
Coa Module 4 Part 1
org
1
Microprogrammed Control
Control Unit
● The function of the control unit in a digital computer is to initiate sequences of microoperations.
● Two methods of implementing control unit are
○ Hardwired control
○ Microprogrammed control.
● Hardwired Control
○ Design involves the use of fixed instructions, fixed logic blocks, encoders, decoders, etc.
○ Key characteristics are high-speed operation, expensive, relatively complex, and no flexibility of adding
new instructions.
○ Example CPUs: Intel 8085, Motorola 6802, and any RISC (Reduced Instruction Set Computer) CPUs.
3
Microprogrammed Control Unit
● A control unit whose binary control variables are stored in memory is called a microprogrammed control
unit.
● Main advantage - for different control sequence; only have to change microprogram residing in control
memory. (No need of hardware changes)
● The control function that specifies a microoperation is a binary variable.
● The control variables at any given time can be represented by a string of 1’s and 0’s called a control word.
● Each word in control memory contains a microinstruction.
● The microinstruction specifies one or more microoperations.
● A sequence of microinstructions constitutes a microprogram.
4
Microprogrammed Control Unit
● A computer with microprogrammed control unit will have 2 memories.
○ Main Memory.
○ Control Memory.
● The main memory is available to the user for storing the programs.
● The contents of main memory may alter when the data are manipulated and every time that the program is
changed.
● A memory that is part of a control unit is referred to as a control memory.
● The control memory holds a fixed microprogram that cannot be altered by the user and contains various
control signals.
● The control memory can be a read-only memory (ROM) since alterations are not needed.
● Writable control memory is used in dynamic programing.
5
Microprogrammed Control Unit
● The control memory is a ROM in which all control information is permanently stored.
● The control address register specifies the address of the microinstruction
● Control data register holds the microinstruction read from memory.
● The microinstruction contains a control word that specifies one or more microoperations for the data
processor.
● The next address is computed in the next address generator(sequencer) and then transferred into the
control address register to read the next microinstruction.
● The control data register(pipeline register) holds the present microinstruction while the next address is
computed and read from memory.
6
Address Sequencing
7
Address Sequencing
● Microinstructions are stored in control memory in groups, with each group specifying a routine.
● Each computer instruction has its own microprogram routine in control memory to generate the
microoperations that execute the instruction.
● The hardware that controls the address sequencing must be capable of sequencing the microinstructions
within a routine and be able to branch from one routine to another.
8
Executing a Single Instruction
9
In brief, the address sequencing capabilities required in a
control memory
10
Incrementing CAR
● The incrementer increments the content of the
control address register by one, to select the next
microinstruction in sequence.
Conditional Branching
● Branch logic provides decision-making capabilities in
the control unit.
● The status bits, together with the field in the
microinstruction that specifies a branch address,
control the conditional branch decisions
● Simplest way to implement branch logic is to test
the specified condition and branch to an address if
the condition is met; else increment the address
register.
11
Mapping of Instruction
● A special type of branch instruction.
● Here a branching is done to the first word in control memory where a microprogram routine for an instruction
is located.
● The status bits for this branch are the bits in the operation code of the instruction.
● Can be implemented using ROM.
● The bits of the instruction specify the address of a mapping ROM.
● The contents of the mapping ROM give the bits for the control address register.
● This concept provides flexibility for adding instructions for control memory as the need arises.
12
Subroutines
● Programs that are used by other routines to accomplish a particular task.
● Microinstructions can be saved by employing subroutines that use common sections of microcode.
● Must have a provision for storing the return address during a subroutine call and restoring the address during
a subroutine return.
● This may be accomplished by placing the incremented address from the control address register into a
subroutine register and branching to the beginning of the subroutine.
● The subroutine register can then become the source for transferring the address for the return to the main
routine.
13
Microprogram Example
14
Microinstruction Format
15
Microinstruction Field Description
16
Microinstruction Field Description
CD Condition Symbol Comments BR Symbol Function
17
Symbolic Microinstructions
● Symbolic microprogram can be translated into its binary equivalent by means of an assembler.
● Each symbolic microinstruction is divided into five fields
○ Label
○ Microoperations
○ CD
○ BR
○ AD
● The label field may be empty or it specify a symbolic address.
● It is terminated with a colon (:)
● The microoperations field consists of one, two, or three symbols, separated by commas.
There may be no more than one symbol from each F field.
The NOP symbol is used when the microinstruction has no microoperations.
18
Symbolic Microinstructions
19
The Fetch Routine
20
Design of Control Unit
21
● Bits of the microinstruction are usually divided into
fields, with each field defining a separate function.
(F1-F2-F3, CD, BR,AD)
● Each field requires a decoder to produce the
corresponding control signals.
● Each of the three fields of the microinstruction
presently available in the output of control memory
are decoded with a 3x8 decoder to provide eight
outputs.
● Each of these outputs must be connected to the
proper circuit to initiate the corresponding
microoperation.
22
Microprogram Sequencer
● The basic components of microprogrammed control unit are the control memory and the circuits that select
the next address.
● The address selection part is called as microprogram sequencer.
● Microprogram sequencer can be constructed with digital functions to suit a particular application.
● Two imp. factors that must be considered while designing the microinstruction sequencer:
○ The size of the microinstruction.
○ The address generation time.
● The purpose of microprogram sequencer is to present an address to the control memory so that a
microinstruction may be read and executed.
● The next address logic of the sequencer determines the specific address source to be loaded into the CAR.
● The choice of the address source is guided by the next address information bits that the sequencer receives
from address information bits that the sequencer receives from the present microinstruction.
23
www.teachics.org
24