introduction to computer organization and architecture micro program...

63
Introduction to Computer Organization and Architecture Micro Program ภภภภ ภภภภ ภภภภภภภ ภภภภภภภ ไไไไไไไไไไไไ

Upload: joella-hillary-lewis

Post on 13-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Introduction to Computer

Organization and Architecture

Micro Program

ภาษาเครื่��องภาษาเครื่��อง

ไมโครโปรแกรม

Page 2: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Model of Control Unit

How the Control Unit Generate the control

signal?

Page 3: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Model of Control UnitGet instruction from

Instruction RegisterWorking steps with the timing generator and conditions from flag, the signal from IR passed through the Decoder circuit into the CU to generate the control signal out.

Page 4: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Block Diagram of the Control

Unit

Page 5: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Control Unit with Decoded Inputs

Page 6: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microprograms ?• 1950 Maurice V. Wikes

( Cambridge Univer.)• 360IBM System/ tt ttttttt ttttttttttt-ttt ttt tttt tttttt t ttt t tttttt.• Microprogramming allows a ttttttt ttttttt tttt ’: PCU to be designed sequ ences known as MicroproMicroprogramsgrams are placed in a spe cial control memory in theCPU.

Page 7: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Wilkes's Microprogrammed

Control Unit

Page 8: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

- so that instruction from t he CPU’s main instruction set is executed by invokin g and executing the corre sponding microprogram. * * * * * * *

- CPU with no floating point arithmetic circuits can exe -cute by means of fixed po int arithmetic circuits.

Microprograms ?

Page 9: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Digital Systems : CPU Data Path Unit

network of functional and s torage units capable of pe rforming certain operation on data words. Control Unit issue control signal to the data path for selecting the

function to be performed at specific times and route

through the appropriate p arts of the datapath unit.

Page 10: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Data Paths and Control Signals

Page 11: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Digital Systems : CPU Hardwired

fixedl ogi c ci rcui ts to genera te the control signals.

Microprogrammed stores the control signals -in sequence of micro in structi ons ( microprogramicroprogra

msms ) ina control memory. * provide a systematic & fl

exi bl e method*

Page 12: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microprogram med Control

Use microprograms to select, interpret, and e xecute instruction set.

CU contain logic to ge -nerate micro instructi

on addresses and to f etch and decode from

control memory.

Fig.15.4

Page 13: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Control Unit Microarchitecture

Page 14: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Instruction is implement

ed by a sequence of on e or more sets of concu

-rrent micro operations.

-Each micro operatio n is associated with a group of control l

ines that must be a ctivated in a prescr

ibed sequence to tr -igger the micro operations.

Page 15: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Program Execution

Instructi on Cycle

Instructi on Cycle

. ..

Fetch

Execute

Interrup

t m

OP

mOP

mOP

. .. . ..

Page 16: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Microprogramming is a metho

d of - control unit design in which t

he control signal selection and

sequencing information is sto red in a

ROMROM or RAMRAM called . . . . .

Control Me Control Memorymory : CM

Page 17: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Functioning of Microprogrammed Control Unit

Page 18: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts

The control signals control signals could beactivatedactivated at any time that a

re specified by a -micro instr-micro instruction,uction,

which is fetched from CM in much the

same way an instruction is f etched from

main memory.

Page 19: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Instruction Cycle Instruction Cycle

•Fetch•Indirect•Execute

•Interrupt

Page 20: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Flowchart for Instruction Cycle

Page 21: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม
Page 22: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Fetch Cycle Fetch Cycle 3 steps and

t tttt-tttttttttt4

t 1 --- : MAR < (PC)

t 2 --- : MBR < Memory

--- PC < (PC) + IIt 3 --- : IR < (MBR) II : Instruction Len

gth

Page 23: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Sequence of Events, Fetch Cycle

Page 24: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Indirect Cycle Indirect Cycle -3 micro operatio

ns

t 1 --- :MAR< (I R (address) )

t 2 --- : MBR < Memory

t 3 : --- IR(Address) < (MBR(ad

dress))

Page 25: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Execute Cycle Execute Cycle -vary on op co

de such as 1ADD R , X will -have 3 micro operations

t 1 --- : MAR < (IR(address))t 2 --- : MBR < Memory

t 3 --- : R1 < (R1) + (MBR)

Page 26: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Execute Cycle Execute Cycle as ISZ X (Inc

rement and Skip instruction)

t 1 --- : MAR < (IR(address))t 2 --- : MBR < Memoryt 3 --- : MBR < (MBR) + 1t 4 --- : Memory < (MBR) If ((MBR) = 0) then (

--- PC < (PC)+1)

Page 27: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Execute Cycle Execute Cycle as BSA X (su

- -broutine call : Branch and sav- e address instruction)t 1 --- : MAR < (IR(address))

--- MBR < (PC) t 2 --- : PC < (IR(address)) --- Memory < (MBR)t 3 --- : PC < (PC) + 1

Page 28: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts Interrupt Cycle Interrupt Cycle -3micro operati

ons

t 1 --- : MBR < (PC)

t 2 --- : MAR < Save_Address

--- PC < Routine_Addresst 3 --- : Memory < (MBR)

Page 29: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic Concepts - Each micro instruction also e

xplicitly or implicitly specifi -es the next micro instructio

n to be used, thereby provi ding the necessary informat

- ion for micro operation sequencing.

set of micro-instruction

forms

microprmicroprogramogram

Page 30: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Organization of

Control Memory

Page 31: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microinstruction Encoding

Page 32: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microinstruction Encoding

Page 33: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Basic ConceptsAdvantageAdvantage Microprogra

m can be changed relati vely easily by changing

the contents of CM. (fleflexiblexible)

DisadvantageDisadvantage The tim e required to access the

microinstructions from C M. Chip area and circuit

delay must both be minimized.

Used in CISC’s as the Penti um and MC6 8 0 X0

Page 34: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

-Micro instructions Horizontal Formats

long formats, little encoding of the control fields, and t

he ability to control many- micro operation in parallel.

Vertical Formats short formats, considerable

- control field encoding, and limited parallelism.

-interpreted by nano inst ruction that directly con

trol the hardware.

Page 35: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม
Page 36: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Micro-instruction Types

• Each micro-instruction specifies single (or few) micro-operations to be performed— (vertical micro-programming)

• Each micro-instruction specifies many different micro-operations to be performed in parallel—(horizontal micro-programming)

Page 37: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

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 38: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Horizontal Micro-programming

• Wide memory word• High degree of parallel operations possible• Little encoding of control information

Page 39: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Alternative Microinstruct

ion Formats for a Simple

Machine

Page 40: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Alternative Microinstruction Formats for a Simple Machine

Page 41: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Next Address Decision

• Depending on ALU flags and control buffer register—Get 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 42: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Functioning of Microprogrammed Control Unit

Page 43: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Design Considerations

• Size of microinstructions• Address generation time

—Determined by instruction register– Once per cycle, after instruction is fetched

—Next sequential address– Common in most designed

—Branches– Both conditional and unconditional

Page 44: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Sequencing Techniques

• Based on current microinstruction, condition flags, contents of IR, control memory address must be generated

• Based on format of address information—Two address fields—Single address field—Variable format

Page 45: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Branch Control Logic: Two Address Fields

Page 46: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Branch ControlLogic: Single Address Field

Page 47: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Branch Control Logic: Variable

Format

Page 48: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Address Generation

Explicit Implicit

Two-field Mapping

Unconditional Branch Addition

Conditional branch Residual control

Page 49: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Execution

• The cycle is the basic event• Each cycle is made up of two events

—Fetch– Determined by generation of microinstruction

address

—Execute

Page 50: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Execute

• Effect is to generate control signals• Some control points internal to processor• Rest go to external control bus or other

interface

Page 51: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Control Unit Organization

Page 52: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

A Taxonomy of Microinstructions

• Vertical/horizontal• Packed/unpacked• Hard/soft microprogramming• Direct/indirect encoding

Page 53: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

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— 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 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

possible to encode

Page 54: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Specific Encoding Techniques

• Microinstruction organized as set of fields• Each field contains code• Activates one or more control signals• Organize format into independent fields

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

—Actions from different fields can occur simultaneously

• Alternative actions that can be specified by a field are mutually exclusive—Only one action specified for field could occur

at a time

Page 55: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microinstruction Encoding

Page 56: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Microinstruction Encoding

Page 57: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

-Micro instructions Machine instruction is execu

ted by a microprogram whi - ch acts as a real time inter

preter for the instruction. Microinstruction Format

IBM System/370 Model 145

Control

Operand1

Operand2 CM Addressing

0 8 1

6

2

4

3

1

Page 58: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

IBM 3033 Microinstruction Format

Page 59: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Other Samples

•LSI computer

Page 60: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Simplified Block Diagram

of the LSI-11 Processor

Page 61: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Organization of the LSI-11 Control Unit

Page 62: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

LSI-11 Microinstruction

Format

Page 63: Introduction to Computer Organization and Architecture Micro Program ภาษาเครื่อง ไมโครโปรแกรม

Introduction to Computer

Organization and Architecture

Machine Language

ภาษาภาษาเคร��องเคร��อง