0% found this document useful (0 votes)
105 views7 pages

Chapter 5 - CO - BIM - III PDF

The document discusses microprogrammed control in computers. It describes that a microprogrammed computer has two memories: main memory for user programs and control memory for the microprogram. The microprogram consists of microinstructions stored in control memory. Each machine instruction initiates a series of microinstructions. Address sequencing logic determines the next microinstruction address through incrementing, branching, or mapping the instruction code. Subroutines can be used to reduce the size of microprograms.

Uploaded by

Bhola Shroff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views7 pages

Chapter 5 - CO - BIM - III PDF

The document discusses microprogrammed control in computers. It describes that a microprogrammed computer has two memories: main memory for user programs and control memory for the microprogram. The microprogram consists of microinstructions stored in control memory. Each machine instruction initiates a series of microinstructions. Address sequencing logic determines the next microinstruction address through incrementing, branching, or mapping the instruction code. Subroutines can be used to reduce the size of microprograms.

Uploaded by

Bhola Shroff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Chapter 5 – Microprogrammed Control

Chapter 5
Microprogrammed Control
The function of the control unit in a digital computer is to initiate sequences of microoperations. The number of
different types of rnicrooperations 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.
A computer that employs a microprogrammed control unit will have two separate memories: a main memory
and a control memory.

5.1 Control Memory


Control Memory (Control Storage: CS): Storage in the microprogrammed control unit to store the
microprogram.

Control word: It is a string of control variables (0’s and 1’s) occupying a word in control memory.

Microprogram
 Program stored in control memory that generates all the control signals required to execute the instruction
set correctly
 Consists of microinstructions

Microinstruction
 Contains a control word and a sequencing word
 Control Word – contains all the control information required for one clock cycle
 Sequencing Word - Contains information needed to decide the next microinstruction address

Microoperation
 A microinstruction contains one or more microoperations to be completed.

Writable Control Memory (Writable Control Storage: WCS)


 CS whose contents can be modified:
 Microprogram can be changed
 Instruction set can be changed or modified
A computer that employs a microprogrammed control unit will have two separate memories: main memory and
a control memory. The user’s program in main memory consists of machine instructions and data whereas
control memory holds a fixed microprogram that cannot be altered by the user. Each machine instruction
initiates a series of microinstructions in control memory.
The general configuration of a microprogrammed control unit is demonstrated in the following block diagram:

Fig: Microprogrammed control organization


By Deep Raj Bhujel Page 1
Chapter 5 – Microprogrammed Control

Dynamic Microprogramming
 Computer system whose control unit is implemented with a microprogram in WCS.
 Microprogram can be changed by a systems programmer or a user.

Sequencer: The device or program that generates address of next microinstruction to be executed is called
sequencer. 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.

The location of the next microinstruction may be the one next in sequence, or it may be located somewhere else
in the control memory. 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.

Control Address Register: CAR contains address of microinstruction.

Control Data Register: CDR contains microinstruction read from memory. The microinstruction contains a
control word that specifies one or more microoperations. 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.

5.2 Address Sequencing


Each computer instruction has its own microprogram routine in control memory to generate the microoperations
that execute the instruction. Process of finding address of next microinstruction to be executed is called address
sequencing. The address sequencing capabilities required in a control memory are:
i. Incrementing of the control address register.
ii. Unconditional branch or conditional branch, depending on status bit conditions.
iii. A mapping process from the bits of the instruction to an address for control memory.
iv. A facility for subroutine call and return.

Following is the block diagram for control memory and the associated hardware needed for selecting the next
microinstruction address.

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.

Control address register receives address of next microinstruction from different sources.
 Incrementer simply increments the address by one
 In case of branching, branch address is specified in one of the field of microinstruction.
 In case of subroutine call, return address is stored in the register SBR which is used when returning from
called subroutine.

By Deep Raj Bhujel Page 2


Chapter 5 – Microprogrammed Control

Fig: Block diagram of address sequencer.

Conditional Branch
Simplest way of implementing branch logic hardware is to test the specified condition and branch to the
indicated address if condition is met otherwise address resister is simply incremented. If Condition is true,
hardware set the appropriate field of status register to 1. Conditions are tested for O (overflow), N (negative), Z
(zero), C (carry), etc.

Unconditional Branch
Fix the value of one status bit at the input of the multiplexer to 1. So that, branching can always be done.

Mapping
Assuming operation code of 4-bits which can specify 16 (24) distinct instructions. Assume further and control
memory has 128 words, requiring an address of 7-bits. Now we have to map 4-bit operation code into 7-bit
control memory address. Thus, we have to map Op-code of an instruction to the address of the Microinstruction
which is the starting microinstruction of its subroutine in memory.

Direct mapping:
Directly use op-code as address of Control memory

By Deep Raj Bhujel Page 3


Chapter 5 – Microprogrammed Control

Address
OP-codes of Instructions 0000 ADD Routine
ADD 0000 AND Routine
0001
LDA Routine
AND 0001 . 0010 STA Routine
LDA 0010 BUN Routine
0011
STA
.
0011 0100 Control
BUN
0100
. Storage

Another approach of direct mapping:


Transfer Op-code bits to use it as an address of control memory. In this mapping, one 0 is placed in the MSB
and two 0s in the LSB as shown in figure:

Fig: mapping from instruction code to


microinstruction address

Extended idea: Mapping function implemented by ROM or PLD (Programmable Logic Device)
Use op-code as address of ROM where address of control memory is stored and then use that address as an
address of control memory. This provides flexibility to add instructions for control memory as the need arises.
OPCODE Mapping memory (PLD) Control Address Register Control Memory

Subroutines
Subroutines are programs that are used by another program to accomplish a particular task. Microinstructions
can be saved by employing subroutines that use common sections of micro code.
Example: the sequence of microoperations needed to generate the effective address is common to all memory
reference instructions. Thus, this sequence could be a subroutine that is called from within many other routines
to execute the effective address computation.
Subroutine register is used to save a return address during a subroutine call which is organized in LIFO (last in,
first out) stack.

5.3 Microprogram Example


Once the configuration of a computer and its microprogrammed control unit is established, the designer’s task is
to generate the microcode for the control memory. This code generation is called microprogramming and is a
process similar to conventional machine language programming.

Computer Configuration
 It consists of two memory units: a main memory for storing instructions and data, and a control memory for
storing the microprogram.

By Deep Raj Bhujel Page 4


Chapter 5 – Microprogrammed Control

Fig: computer hardware organization


 Four registers are associated with the processor unit and two with the control unit. The processor registers
are PC, AR, DR and AC.
 The control unit has control address register CAR and subroutine register SBR.
 The transfer of information among the registers in processor is done through multiplexer rather than a
common bus. DR can receive information from AC, PC or memory. AR can receive information from PC
or DR. PC can receive information only from AR.
 The arithmetic, logic and shift unit performs microoperations with data from AC and DR and places the
result in AC. Note that memory receives its address from AR. Input data written to memory come from DR,
and data read from memory can go only to DR.
 The computer instruction format has three fields: a 1-bit field for indirect addressing symbolized by I, a 4-
bit operation code (op-code), and an 11-bit address field. The figure below lists four of the 16 possible
memory reference instructions.

By Deep Raj Bhujel Page 5


Chapter 5 – Microprogrammed Control

Fig: computer instructions


 The ADD instruction adds the content of the operand found in the effective address to the content of AC.
 The BRANCH instruction causes a branch to the effective address if the operand in AC is negative. The
program proceeds with the next consecutive instruction if AC is not negative. The AC is negative if its sign
bit is a 1.
 The STORE instruction transfers the content of AC into the memory word specified by the effective
address.
 The EXCHANGE instruction swaps the data between AC and the memory word specified by the effective
address.

Microinstruction Format and Description


We know the computer instruction format (explained in previous chapter) for different set of instruction in main
memory. Similarly, microinstruction in control memory has 20-bit format divided into 4 functional parts as
shown below.

Fig: Microinstruction code format (20 bits)

F1, F2, F3: Microoperation fields


CD: Condition for branching
BR: Branch field
AD: Address field

Each microoperation below is defined using resister transfer statements and is assigned a symbol for use in
symbolic microprogram.

By Deep Raj Bhujel Page 6


Chapter 5 – Microprogrammed Control

Description of CD Description of BR

CD (condition) field consists of two bits representing 4 status bits and BR (branch) field (2-bits) used together
with address field AD, to choose the address of the next microinstruction.
Microinstruction fields (F1, F2, F3)

Here, microoperations are subdivided into three fields of 3-bits each. These 3 bits are used to encode 7 different
microoperations. No more than 3 microoperations can be chosen for a microinstruction, one for each field. If
fewer than 3 microoperations are used, one or more fields will contain 000 for no operation.
E.g. the Fetch Routine

Microinstructions for Fetch routine

Assembly language convention

Binary microprogram

By Deep Raj Bhujel Page 7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy