36
William Stallings William Stallings Computer Organization and Architecture and Architecture 7 th Edition Chapter 17 Micro-programmed Control

William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Embed Size (px)

Citation preview

Page 1: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

William Stallings William Stallings Computer Organization and Architectureand Architecture7th Edition

Chapter 17pMicro-programmed Control

Page 2: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Control Unit Organizationg

Page 3: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Micro-programmed Controlp g• Use sequences of instructions (see earlier

notes) to control complex operationsnotes) to control complex operations• Called micro-programming or firmware

Page 4: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Implementation (1)p ( )• All the control unit does is generate a set

of control signalsof control signals• Each control signal is on or off• Represent each control signal by a bit• Have a control word for each micro-a e a co t o o d o eac c o

operation• Have a sequence of control words for each • Have a sequence of control words for each

machine code instruction• Add an address to specify the next micro• Add an address to specify the next micro-

instruction, depending on conditions

Page 5: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Implementation (2)p ( )• Today’s large microprocessor

M i t ti d i t d i t l l —Many instructions and associated register-level hardwareMany control points to be manipulated—Many control points to be manipulated

• This results in control memory that—Contains a large number of words

– co-responding to the number of instructions to be executedexecuted

—Has a wide word width – Due to the large number of control points to be Due to the large number of control points to be

manipulated

Page 6: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Micro-program Word LengthMicro program Word Length

• Based on 3 factorsM i b f i lt i—Maximum number of simultaneous micro-operations supportedThe way control information is represented or —The way control information is represented or encoded

—The way in which the next micro-instruction —The way in which the next micro-instruction address is specified

Page 7: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Micro-instruction Typesyp• Each micro-instruction specifies single (or

few) micro operations to be performedfew) micro-operations to be performed— (vertical micro-programming)

f• Each micro-instruction specifies many different micro-operations to be

f d ll lperformed in parallel—(horizontal micro-programming)

Page 8: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Vertical Micro-programmingVertical Micro programming

• Width is narrowl l d d l b• n control signals encoded into log2 n bits

• Limited ability to express parallelism• Considerable encoding of control

information requires external memory o at o equ es e te a e o yword decoder to identify the exact control line being manipulatedb g a pu a d

Page 9: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Horizontal Micro-programmingHorizontal Micro programming

• Wide memory wordh d f ll l bl• High degree of parallel operations possible

• Little encoding of control information

Page 10: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Typical Microinstruction Formatsyp

Page 11: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Compromisep• Divide control signals into disjoint groups

l h f ld• Implement each group as separate field in memory word

• Supports reasonable levels of parallelism without too much complexity

Page 12: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Organization ofControl Memoryy

Page 13: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Control Unit

Page 14: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Control Unit Function• Sequence login unit issues read command• Word specified in control address register is read • Word specified in control address register is read

into control buffer register• Control buffer register contents generates control • Control buffer register contents generates control

signals and next address information• Sequence login loads new address into control Sequence login loads new address into control

buffer register based on next address information from control buffer register and ALU flags

Page 15: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Next Address Decision• Depending on ALU flags and control buffer

registerregister—Get next instruction

Add 1 t t l dd i t– Add 1 to control address register—Jump to new routine based on jump

microinstructionmicroinstruction– Load address field of control buffer register into

control address register—Jump to machine instruction routine

– Load control address register based on opcode in IR

Page 16: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Functioning of Microprogrammed Control Unit

Page 17: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Wilkes Control• 1951

ll f ll d h d d• Matrix partially filled with diodes• During cycle, one row activated

—Generates signals where diode present—First part of row generates controlp g—Second generates address for next cycle

Page 18: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Wilkes's Microprogrammed Control Unitp g

Page 19: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Advantages and Disadvantages of Microprogrammingp g g• Simplifies design of control unit

Ch—Cheaper—Less error-prone

• Slower

Page 20: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Tasks Done By Microprogrammed Control Unit• Microinstruction sequencing• Microinstruction execution• Must consider both together

Page 21: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Design Considerationsg• Size of microinstructions

dd• Address generation time—Determined by instruction register

– Once per cycle, after instruction is fetched—Next sequential address

C i d i d– Common in most designed—Branches

Both conditional and unconditional– Both conditional and unconditional

Page 22: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Sequencing Techniquesq g q• Based on current microinstruction,

condition flags contents of IR control condition flags, contents of IR, control memory address must be generated

d f f dd i f i• Based on format of address information—Two address fields—Single address field—Variable format

Page 23: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Branch Control Logic: Two Address Fields

Page 24: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Branch ControlLogic: Single Logic: Single Address Field

Page 25: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Branch Control Logic: Variable Logic: Variable Format

Page 26: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Address GenerationExplicit Implicit

Two-field Mapping

Unconditional Branch Addition

Conditional branch Residual control

Page 27: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Execution• The cycle is the basic event

h l d f• Each cycle is made up of two events—Fetch

– Determined by generation of microinstruction address

—Execute—Execute

Page 28: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Execute• Effect is to generate control signals

S l l• Some control points internal to processor• Rest go to external control bus or other

interface

Page 29: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Control Unit Organizationg

Page 30: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

A Taxonomy of Microinstructionsy• Vertical/horizontal

k d/ k d• Packed/unpacked• Hard/soft microprogramming• Direct/indirect encoding

Page 31: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Improvements over Wilkesp• Wilkes had each bit directly produced a

control signal or directly produced one bit control signal or directly produced one bit of next address

l dd i• More complex address sequencing schemes,

• using fewer microinstruction bits, are possible

• Require more complex sequencing logic module

• Control word bits can be saved by encoding and subsequently decoding encoding and subsequently decoding control information

Page 32: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

How to Encode• K different internal and external control signals • Wilkes’s:

— K bits dedicated — 2K control signals during any instruction cycle

• Not all used• Not all used— Two sources cannot be gated to same destination— Register cannot be source and destination

Only one pattern presented to ALU at a time— Only one pattern presented to ALU at a time— Only one pattern presented to external control bus at a time

• Require Q < 2K which can be encoded with log2Q < K bits• Not done

— As difficult to program as pure decoded (Wilkes) scheme— Requires complex slow control logic module

• Compromises— More bits than necessary used— Some combinations that are physically allowable are not Some combinations that are physically allowable are not

possible to encode

Page 33: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Specific Encoding Techniquesp g q• Microinstruction organized as set of fields

h f ld d• Each field contains code• Activates one or more control signals• Organize format into independent fields

—Field depicts set of actions (pattern of control Field depicts set of actions (pattern of control signals)

—Actions from different fields can occur simultaneously

• Alternative actions that can be specified pby a field are mutually exclusive—Only one action specified for field could occur O y o e act o spec ed o e d cou d occu

at a time

Page 34: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Microinstruction EncodingDirect Encodingg

Page 35: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Microinstruction EncodingIndirect Encodingg

Page 36: William Stallings Computer Organization and Architecture ...5thsemesternotes.yolasite.com/resources/CAO/CAO Chapter - 17.pdf · William Stallings Computer Organization and Architecture

Required Readingq g• Stallings chapter 17