Lecture 10
Lecture 10
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
Microprogrammed Control
Mapping of Instruction
A special type of branch exists when a microinstruction specifies a branch to the first word
in control memory where a microprogram routine for instruction is located. The status bits for this
type of branch are the bits in the operation code part of the instruction. For example, a computer
with a simple instruction format as shown in Fig. 7-3 has an operation code of four bits which can
specify up to 16 distinct instructions. Assume further that the control memory has 128 words,
requiring an address of seven bits.
For each operation code, there exists a microprogram routine in control memory that
executes the instruction. One simple mapping process that converts the 4-bit operation code to a
7-bit address for control memory is shown in Fig. 7-3. This mapping consists of placing a 0 in the
most significant bit of the address, transferring the four operation code bits, and clearing the two
least significant bits of the control address register. This provides for each computer instruction a
microprogram routine with a capacity of four microinstructions. If the routine needs more than
four microinstructions, it can use addresses 1000000 through 1111111. If it uses fewer than four
microinstructions, the unused memory locations would be available for other routines.
One can extend this concept to a more general mapping rule by using a ROM to specify
the mapping function. In this configuration, 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.
In this way, the microprogram routine that executes the instruction can be placed in any desired
location in the control memory. The mapping concept provides flexibility for adding instructions
to control memory as the need arises.
-74-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
-75-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
It consists of two memory units a main memory for storing instructions and data and a
control memory for storing the Microprogram. Four registers are associated with the processor
unit and two with the control unit. The processor registers are program counter PC, address register
AR, data register DR, and accumulator register AC. The function of these registers is similar to
the basic computer. The control unit has a control address register CAR and a subroutine register
SBR.
The control memory and its registers are organized as a Microprogrammed control unit.
The transfer of information among the registers in the processor is done through multiplexers
rather than a common bus DR can receive information from AC, PC, or memory AR can receive
information from PC or DR, and PC can receive information only from AR. The arithmetic, logic,
and shift unit performs with data from AC and DR and places the result in AC. Note that memory
receives its address from AR. I/P data written to memory come from DR and data read from
memory can go only to DR.
-76-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
Microinstruction Format
The microinstruction format for the control memory is shown in Fig. below.
3 3 3 2 2 7
F1 F2 F3 CD BR AD
PC PC + 1 with F3 = 101
-77-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
Condition Field
The CD (condition) field consists of two bits which are encoded to specify four status bit
conditions as listed in Table 7-1. The first condition is always a 1, so a reference to CD = 00 (or
the symbol U) will always find the condition to be true. When this condition is used in conjunction
with the BR (branch) field, it provides an unconditional branch operation. The indirect bit I is
available from bit 15 of DR after an instruction is read from memory. The sign bit of AC provides
the next status bit. The zero value, symbolized by Z, is a binary variable whose value is equal to 1
if all the bits in AC are equal to zero. We will use the symbols U, I, S, and Z for the four status
bits when we write microprograms in symbolic form.
-78-
Computer Architecture
Baghdad University
Asst. Prof. Dr. Muna Hadi Third stage
College of Engineering
2023-2024
Electrical Engineering Department
Lecture-10
Branch Field
The BR (branch) field consists of two bits. It is used, in conjunction with the address field
AD, to choose the address of the next microinstruction. As shown in Table 7-1, when BR = 00, the
control performs a jump GMP) operation (which is similar to a branch), and when BR = 01, it
performs a call to subroutine (CALL) operation. The two operations are identical except that a call
microinstruction stores the return address in the subroutine register SBR. The jump and call
operations depend on the value of the CD field. If the status bit condition specified in the CD field
is equal to 1, the next address in the AD field is transferred to the control address register CAR _
Otherwise, CAR is incremented by 1.
The return from the subroutine is accomplished with a BR field equal to 10. This causes
the transfer of the return address from SBR to CAR. The mapping from the operation code bits of
the instruction to an address for CAR is accomplished when the BR field is equal to 11. This
mapping is depicted in Fig. 7-3. The bits of the operation code are in DR (l l-14) after an instruction
is read from memory. Note that the last two conditions in the BR field are independent of the
values in the CD and AD fields.
-79-