0% found this document useful (0 votes)
8 views

Lecture 9

The document discusses microprogrammed control in computer architecture. It describes how a control unit uses microinstructions stored in read-only memory (ROM) to execute sequences of microoperations. A microinstruction contains bits that specify microoperations and determine the address of the next microinstruction. The address register reads microinstructions from the control memory to execute microoperations based on the microprogram stored in the ROM.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture 9

The document discusses microprogrammed control in computer architecture. It describes how a control unit uses microinstructions stored in read-only memory (ROM) to execute sequences of microoperations. A microinstruction contains bits that specify microoperations and determine the address of the next microinstruction. The address register reads microinstructions from the control memory to execute microoperations based on the microprogram stored in the ROM.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Computer Architecture

Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
Microprogrammed Control
Control Memory
The function of the control unit in a digital computer is to initiate sequences of
microoperations. The number of different types of microoperations that are available in a given
system is finite. The complexity of the digital system is derived from the number of sequences of
microoperations that are performed. When the control signals are generated by hardware using
conventional logic design techniques, the control unit is said to be hardwired. Microprogramming
is a second alternative for designing the control unit of a digital computer. The principle of
microprogramming is an elegant and systematic method for controlling the microoperation
sequences in a digital computer.
The control function that specifies a microoperation is a binary variable. When it is in one binary
state, the corresponding microoperation is executed. A control variable in the opposite binary state
does not change the state of the registers in the system. The active state of a control variable may
be either the 1 state or the 0 state, depending on the application. In a bus-organized system, the
control signals that specify microoperations are groups of bits that select the paths in multiplexers,
decoders, and arithmetic logic units.
Control Word
The control unit initiates a series of sequential steps of microoperations. During any given
time, certain microoperations are to be initiated, while others remain idle. The control variables at
any given time can be represented by a string of 1's and 0's called a control word. As such, control
words can be programmed to perform various operations on the components of the system. A
control unit whose binary control variables are stored in memory is called a microprogrammed
control unit. Each word in control memory contains within it a microinstruction.

Microinstruction & Microprogram


The microinstruction specifies one or more microoperations for the system. A sequence of
microinstructions constitutes a microprogram. Since alterations of the microprogram are not
needed once the control unit is in operation, the control memory can be a read-only memory
(ROM). The content of the words in the ROM are fixed and cannot be altered by simple
programming since no writing capability is available in the ROM. ROM words are made
permanent during the hardware production of the unit. The use of a microprogram involves placing
all control variables in words of ROM for use by the control unit through successive read
operations. The content of the word in ROM at a given address specifies a microinstruction.

-67-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
Control Memory
A more advanced development known as dynamic microprogramming permits a
microprogram to be loaded initially from an auxiliary memory such as a magnetic disk. Control
units that use dynamic microprogramming employ a writable control memory. This type of
memory can be used for writing (to change the microprogram) but is used mostly for reading. A
memory that is part of a control unit is referred to as a control memory. A computer that employs
a microprogrammed control unit will have two separate memories: a main memory and a control
memory. The main memory is available to the user for storing the programs. The contents of the
main memory may alter when the data are manipulated and every time that the program is changed.
The user's program in the main memory consists of machine instructions and data. In
contrast, the control memory holds a fixed microprogram that cannot be altered by the occasional
user. The microprogram consists of microinstructions that specify various internal control signals
for the execution of register microoperations. Each machine instruction initiates a series of
microinstructions in the control memory. These microinstructions generate the microoperations to
fetch the instruction from main memory; evaluate the effective address, execute the operation
specified by the instruction, and return control to the fetch phase in order to repeat the cycle for
the next instruction. The general configuration of a microprogrammed control unit is demonstrated
in the block diagram of Fig. 7-1. The control memory is assumed to be a ROM, within which all
control information is permanently stored.

Control Memory Address Register


The control memory address register specifies the address of the microinstruction, and the
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. Once these
operations are executed, the control must determine the next address. The location of the next
microinstruction may be the one next in sequence, or it may be located somewhere else in the
control memory. For this reason, it is necessary to use some bits of the present microinstruction to
control the generation of the address of the next microinstruction. The next address may also be a
function of external input conditions.
-68-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
While the microoperations are being executed, the next address is computed in the next
address generator circuit and then transferred into the control address register to read the next
microinstruction. Thus a microinstruction contains bits for initiating microoperations in the data
processor part and bits that determine the address sequence for the control memory.
Sequencer
The next address generator is sometimes called a microprogram sequencer, as it determines
the address sequence that is read from control memory. The address of the next microinstruction
can be specified in several ways, depending on the sequencer inputs. Typical functions of a
microprogram sequencer are incrementing the control address register by one, loading into the
control address register an address from control memory, transferring an external address, or
loading an initial address to start the control operations.
Pipeline Register
The control data register holds the present microinstruction while the next address is
computed and read from memory. The data register is sometimes called a pipeline register. It
allows the execution of the microoperations specified by the control word simultaneously with the
generation of the next microinstruction. This configuration requires a two-phase clock, with one
clock applied to the address register and the other to the data register. The system can operate
without the control data register by applying a single-phase clock to the address register. The
control word and next-address information are taken directly from the control memory.
It must be realized that a ROM operates as a combinational circuit, with the address value
as the input and the corresponding word as the output. The content of the specified word in ROM
remains in the output wires as long as its address value remains in the address register. No read
signal is needed as in random-access memory. Each clock pulse will execute the microoperations
specified by the control word and also transfer a new address to the control address register. In the
example that follows we assume a single-phase clock and therefore we do not use a control data
register. In this way, the address register is the only component in the control system that receives
clock pulses. The other two components: the sequencer and the control memory are combinational
circuits and do not need a clock.
The main advantage of microprogrammed control is the fact that once the hardware
configuration is established, there should be no need for further hardware or wiring changes. If we
want to establish a different control sequence for the system, all we need to do is specify a different
set of microinstructions for control memory. The hardware configuration should not be changed
for different operations; the only thing that must be changed is the microprogram residing in the
control memory.

-69-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
Hardwired Control
It should be mentioned that most computers based on the reduced instruction set computer
(RISC) architecture concept use hardwired control rather than a control memory with a
microprogram. An example of a hardwired control for a simple computer is presented previously.

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 of the control memory must be capable of sequencing the microinstructions within a
routine and be able to branch from one routine to another. To appreciate the address sequencing in
a microprogram control unit, let us enumerate the steps that the control must undergo during the
execution of a single computer instruction. An initial address is loaded into the control address
register when power is turned on in the computer. This address is usually the address of the first
microinstruction that activates the instruction fetch routine.
The fetch routine may be sequenced by incrementing the control address register through
the rest of its microinstructions. At the end of the fetch routine, the instruction is in the instruction
register of the computer. The control memory next must go through the routine that determines the
effective address of the operand. A machine instruction may have bits that specify various
addressing modes, such as indirect address and index registers. The effective address computation
routine in control memory can be reached through a branch microinstruction, which is conditioned
on the status of the mode bits of the instruction. When the effective address computation routine
is completed, the address of the operand is available in the memory address register
Mapping
The next step is to generate the microoperations that execute the instruction fetched from
memory. The microoperation steps to be generated in processor registers depend on the operation
code part of the instruction. Each instruction has its own microprogram routine stored in a given
location of control memory. The transformation from the instruction code bits to an address in
control memory where the routine is located is referred to as a mapping process. A mapping
procedure is a rule that transforms the instruction code into a control memory address. Once the
required routine is reached, the microinstructions that execute the instruction may be sequenced
by incrementing the control address register, but sometimes the sequence of microoperations will
depend on values of certain status bits in processor registers. Microprograms that employ
subroutines will require an external register for storing the return address. Return addresses cannot
be stored in ROM because the unit has no writing capability. When the execution of the instruction
is completed, the control must return to the fetch routine.
-70-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
This is accomplished by executing an unconditional branch microinstruction to the first address of
the fetch routine. In summary, the address sequencing capabilities required in a control memory
are:
1. Incrementing of the control address register.
2. Unconditional branch or conditional branch, depending on status bit conditions.
3. A mapping process from the bits of the instruction to an address for control memory.
4. A facility for subroutine call and return

Figure 7-2 shows a block diagram of a control memory and the associated hardware needed
for selecting the next microinstruction address. The microinstruction in control memory contains
a set of bits to initiate microoperations in computer registers and other bits to specify the method
by which the next address is obtained. The diagram shows four different paths from which the
control address register (CAR) receives the address.
The incrementer increments the content of the control address register by one, to select the
next microinstruction in sequence. Branching is achieved by specifying the branch address in one
of the fields of the microinstruction. Conditional branching is obtained by using part of the
microinstruction to select a specific status bit in order to determine its condition. An external
address is transferred into control memory via a mapping logic circuit. The return address for a
subroutine is stored in a special register whose value is then used when the microprogram wishes
to return from the subroutine.

-71-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9

-72-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-9
Conditional Branching
The branch logic of Fig. 7-2 provides decision-making capabilities in the control unit. The
status conditions are special bits in the system that provide parameter information such as the
carry-out of an adder, the sign bit of a number, the mode bits of an instruction, and input or output
status conditions. Information in these bits can be tested and actions initiated based on their
condition: whether their value is 1 or 0. The status bits, together with the field in the
microinstruction that specifies a branch address, control the conditional branch decisions generated
in the branch logic. The branch logic hardware may be implemented in a variety of ways. The
simplest way is to test the specified condition and branch to the indicated address if the condition
is met; otherwise, the address register is incremented.
This can be implemented with a multiplexer. Suppose that there are eight status bit
conditions in the system. Three bits in the microinstruction are used to specify any one of eight
status bit conditions. These three bits provide the selection variables for the multiplexer. If the
selected status bit is in the 1 state, the output of the multiplexer is 1; otherwise, it is 0. A 1 output
in the multiplexer generates a control signal to transfer the branch address from the
microinstruction into the control address register.
A 0 output in the multiplexer causes the address register to be incremented. In this
configuration, the microprogram follows one of two possible paths, depending on the value of the
selected status bit. An unconditional branch microinstruction can be implemented by loading the
branch address from the control memory into the control address register. This can be
accomplished by fixing the value of one status bit at the input of the multiplexer, so it is always
equal to 1. A reference to this bit by the status bit select lines from control memory causes the
branch address to be loaded into the control address register unconditionally.

-73-

You might also like