Download - Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Transcript
Page 1: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Chapter 16Micro-programmed

Control

EEL 4709C

Alan GarciaArturo LinaresHenry Mitzler

Page 2: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

16.1 Microprogrammed Control

Basic Concepts

Page 3: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Micro-programmed Control

Use sequences of instructions to control complex operations

An alternative to a hardwired control unit

Called micro-programming, microcode, or firmware

Page 4: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Control Unit Organization

Page 5: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Implementation (1)

All the control unit does is generate a set of control signals

Each control signal is on or off

Each control signal is represented by a bit

Have a control word for each micro-operation

Have a sequence of control words for each machine code instruction

Add an address to specify the next micro-instruction, depending on conditions

Page 6: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Implementation (2)

Today’s large microprocessorMany instructions and associated register-level hardware

Many control points to be manipulated

This results in control memory thatContains a large number of words

co-responding to the number of instructions to be executed

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

manipulated

Page 7: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Micro-program Word Length

Based on 3 factorsMaximum number of simultaneous micro-operations supported

The way control information is represented or encoded

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

Page 8: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Micro-instruction Types

Each micro-instruction specifies single (or few) micro-operations to be performed(vertical micro-programming)Vertical instructions must be decoded to produce control signals.

Slower than horizontal microprogramming, but take up less memory (ROM) space.

Each micro-instruction specifies many different micro-operations to be performed in parallel(horizontal micro-programming)Requires more memory, but does requires little if any decoding.

Page 9: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Vertical Micro-programming

Width is narrow

n control signals encoded into log2 n bits

Limited ability to express parallelism

Considerable encoding of control information requires external memory word decoder to identify the exact control line being manipulated

Page 10: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Horizontal Micro-programming

Wide memory word

High degree of parallel operations possible

Little encoding of control information

Page 11: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Typical Microinstruction Formats

Page 12: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Compromise

Divide control signals into disjoint groups

Implement each group as separate field in memory word

Supports reasonable levels of parallelism without too much complexity

Page 13: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Organization ofControl Memory

Page 14: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Control Unit

Page 15: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Control Unit Function

Sequence logic unit issues read command

Word specified in control address register is read into control buffer register

Control buffer register contents generates control signals and next address information

Sequence logic loads new address into control buffer register based on next address information from control buffer register and ALU flags

Page 16: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Next Address Decision

Depending on ALU flags and control buffer registerGet next instruction

Add 1 to control address register

Jump to new routine based on jump microinstruction 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 17: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Functioning of Microprogrammed Control Unit

Page 18: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Wilkes Control

Microprogram was coined by Wilkes in the early 1950s.

1951 – Wilkes first proposed microprogrammed control.

Matrix partially filled with diodes

During cycle, one row activatedGenerates signals where diode presentFirst part of row generates controlSecond generates address for next cycle

Page 19: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Wilkes's Microprogrammed Control Unit

Page 20: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Advantages and Disadvantages of Microprogramming

Simplifies design of control unitCheaperLess error-prone

Slower than a pure hard-wired implementationRISC processors typically use hardwired control units because of their simpler instruction formats.

Bugs and Errata can be corrected by microcode updateE.g. Intel Core 2 Duo – bugs and possible security vulnerabilities resolved via microcode update

Page 21: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Advantages and Disadvantages of Microprogramming

Instructions can be easily be added with microprogramming compared with hardwired control units.

Specifying the architecture and instruction set becomes a software programming issue rather than hardware design problem.

Page 22: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Interesting Facts

The Nintendo 64’s graphics and audio co-processor (MIPS 4000 based) utilized programmable microcodeAllowed for tuning of the processor for extra speed and quality e.g. to run at 640x480.

Playstation 2’s vector processor units were microprogrammable via microcode.3D Geometry and floating point arithmetic

Microcode allows for programmers to fine-tune the processors at a below assembly code level, allows for more optimization.

Page 23: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Tasks Done By Microprogrammed Control Unit

Microinstruction sequencing

Microinstruction execution

Must consider both together

Page 24: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

17.2 Microinstruction Sequence

Page 25: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Microinstruction Sequencing

Design Considerations:

•Size of microinstruction

•Address-generation timeo Determined by instruction registerso Next sequential brancho Branch

Page 26: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Sequencing Techniques:

•Two address fields• Single address field• Address-generation time

o Determined by instruction registerso Next sequential brancho Branch

Microinstruction Sequencing

Page 27: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Branch Control Logic:Two Address Fields

Microinstruction Sequencing

Page 28: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Branch Control Logic:Single Address Field

Microinstruction Sequencing

Page 29: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Branch Control Logic:Variable Format

Microinstruction Sequencing

Page 30: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Microinstruction Address Generation Techniques:

Explicit ImplicitTwo-Field Mapping

Unconditional Branch Addition

Conditional Branch Residual Control

Microinstruction Sequencing

Page 31: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

17.3 Microinstruction Execution

Page 32: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Each cycle is made up of two eventsFetch

o Determined by generation of microinstruction address

Executeo To generate control signals.

The microinstruction cycle is the basic event on a micro programmed processor.

Page 33: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Control Unit Organization

Sequencing Logic Module• Generates the address of the next microinstruction

Control Logic Module • Generates control signals

Page 34: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Vertical microprogramming

Each microinstruction specifies a single (or few) micro-operations to be performed

• Width is narrow: n control signals can be encoded into log2n control bits

• Limited ability to express parallelism

• Considerable encoding of control information requires external memory word decoder to identify the exact control line being manipulated

Microinstruction Classification

Page 35: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Horizontal microprogramming Each microinstruction specifies many different micro-operations to be performed in parallel.• Wide memory word

• High degree of parallel operations are possible

• Little to no encoding of control information

Microinstruction Classification

Page 36: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Microinstruction is organized as a set of fields.

Each field is depicted as a set of actions.

Only one of the actions specified for a given field could occur at a time.

Microinstruction Encoding

Page 37: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Functional Encoding • Identifies functions within the machine and designates fields by function type.

Resource Encoding• Devotes one field to each source( e.g., I/O, memory, ALU)

Direct or Indirect Encoding• The difference is that with indirect encoding, one field is used to determine the interpretation of another field.

Aspects of Encoding

Page 38: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

References

http://fourier.eng.hmc.edu/e85/lectures/processor/node11.html

http://www.cs.binghamton.edu/~reckert/hardwire3new.html

http://en.wikipedia.org/wiki/Microcode

http://en.wikipedia.org/wiki/Hardwired_control

http://en.wikipedia.org/wiki/Control_unit

http://en.wikipedia.org/wiki/Core_2_duo

Page 39: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

References

http://en.wikipedia.org/wiki/Erratum

Page 40: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

SummaryMicroprogramming – alternative to hard-wired control units, provides more flexibility in designing the processor and control unit.

Disadvantages – not as fast as a hard-wired implementation, RISC processors typically use hardwired control units.

Microprogramming allows for errors microcode to be corrected via patches (with writable memory i.e. EEPROM) (as in C2D)

Horizontal microcode represents each control signal as a bit with little or no encoding used.

Vertical microcode encodes mutually exclusive control signals in different fields, which must then be decoded to produce the control signals. (Which requires more time because of additional combinational circuits).

Page 41: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Review Questions

1. What is the difference between horizontal and vertical microinstructions?

2. Why is micro programmed control used instead of hardwired control for the control unit.

3. What are the advantages and disadvantages of micro programmed control compared with a hardwired control unit implementation?

4. What are the main tasks performed by a micro programmed control unit?

Page 42: Chapter 16 Micro-programmed Control EEL 4709C Alan Garcia Arturo Linares Henry Mitzler.

Review Questions5. Why are vertical microinstructions slower than

horizontal microinstructions?

6. What is the preferred sequencing technique?

7. What are the differences between explicit techniques and implicit techniques?

8. What range of values does the length of vertical and horizontal microinstructions fall under?

9. What does the control memory contain?

10.What concerns are involved in the design of a microinstruction sequencing technique?