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

Chapter 20 - Microprogrammed Control (9 Edition) : Luis Tarrataca

This document discusses microprogrammed control units. It begins by introducing microinstructions, which represent the basic operations of a processor as binary control words. A microprogrammed control unit processes these microinstructions by reading them from a control memory. It uses components like a control address register and control buffer register that function similar to a CPU's program counter and instruction register. Processing microinstructions allows building a control unit with simpler logic than a hardwired design, though it is slower. The document explores techniques for sequencing microinstructions, such as using two address fields to select the next instruction.

Uploaded by

Sa'uroh SiHilmy
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)
65 views

Chapter 20 - Microprogrammed Control (9 Edition) : Luis Tarrataca

This document discusses microprogrammed control units. It begins by introducing microinstructions, which represent the basic operations of a processor as binary control words. A microprogrammed control unit processes these microinstructions by reading them from a control memory. It uses components like a control address register and control buffer register that function similar to a CPU's program counter and instruction register. Processing microinstructions allows building a control unit with simpler logic than a hardwired design, though it is slower. The document explores techniques for sequencing microinstructions, such as using two address fields to select the next instruction.

Uploaded by

Sa'uroh SiHilmy
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/ 47

Chapter 20 - Microprogrammed Control (9th edition)

Luis Tarrataca
[email protected]

CEFET-RJ

Luis Tarrataca Chapter 20 - Microprogrammed Control 1 / 47


Table of Contents I

1 Motivation

2 Basic Concepts

Microinstructions

Microprogrammed Control Unit


Advantages and Disadvantages

µ-Instruction sequencing
Two address fields

Two address fields

Variable Format

µ-Instruction Execution

Luis Tarrataca Chapter 20 - Microprogrammed Control 2 / 47


Table of Contents I

3 Where to focus your study

4 Where to focus your study

Luis Tarrataca Chapter 20 - Microprogrammed Control 3 / 47


Motivation

Motivation

Remember what we talked about in the last class?

Luis Tarrataca Chapter 20 - Microprogrammed Control 4 / 47


Motivation

Remember what we talked about in the last class?

• µ-operations - the most basic instruction executed by a processor:

• Control signals - to send data from the various locations;

• Control unit operation - how to control signals and micro-operations.

Luis Tarrataca Chapter 20 - Microprogrammed Control 5 / 47


Motivation

We saw that it was possible to operate the control unit through:

• An hardwired version:
• Complete boolean circuit;

• Difficult to implement for complex systems.

• Impossible to add an instruction after implementing the circuit.

So what is the alternative? Any ideas?

Luis Tarrataca Chapter 20 - Microprogrammed Control 6 / 47


Motivation

Alternative: µ-programmed control unit

• The logic of the control unit is specified by a microprogram;


• Also known as firmware.

• A microprogram consists of a sequence of µ-operations.

Luis Tarrataca Chapter 20 - Microprogrammed Control 7 / 47


Basic Concepts Microinstructions

Microinstructions

How can we use the concept of microprogramming to implement a


control unit?

For each µ-operation:

• Control unit is allowed to generate a set of control signals;

• Each control line is either on / off;

• This state can be represented by a binary digit for each control line.

Luis Tarrataca Chapter 20 - Microprogrammed Control 8 / 47


Basic Concepts Microinstructions

Idea: construct a control word (a.k.a. µ-instruction)

• Bit represents one control line

• Each µ-op would be represented by a different pattern of 1s and 0s.

Luis Tarrataca Chapter 20 - Microprogrammed Control 9 / 47


Basic Concepts Microinstructions

Format of the µ-instruction or control word is as follows:

Figure: Microinstruction (Source: [Stallings, 2015])

• One bit for each internal processor control line;

• One bit for each system bus control line;

• Condition field indicating the condition under which there should be a branch (JMP);

• Field with the address of the µ-instruction to be executed next when a branch is taken.

Luis Tarrataca Chapter 20 - Microprogrammed Control 10 / 47


Basic Concepts Microinstructions

Such a microinstruction is interpreted as follows:

• Activate control lines indicated by a 1 bit;

• Deactivate control lines indicated by a 0 bit;

• If condition indicated by the condition bits is


• False: execute the next microinstruction in sequence;

• True: execute the instruction indicated in the address field.

Luis Tarrataca Chapter 20 - Microprogrammed Control 11 / 47


Basic Concepts Microprogrammed Control Unit

Microprogrammed Control Unit

How can we process these µ-instructions?

Processing a µ-program requires:

• Going through a sequence of µ-instructions;

• Jumping to other addresses of µ-instructions;

• I.e. normal procedure for processing instructions:


• Only difference is that these instructions are comprised of µ-operations.

Luis Tarrataca Chapter 20 - Microprogrammed Control 12 / 47


Basic Concepts Microprogrammed Control Unit

Lets take a look at one possible architecture:

Figure: Control Unit Microarchitecture (Source: [Stallings, 2015])

Luis Tarrataca Chapter 20 - Microprogrammed Control 13 / 47


Basic Concepts Microprogrammed Control Unit

• Control memory:
• Containing the set of µ-instructions;

• Control address register (CAR):


• Containing the address of the next µ-instruction to be read;

• Remember MAR?

• Control buffer register (CBR):


• Containing the µ-instruction read from the control memory;

• After µ-instruction is read it can be executed;

• Remember MBR?

• Sequencing logic:
• Loads CAR and issues a read command.

Luis Tarrataca Chapter 20 - Microprogrammed Control 14 / 47


Basic Concepts Microprogrammed Control Unit

In greater detail:

Figure: Function of microprogrammed control unit (Source: [Stallings, 2015])


Luis Tarrataca Chapter 20 - Microprogrammed Control 15 / 47
Basic Concepts Microprogrammed Control Unit

The control unit functions as follows to execute an instruction:

1 Sequencing logic unit:


• Loads an address to be read into CAR;

• Issues a READ command to the control memory;

2 Word is read into CBR;

3 Content of the CBR generates:


• Control signals for the CPU;

• Next address for the sequencing logic unit;

4 Sequencing logic unit:


• Loads a new address into the CAR;

• Based on the next-address information from the CBR and the ALU flags.

All this happens during one clock pulse.

Luis Tarrataca Chapter 20 - Microprogrammed Control 16 / 47


Basic Concepts Microprogrammed Control Unit

Does all of this sound strangely familiar? Sense of déjà vu?

Luis Tarrataca Chapter 20 - Microprogrammed Control 17 / 47


Basic Concepts Microprogrammed Control Unit

Does all of this sound strangely familiar? Sense of déjà vu?

• Similar to how control unit processed different stages of an instruction.

• Remember?
• MAR • Fetch cycle

• MBR • Indirect cycle

• PC • Interrupt cycle
• But now are doing it in a ‘‘smaller’’ scale within the control unit:
• Instead of a system-wide: processor, bus, ram...

Luis Tarrataca Chapter 20 - Microprogrammed Control 18 / 47


Basic Concepts Microprogrammed Control Unit

Advantages and Disadvantages

Main advantage of the use of µ-programming:

• Simplifies the design of the control unit;


• Both cheaper and less error prone to implement.

• Hardwired control unit must contain complex logic:


• Microprogrammed control unit components are simple pieces of logic.

Main disadvantage of a µ-programmed unit:

• Slower than a hardwired unit of comparable technology;

Luis Tarrataca Chapter 20 - Microprogrammed Control 19 / 47


Basic Concepts µ-Instruction sequencing

µ-Instruction sequencing

Tasks performed by a microprogrammed control unit are:

• µ-instruction sequencing:
• Get next µ-instruction from the control memory.

• µ-instruction execution:
• Generate control signals needed to execute the µ-instruction.

Lets focus on the first one.

Luis Tarrataca Chapter 20 - Microprogrammed Control 20 / 47


Basic Concepts µ-Instruction sequencing

Address of next µ-instruction to be executed is:

• Determined by instruction register or;

• Next sequential address or;

• Branch (JMP).

Decision is based on:

• Current µ-instruction;

• Condition flags;

• Contents of the instruction register;

Luis Tarrataca Chapter 20 - Microprogrammed Control 21 / 47


Basic Concepts µ-Instruction sequencing

Wide variety of techniques to generate the next µ-instruction address:

• Two address fields

• Single address field

• Variable format

Luis Tarrataca Chapter 20 - Microprogrammed Control 22 / 47


Basic Concepts µ-Instruction sequencing

Two address fields

Figure: Branch Control Logic: Two Address Fields (Source: [Stallings, 2015])
Luis Tarrataca Chapter 20 - Microprogrammed Control 23 / 47
Basic Concepts µ-Instruction sequencing

Simplest approach: provide two address fields:

• Multiplex between both address fields and IR:


• Updating CAR accordingly.

• CAR is decoded to produce the next µ-instruction address;

• Branch logic module selects the address-selection signals:


• Based on control unit flags and

• Bits from the control portion of the µ-instruction.

Luis Tarrataca Chapter 20 - Microprogrammed Control 24 / 47


Basic Concepts µ-Instruction sequencing

Single address field

Luis Tarrataca
Figure: Branch Control Logic: Chapter
Single Address 20 (Source:
Field - Microprogrammed Control
[Stallings, 2015]) 25 / 47
Basic Concepts µ-Instruction sequencing

Two-address approach is simple but:

• Requires more bits in the µ-instruction than other approaches.

• Idea: Use additional logic to have only one address field;

Options for next address are as follows:

• Address field;

• IR code;

• Next sequential address (+1).

Luis Tarrataca Chapter 20 - Microprogrammed Control 26 / 47


Basic Concepts µ-Instruction sequencing

However:

Often, the address field will not be used... Can we do better? Any ideas?

Luis Tarrataca Chapter 20 - Microprogrammed Control 27 / 47


Basic Concepts µ-Instruction sequencing

Variable Format

Figure: Branch Control Logic: Variable Format (Source: [Stallings, 2015])


Luis Tarrataca Chapter 20 - Microprogrammed Control 28 / 47
Basic Concepts µ-Instruction sequencing

Provide for two entirely different microinstruction formats:

• Format 1: bits are used to activate control signals:


• Next address is either: {next sequential address, address derived from IR}.

• Format 2: some bits drive the branch logic, remaining provide address:
• Either a conditional or unconditional branch is being specified.

Luis Tarrataca Chapter 20 - Microprogrammed Control 29 / 47


Basic Concepts µ-Instruction Execution

µ-Instruction Execution

Tasks performed by a microprogrammed control unit are:

• µ-instruction sequencing:
• Get next microinstruction from the control memory.

• µ-instruction execution:
• Generate control signals needed to execute the µ-instruction.

Lets focus on the second one.

Luis Tarrataca Chapter 20 - Microprogrammed Control 30 / 47


Basic Concepts µ-Instruction Execution

From the previous classes:

Do you remember what is the function of the control unit?

Luis Tarrataca Chapter 20 - Microprogrammed Control 31 / 47


Basic Concepts µ-Instruction Execution

Remember this?

Figure: Data paths and control signals (Source: [Stallings, 2015])

Execution of a µ-instruction: generate control signals.

• Some signals control points internal to the processor;

• Other signals go to the system bus;


Luis Tarrataca Chapter 20 - Microprogrammed Control 32 / 47
Basic Concepts µ-Instruction Execution

We can now update our previous Figure 3:

Figure: Function of microprogrammed control unit (Source: [Stallings, 2015])


Luis Tarrataca Chapter 20 - Microprogrammed Control 33 / 47
Basic Concepts µ-Instruction Execution

With this one:

Figure: Control Unit Organization (Source: [Stallings, 2015])


Luis Tarrataca Chapter 20 - Microprogrammed Control 34 / 47
Basic Concepts µ-Instruction Execution

What is the difference between pictures?

First picture focused on the sequencing logic module:

• Containing logic to generate address of next µ-instruction using:


• as inputs the IR, ALU flags, CAR, CBR.

• Driven by a clock that determines the timing of the µ-instruction cycle.

Second picture introduces control logic module:

• Generates control signals as a function of the µ-instruction;

Luis Tarrataca Chapter 20 - Microprogrammed Control 35 / 47


Basic Concepts µ-Instruction Execution

Control signals can be transmitted in various ways (1/2):

• K control signals:
• Can be controlled using K lines, allowing for 2k possibilities;

• Not all of these possibilities are valid, e.g.:


• Two sources cannot be gated to the same destination;
• A register cannot be both source and destination;
• Only one pattern of control signals can be presented to the ALU at a time.
• Only one pattern of control signals can be presented to the external control
bus at a time.

• We can do better than this...

Luis Tarrataca Chapter 20 - Microprogrammed Control 36 / 47


Basic Concepts µ-Instruction Execution

Control signals can be transmitted in various ways (2/2):

• Let Q represent all allowable combinations of control signals:


• Possible combinations: Q with Q < 2K possibilities;

• We can encode these Q combinations using log2 Q bits;

• Therefore log2 Q < 2K

Luis Tarrataca Chapter 20 - Microprogrammed Control 37 / 47


Basic Concepts µ-Instruction Execution

Advantages / Disadvantages:

• Unencoded format:
• Advantage:
• Little or no decode logic is needed;
• Each bit generates a particular control signal.

• Disadvantage:
• Requires more bits than necessary.

• Encoded format:
• Advantage:
• Requires less bits.

• Disadvantage:
• Requires complex logic to encode / decode resulting in loss of performance.

Luis Tarrataca Chapter 20 - Microprogrammed Control 38 / 47


Basic Concepts µ-Instruction Execution

Example (1/5)

Assume a processor with:

• Single accumulator register;

• Several internal registers:


• Such as a program counter and a temporary register for ALU input.

• Instruction format where:


• First 3 bits indicate the type of operation;

• Next 3 encode the operation;

• Final 2 select an internal register

Luis Tarrataca Chapter 20 - Microprogrammed Control 39 / 47


Basic Concepts µ-Instruction Execution

Example (2/5)

Figure: Simple register transfers (Source: [Stallings, 2015])

Luis Tarrataca Chapter 20 - Microprogrammed Control 40 / 47


Basic Concepts µ-Instruction Execution

Example (3/5)

Figure: Memory Operations (Source: [Stallings, 2015])

Luis Tarrataca Chapter 20 - Microprogrammed Control 41 / 47


Basic Concepts µ-Instruction Execution

Example (4/5)

Figure: Special sequencing operations (Source: [Stallings, 2015])

* CSAR = channel system address register, special register for controlling bus
lines that exists in some processors.

Luis Tarrataca Chapter 20 - Microprogrammed Control 42 / 47


Basic Concepts µ-Instruction Execution

Example (5/5)

Figure: ALU operations (Source: [Stallings, 2015])


Luis Tarrataca Chapter 20 - Microprogrammed Control 43 / 47
Where to focus your study

Where to focus your study (1/2)

After this class you should be able to understand that:

• Execution of an instruction involves the execution of substeps:


• Each cycle is in turn made up of µ-operations;

• Control unit causes the processor to go through a series of µ-operations:


• in the proper sequence;

• and generating the appropriate control signals;

Luis Tarrataca Chapter 20 - Microprogrammed Control 44 / 47


Where to focus your study

Where to focus your study (2/2)

After this class you should be able to understand that:

• Alternative to a hardwired control unit is a µ-programmed control unit:


• logic is specified by a µ-program:
• which consists of a sequence µ-operations.

• µ-programmed control unit is a simple logic circuit capable of:


• sequencing through µ-instructions;

• generating control signals to execute each µ-instruction.

• As in a hardwired control unit:


• Control signals generated by a µ-instruction are used to cause register
transfers and ALU operations.

Luis Tarrataca Chapter 20 - Microprogrammed Control 45 / 47


Where to focus your study

Less important to know how these solutions were implemented:

• details of specific hardware solutions.

Your focus should always be on the building blocks for developing a solution
=)

Luis Tarrataca Chapter 20 - Microprogrammed Control 46 / 47


References

References I

Stallings, W. (2015).

Computer Organization and Architecture.

Pearson Education.

Luis Tarrataca Chapter 20 - Microprogrammed Control 47 / 47

You might also like