3. Microprogrammed Control

24
06/28/22 Deapartment of Inf ormation Technology 1 Microprogram Control CS1251 Computer Organization Carl Hamacher

Transcript of 3. Microprogrammed Control

Page 1: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

1

Microprogram Control

CS1251Computer Organization

Carl Hamacher

Page 2: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

2

Terminology

Control Word Bits represent control signals

Microroutine Sequence of control words Control sequence of a machine instruction

Microinstruction Individual control word in a microroutine

Page 3: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

3

Example Micro Instructions

Step RTN Control Signals

1 MAR [PC],PC [PC] + 1

MAR_En_In, PC_En_Out,PC_Inc

2 MDR [MEM([MAR])] MEM_Read, MDR_En_In13 IR [MDR] MDR_En_Out2, IR_En_In1

Page 4: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

4

Example Micro Instructions

Step RTN Control Signals

1 MAR [PC],PC [PC] + 1

MAR_En_In, PC_En_Out,PC_Inc

2 MDR [MEM([MAR])] MEM_Read, MDR_En_In13 IR [MDR] MDR_En_Out2, IR_En_In1

Micro-instruction ...

PC_Inc

PC_En_Out

IR_En_In1

IR_En_Out1

MEM_Write

MEM_Read

MAR_En_In

MDR_En_In1

MDR_En_In2

MDR_En_Out2

...

1

2

3

Page 5: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

5

Example Micro Instructions

Step RTN Control Signals

1 MAR [PC],PC [PC] + 1

MAR_En_In, PC_En_Out,PC_Inc

2 MDR [MEM([MAR])] MEM_Read, MDR_En_In13 IR [MDR] MDR_En_Out2, IR_En_In1

Micro-instruction ...

PC_Inc

PC_En_Out

IR_En_In1

IR_En_Out1

MEM_Write

MEM_Read

MAR_En_In

MDR_En_In1

MDR_En_In2

MDR_En_Out2

...

1 1 1 0 0 0 0 1 0 0 0

2 0 0 0 0 0 1 0 1 0 0

3 0 0 1 0 0 0 0 0 0 1

Page 6: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

6

Control Components

Control Store Special memory which stores microinstructions

Microprogram Counter (PC) Address of next microinstruction

Microprogram Branching Next address determination for control

sequencing

Page 7: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

7

Control Unit Organization

ConditionCodes

AddressGenerator

CLK

IR

External Inputs

PC

ControlStore

ControlWord

Page 8: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

8

Microinstruction Encoding

Horizontal Organization Minimally encoded (higher speeds) Many resources controlled by a single microinstuction Parallel use of resources

Most signals not needed simultaneously Many signals mutually exclusive

Vertical Organization Highly encoded (slower speeds) Small number of control functions in each

microinstruction

Page 9: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

9

Example Encoding15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

InstructionF0 F1 F3 F4F2

F1000 NOP001 PC_En_Out010 MDR_En_Out2011 Z_En_In100 MEM_Write101 MEM_Read110 REGS_Write111 REGS_Read

F2000 NOP001 IR_En_In1010 MDR_En_In2011 Y_En_In1100 IR_En_Out1101 REGS_Sel110 PC_Inc111 Halt

F300 NOP01 MAR_En_In10 Z_En_Out11 Y_En_In2

Page 10: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

10

Microprogram Sequencing

PC with branching capability Separate microroutine for each machine instruction Considerable duplication of common parts Longer execution time due to complex branching

AR with Next Address and Bit-ORing Additional bits for address field Fewer branch microinstructions Microroutines share many common parts

Page 11: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

11

Bit-ORing

Modification of bits within a branch address by ORing them with Bits from IR

OpcodeAddressing Mode

Condition Codes External Inputs

Page 12: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

12

Example Instruction Format15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

F0 F1 F3 F4F2

F4 OR Fn00 Next Addr01 ORSRC 00&SRC_MODE&00

10 OROP_ 000&OPCODE

11 ORDST 000&DST_MODE&00

F0Addr of

next instr

Instruction

Page 13: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

13

Control Unit Organization

ControlStore

uIR

DCD...

ControlSignals

uAR

IR

DCD

F0 F4

ConditionCodes

External Inputs

Page 14: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

14

Example Control Flowchart

MDR [MEM([MAR])]

Start

MAR [PC]PC [PC] + 1

IR [MDR]

Page 15: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

15

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

Page 16: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

16

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

Page 17: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

17

Example Control Flowchart

Reg Direct00

Y [REGS([SRC_REG])]

Reg Indir01

MAR [REGS([SRC_REG])]

MDR [MEM([MAR])]

Y [MDR]

Y Y

NN

SRC_MODE?

Page 18: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

18

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

010100

Page 19: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

19

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

010100

Page 20: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

20

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

010100 MAR [REGS([SRC_REG])]

010101 MDR [MEM([MAR])]

100000

Page 21: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

21

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

010100 MAR [REGS([SRC_REG])]

010101 MDR [MEM([MAR])]

100000

Page 22: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

22

Microinstruction Encoding

Address F0 F1 F2 F3 F4 RTN

000000 000001 001 110 01 00 MAR [PC], PC [PC] + 1

000001 MDR [MEM([MAR])]

000010 IR [MDR]

010100 MAR [REGS([SRC_REG])]

010101 MDR [MEM([MAR])]

100000 Z [Y], Branch DST_MODE

Page 23: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

23

Example Control Flowchart

Reg Direct0

REGS([DST_REG]) [Z]

Absolute1

MAR Value

MDR [Z]

MEM([MAR]) [MDR]

Y Y

NN

Page 24: 3. Microprogrammed Control

05/03/23 Deapartment of Information Technology

24

Questions?