MicroProgram Sequencer
MicroProgram Sequencer
This document presents an overview on how the Microprogram Sequencer works, how
the instruction opcode is used to send out the control signals to various parts of the
processor - the registers, the program counter, stack pointer, ALU etc.
Introduction
1. Control Signal It refers to the signal sent to a component (Register,ALU) to do a specific job.
2. Micro-instruction The control signals are combined into control words, where each bit of the
1
Now, A micro-program sequencer works in a way to generate these control signals from the mi-
croprogram by transitioning from one state to another in every clock cycle. A state is defined by the
micro-instruction that has to be run in that clock cycle.It has two main functions
1. Control Function The micro-operations that need to be executed to perform a certain micro-
instruction are to be defined and be known. The micro-operation(s) are dependent on parameters
in every clock cycle and determines which micro-instruction (state) to run next. It can be thought in terms
of a state diagram.
2
Work Flow
The Instruction Register loads the opcode into the decoder which then translates the opcode into a
control memory address. The control address register contains the address of the next micro-instruction
to be read.
The micro-instructions are stored in the microprogram memory (also called control memory, can be
used interchangeably). The address from the control address register is used to read from this micropro-
gram memory.
When a micro-instruction is read from the microprogram memory, it is transferred to the control buffer
I know you can see another decoder between the Control Buffer Register before the signals are sent.
3
Figure 2: The various addresses referred can get confusing.
Thus, reading a micro-instruction from the microprogram memory has the effect of executing that
micro-instruction.
The sequencing logic loads the control address register and activates the read signal. This read signal
loads the next micro-instruction from the Instruction Register completing a cycle.
Rather than storing the micro instructions in the ROM, if we would use Flash Memory or RAM,
then the design has a Writable Control Memory. This has benefits including the ease of patching the
microprogram and, for certain hardware generations, faster access than ROMs could provide. User-
programmable Writable Control Memory allows the user to optimize the machine for specific purposes.
4
Horizontal and Vertical Programming
We noticed that there was another decoder in Figure 1, this is the characteristic of a type of microcode
architecture called Vertical Programming. The other variant Horizontal Programming, does not have the
decoder circuit.
In horizontal microcode architecture, each control signal is represented by a bit in the micro instruc-
tion, while in the vertical microcode architecture, a set of true signals is represented in the micro instruc-
tion in a shorter form. Thus the decoder is used to convert this shorter code into true signals.
Practically, a diagonal architecture is used, combining both horizontal and vertical programming de-
signs.
Hardwired control units are implemented through use of sequential logic units, using finite number of
gates to generate specific results based on the last and the cuurent instruction, similar to what we have
seen earlier in synchronous circuit design. Their design uses a fixed architectureit requires changes in
the wiring if the instruction set is modified or changed. Hardwired control units are generally faster than
micro-programmed designs. However they are difficult to design as the instruction set starts to grow
bigger.
Microcode simplified the job by allowing the assembly instructions to be defined via microprograms
rather than by circuitry. Even late in the design process, microprogram for an instruction could easily
be changed, whereas hard-wired CPU designs were very cumbersome to change. Thus, this greatly
5
Example - Using IIIT Processor Instruction Set Architecture
We will be taking an taking up an example code and stage by stage break it down into its components
movi r0
01
movs r0
These instructions can be broken down into, each of which will act as a state of the Microprogram
Sequencer
The SRG is generated from opcode by the I/O register, and thus is not needed to be present in the
6
The first two states are fetch in both the instructions and thus we assume here that they have been
The states are stored in the ROM have a design dependent address. Let it contain state 2.(c) at address
34, 1.(c) at address 36 and state 1.(d) at address 37. The decoder has the said mapping of the states.
The translated opcode ie, the address is fed to the Control Address Register which passes it to the ROM
Also, the sequencing logic is then activated to change the address present in the Control Address
Register to the next state. The sequencer has thus jumped to the next state 1.(d).
The RMS control that is seen in this micro-instruction clear the Micro Sequencer to the reset value (ie.
7
Figure 5: Flow of instruction 2.(a)
Coming Back to Fetch The states zero and one are maintained to be the fetch and decode micro-
instruction cycles. After RMS resets the sequencer state to zero, it again fetches the instruction in the
next cycle by -
1. At state zero, it will emit EPC LMR IPC to Load the Memory Address Register with the value of
2. Then after state zero it will go to state one and emit RD LMS LIO LIR to load the I/O Register,
Instruction Register and the Micro Sequencer with the next instruction from the memory.
8
Figure 7: Flow of instruction 2.(c)
In the example the next instruction is movs r0. Thus this instruction will cause the micro sequencer to
change to the specific state with the micro-instruction. Thus the RMS of the prev instruction will cause
How and from Where the First Fetch ? The initial state when the processor starts, is set to zero. Thus
it fetches the instruction present at [[PC]] and executes it. Also, the PC is set to zero too and hence the
9
References and Notes
http://ftp.utcluj.ro/pub/users/calceng/SSC/SSC04/SSC04-e.pdf
http://www.cs.virginia.edu/ cs333/notes/microprogramming.pdf
10