Chapter 11: Microprogrammed Control
Computer Architecture
and Organization
Department of Electrical and Computer Engineering
Control Unit Organization
Computer Architecture and Organization 2
Micro-programmed Control
• Use sequences of instructions to control complex
operations
• Called micro-programming or firmware
• The set of micro-instruction is stored in the control memory.
• The control address register contains the address of the
next micro-instruction.
• When micro-instruction is read from the control memory it
is transferred to a control buffer register.
• Reading a micro-instruction from control memory is the
same as executing that micro-instruction.
Computer Architecture and Organization 3
Implementation(1)
• For each micro-operation, all the control unit is allowed to
do is generate a set of control signals.
• If we could construct a control word in which each bit
represents one control line.
• Then each micro-instruction would be represented by
different pattern of 1s and 0s in the control word.
• Sequence of control words represent the sequence of
micro-operations.
• Add an address to specify the next micro-instruction,
depending on conditions
• Also add a few bit to specify the condition.
Computer Architecture and Organization 4
Implementation(1)
• The result is know as a horizontal micro-instruction.
Computer Architecture and Organization
5
Horizontal Micro-instruction
• There is one bit for each internal processor control line and
for each system bus control line.
• There is a condition field indicating the condition under
which there should be a branch.
• There is a field with the address of micro-instruction to be
executed next when branch is taken.
Computer Architecture and Organization
6
Horizontal Micro-instruction
• Horizontal micro-instruction interpreted as follow
1. To execute this micro-instruction, turn on all the
control line indicated by a 1 bit and leave off all control
lines indicated by a 0 bit.
• The resulting control signal will cause one or more
micro-instruction
2. If the condition indicated by the condition bit is false,
execute the next micro-instruction in sequence.
3. If the condition indicated by the condition bit is true,
the next micro-instruction to be executed is indicated
in the address field.
Computer Architecture and Organization
7
Organization of
Control Memory
Computer Architecture and Organization 8
Organization of Control Memory
• Shows how those control words or micro-instructions could
be arranged in a control-memory.
• The micro-operation in each routine are to be executed
sequentially.
• Each routine ends with a branch or jump instruction
indicating where to go next.
• There is a special execute cycle routine that signify one of
the machine instruction routine (like ADD, AND ..so on) to
be executed depending on the current opcode.
Computer Architecture and Organization
9
Organization of Control Memory
• The control memory is a concise description of the complete
operation of the control unit.
• It defines the sequence of micro-operations to be performed
during each cycle
• (fetch, indirect, executed, interrupt)
• Specifies the sequence of those cycle.
• It a way of implementing the control unit by simply executing
those program.
Computer Architecture and Organization
10
Implementation(2)
• Vertical micro-instruction
Computer Architecture and Organization
11
Vertical micro-instruction
• In a vertical micro-instruction, a code is used for each
action to be performed.
• E.g. MAR (PC)
• The decoder translate this code into individual control
signals.
• The advantage of vertical micro-instruction is that they are
more compact (fewer-bit) than the horizontal micro-
instruction
• Their disadvantage is they need additional logic and have
time delay.
Computer Architecture and Organization 12
Functioning of Microprogrammed
Control Unit
Computer Architecture and Organization 13
Functioning of Microprogrammed Control Unit
• Sequence logic unit issues read command
• Word specified in control address register is read into
control buffer register
• Control buffer register contents generates control signals
and next address information.
• Sequence logic loads new address into control buffer
register based on next address information from control
buffer register and ALU flags
Computer Architecture and Organization
14
Next Address Decision
• At the end of each micro-instruction the sequencing logic
loads a new address to the control address register.
• Depending on ALU flags and control buffer register, the
next micro-instruction could be:
• Get next instruction
• Add 1 to control address register
• Jump to new routine based on jump microinstruction
• Load address field of control buffer register into control address
register
• Jump to machine instruction routine
• Load control address register based on opcode in IR
Computer Architecture and Organization 15
Functioning of Microprogrammed Control Unit
• The previous figure shows two decoders
• The upper decoder translates the opcode of the IR into a
control memory address.
• The lower decoder is used for vertical micro-instruction.
• In vertical micro-instruction format , a code is used for each action
to be performed and the decoder translates this code into
individual control signals.
Computer Architecture and Organization
16
Wilkes Control
• Wilkes first proposed the use of micro-programmed
control unit in1951
• The heart of the system is a matrix partially filled with
diodes.
• During a machine cycle, one row of matrix is activated
with a pulse.
• This generate a signal where diode presents (indicated by a
dote in the diagram).
• First part of row generates control signals that control the
operation of a processor.
• Second part generates address of the row to be pulsed in the
next cycle.
• Thus each row of matrix is one micro-instruction and the layout
of the matrix is the control memory.
Computer Architecture and Organization 17
Wilkes's Microprogrammed Control Unit
Computer Architecture and Organization 18
Advantages and Disadvantages of
Microprogramming
• Simplifies design of control unit
• Cheaper
• Less error-prone to implement.
• Slower than a hardwired unit of comparable technology.
• Dominant technique for implementing control units in pure
CISC architectures, due to its ease of implementation.
• RISC processors, with their simpler instruction format,
typically use hardwired control units.
Computer Architecture and Organization 19
Tasks Done By Microprogrammed Control Unit
• Microinstruction sequencing :- Get the next
microinstruction from the control memory.
• Microinstruction execution : -Generate the control signals
needed to execute the microinstruction.
• In designing a control unit, these two tasks must be
considered together.
• Both affects the formats of micro-instruction and the timing of
the control unit.
Computer Architecture and Organization 20
Design Considerations
• Two concerns involved in the design of microinstruction
sequencing technique:
1. Size of microinstructions
• Minimize the size of the control memroy ,
• Reduce the cost of the component
2. Address generation time
• Execute microinstructions as fast as possible.
Computer Architecture and Organization 21
Address of the Next Microinstruction
• In executing a microprogram, the address of the next
microinstruction to be executed is in one of these
categories:
1. Determined by instruction register
• Once per cycle, after instruction is fetched
2. Next sequential address
• Common in most designed
3. Branches
• Both conditional and unconditional
Computer Architecture and Organization
22
Sequencing Techniques
• Based on current micro-instruction, condition flags and
content of IR, control memory address must be generated
for the next micro-instruction.
• A wide variety of techniques have been used.
• Based on the format of the address information in the
micro-instruction, We can group them into three general
categories.
1. Two address fields
2. Single address field
3. Variable format
Computer Architecture and Organization 23
Branch Control Logic:
Two Address Fields
Computer Architecture and Organization 24
Two address field
• The simplest approach is to provide two address field in
each micro-instructions.
• A multiplexer is provided that serve as a destination for
both address fields and the instruction register.
• Based on the address selection input the multiplexer
transmit either the op-code or one of the two address to the
control address register.
• The branch logic module has inputs from flags and from
the control portion of the micro-instruction.
Computer Architecture and Organization 25
Branch Control
Logic: Single
Address Field
Computer Architecture and Organization 26
Single address field
• A common approach.
• This approach reduce the number of address filed to one.
• In this approach, the option for next address are:
• Address filed
• Instruction register code
• Next sequential address.
• The address selection signal determine which option is
selected.
Computer Architecture and Organization
27
Branch Control
Logic: Variable
Format
Computer Architecture and Organization 28
A variable format
• This format support two different micro-instruction formats.
• One bit designates which format is being used.
• In first format, the remaining all bits are used as active
control signal.
• The next address is either the next sequential address or an address
derived form the instruction register.
• In second format, some bit drive the branch logic module
and the remaining bit provide the address.
• In this format either conditional or unconditional branch is specified.
• One disadvantage of this approach is that one entire cycle is
consumed with each branch micro-instruction.
• With the other approaches, address generation occurs as part of the
same cycle as control signal generation, minimizing control memory
access.
Computer Architecture and Organization
29
Address Generation
• Another sequencing factor is, the various way in which the
next address can be derived or computed.
• They can be explicit or implicit techniques-
• Explicit technique:
• In this technique address is available in micro-instruction.
• Implicit technique:
• Which require additional logic to generate the address.
Computer Architecture and Organization
30
Address Generation
Explicit Implicit
Two-field Mapping
Unconditional Branch Addition
Conditional branch Residual control
Computer Architecture and Organization 31
Execution
• The microinstruction cycle is the basic event
• Each cycle is made up of two events
• Fetch
• Determined by generation of microinstruction
address
• Execute
Computer Architecture and Organization 32
Execute
• Effect of the execution of a microinstruction is is to
generate control signals
• Some these signals control points internal to processor
• Rest signals go to external control bus or other interface
Computer Architecture and Organization 33
Control Unit
Organization
Computer Architecture and Organization 34
A Taxonomy of Microinstructions
• Microinstructions can be classified in a variety of ways :
• Vertical/horizontal
• Packed/unpacked
• Hard/soft microprogramming
• Direct/indirect encoding
Computer Architecture and Organization 35
Improvements over Wilkes
• In the original proposal by Wilkes each bit directly produced
a control signal or directly produced one bit of next address
• We have seen more complex address sequencing
schemes, using fewer microinstruction bits, are possible.
• These schema require more complex sequencing logic
module.
• A similar sort of trade-off exists for the portion of the
microinstruction concerned with control signals.
• By encoding control information, and subsequently
decoding it to produce control signals, control word bits can
be saved.
Computer Architecture and Organization 36
How to Encode
• Consider K different internal and external control signals
• Wilkes’s:
• K bits dedicated
• One bit for each control signal.
• 2𝑘 possible combination of control signals during any instruction
cycle
• But we can do better than this if we observe that not all the
possible combinations will be used.
• Example:
• Only one pattern presented to ALU at a time.
• Only one pattern presented to external control bus at a time.
Computer Architecture and Organization 37
Encoding
• A pure Wilkes schema requires most bit
• Every control signal is individually controllable by the micro-
programmer.
• Encoding is done in such a way to aggregate function or
resource. So that the micro-programmer is viewing the
processor at higher, less detailed level.
• One of the use of encoding is also to prevent certain
allowable combinations.
Computer Architecture and Organization 38
From hardware point of View
• Pure unencoded format
• Needs little or no decoder logic
• A more compacted and more aggregated encoding
schema,
• Needs more complex decode logic.
• This may affect performance.
Computer Architecture and Organization 39
Specific Encoding Techniques
• In practice, microprogrammed control units are not designed
using a pure unencoded or horizontal format.
• At least some form of encoding is used to reduce control
memory width and to simplify the task of microprogramming
• Microinstruction organized as set of fields
• Each field contains code, which upon decoded and
activates one or more control signals
• It must be possible for each control signal to be activated by
at least one field.
• Consider the individual field.
• A filed consisting of L bit can contain 2𝐿 𝑐𝑜𝑑𝑒𝑠 each which can be
encoded to a different control signal pattern.
Computer Architecture and Organization 40
The Design of an Encoded Microinstruction
• Organize format into independent fields
• Field represent a set of actions (pattern of control signals)
• Actions from different fields can occur simultaneously
• Define each field such that the alternative actions that can
be specified by a field are mutually exclusive
• That is only one of the action specified for a given field could
occur at a time.
Computer Architecture and Organization
41
Approaches to Organize Microinstruction into
Fields
1. Functional and Resources
• Functional – designates fields by function type
• Resource – designate fields by resources type.
• I/0, ALU, Memory
2. Direct and indirect
• Direct – each field contains code, which upon decoding, activates
one or more signals.
• Indirect – one field is used to determine the interpretation of
another filed.
Computer Architecture and Organization
42
Microinstruction Encoding
Direct Encoding
Computer Architecture and Organization 43
Microinstruction Encoding
Indirect Encoding
Computer Architecture and Organization 44
End of Chapter 11
Computer Architecture
and Organization
Department of Electrical and Computer Engineering