Docsity

Micro programmed Control - Lecture Slides | CIT 595, Study notes of Computer Science

Toggle sidebar
bg1
1
Microprogrammed Control
CIT 595
Spring 2008
2
CIT 595
Microprogrammed Control
Each machine instruction is in turn implemented by a series of
instructions called microinstructions
■A microinstructions encodes
¾Control signal for carry out a particular stage in the instruction
cycle
¾Next (likely) microinstruction
The microinstructions form a microprogram, which is stored in
a memory
■Sometimes called Control Store
■Memory is non-volatile and reprogrammable e.g. EPROM, Flash
Microprogram Control is essentially a Finite State Machine
(programmable)
3
CIT 595
Source:
http://fourier.eng.hmc.edu/e85/lectures
/processor/node11.html
4
CIT 595
Microprogrammed Control: State Diagram
pf3
pf4
pf5

Partial preview of the text

Download Micro programmed Control - Lecture Slides | CIT 595 and more Study notes Computer Science in PDF only on Docsity!

Microprogrammed Control

CIT 595

Spring 2008

CIT 595

Microprogrammed Control

„^

Each machine instruction is in turn implemented by a series ofinstructions called

microinstructions

■^

A microinstructions encodes^ ¾

Control signal for carry out a particular stage in the instructioncycle ¾ Next (likely) microinstruction

„^

The microinstructions form a

microprogram

, which is stored in

a memory^ ■

Sometimes called Control Store ■ Memory is non-volatile and reprogrammable e.g. EPROM, Flash

„^

Microprogram Control is essentially a Finite State Machine(programmable)

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

CIT 595

Microprogrammed Control: State Diagram

CIT 595

Another Implementation of LC3 Filled arrow

= info to be processed.

Unfilled arrow

= control signal.

CONTROLUNIT

CIT 595

Some Implementation detail : Common Bus „^

This style of implementation uses a common bus^ ■

Shared by memory, ALU, Register File, I/O ■ Same set of wires carry address and data information „To have only one component’s address/data on the bus

■^

Use device called Tristate

¾^

E = 1, D = Q ¾^

E = 0, no connection between D & Q

■^

Tristate is an alternative to mux „^

In hardwired implementation we had point-to-point connection between components

■^

Buses can be of various kinds ■^

More on Bus Architectures later

D^

Q E

CIT 595

Some Implementation detail : Memory „^

Unified Memory for instruction and data „^

Before Address or Data is given to memory, there is temporary register to receive the data from the common bus

■^

MAR = Memory Address Register ■^

MDR = Memory Data Register „^

This is done as the bus is used for both address and data^ ■

E.g. STR you need to provide address and data „^

The register can be Read or Written by control signals^ ■

LD.MAR for (MAR) and LD.MDR for (MDR) „^

Similarly when instruction is fetched from Memory, the content is placed in register called IR and it controlled by LD.IR

LC3 Implemention using Microprogram ControlCIT 595

„^ The behavior of LC-3 during a given clockcycle is completely described by the 49 bitmicroinstruction

■^

39 bits for control signals ■^

10 bits for possible next state of themachine „^

Each phase of instruction cycle may require more than one microinstruction

■^

E.g. Fetch stage takes 3 microinstructions „^ 6-bit address is used to lookup memory

■^

There are 52 possible microinstructions(states) that can describe LC3’s behavior ■^

Memory size 2

6 x 49

CIT 595

Active Signals for State 18

Filled arrow

= info to be processed.

Unfilled arrow

= control signal.

CONTROLUNIT

CIT 595

LC3 Microprogram Implementation: Next State^ „

10 bits of current microinstruction^ ■

J (6-bits): encodes the mostly likely next state ■ COND (3-bits): field indicates special tests that must occur tocompute the true next state

¾^

0 – Unconditional (no test to be performed - then next state is J)

¾^

1 – Memory Ready

¾^

2 – Branch

¾^

3 – Addressing Mode

¾^

4 – Privilege Mode

¾^

5 – Interrupt

■^

IRD (1-bit) : If IRD = 1, ignore J and COND

¾^

Next state is based on opcode field(15:12)

¾^

This only happens in state 32

CIT 595

LC3 Microprogram: Next State (contd..) 9 other signals (what actual event took place) „^

INT: To indicate interrupt from I/0 device^ ■

Only tested if in state 18 (because that is before the start of aninstruction cycle) „^

R: indicate the end of memory operation „^

IR[15:12]: current opcode (instruction bits 15:12) „^

IR[11]: Addressing mode (user subroutine) „^

PSR[15]: processor executing in supervisor or user mode „^

BEN: indicates whether or not a branch should be taken

CIT 595

Logic for Microsequencer

CIT 595

LC3 Next State Example

0-

1

0

0

32

18

0

0

18

1

33,

0

5

33

18

POSSIBLENEXT STATE

IRD

COND

J

CURRSTATE „^

State 18: Most likely next state is 33 but need to check for INT (COND = 5). If INT = 1, Next State = 49 „^

State 1: Next State is just 18 (this because you are done finishing ADD instr and want to start a new instr.cycle „^

State 32: J and COND ignored as IRD = 1, 0 – 15 are your next possible states

CIT 595

R

R^

R

R^

R

PC<–BaseR

To 18

PC<–BaseRR7<–PC[IR[11]]^1

PC<–PC+off

To 18

To 18

To 18 To 18To 18

To 8 (See Figure C.7)

RTI

MAR <–PCPC<–PC+1[INT]MDR<–MRIR<–MDR

DR<–SR1+OP2*

set CC DR<–SR1&OP2*

set CC

[BEN]PC<–PC+off

PC<–MDR

MAR<–PC+off9MDR<–M[MAR ]

R

R

MAR<–MDR

MAR<–PC+off9MDR<–M[MAR]MAR<–MDR

MAR<–B+off

MAR<–PC+off

MAR<–B+off

MAR<–PC+off MDR<–SR

DR<–MDRset CC

M[MAR]<–MDR

To 18To 18

To 18

To 18

To 18

R^

R

MDR<–M[MAR]

To 49 (See Figure C.7)

NOTES

MDR<–M[MAR]R7<–PC

B+off6 : Base + SEXT[offset6]PC+off9 : PC + SEXT{offset9]PC+off11 : PC + SEXT[offset11]*OP2 may be SR2 or SEXT[imm5]

DR<–NOT(SR)

set CC

NOT 14

DR<–PC+off9set CC

LEA^

LD^ LDR

LDI^

STI^

STR^

ST

JSR

ADDAND

BRJMP

R

R

BEN<–IR[11] & N + IR[10] & Z + IR[9] & P

[IR[15:12]]

1101

To 13

MAR<–ZEXT[IR[7:0]]

TRAP

State 18

State 1

State 32

CIT 595

Hardwired vs. Microprogrammed

„^

Complexity^ ■

There is an extra level of instruction interpretation inmicroprogrammed control, which makes it slower thanhardwired control „Flexibility

■^

Instruction and Control Logic are tied together inhardwired control, which makes it difficult to modify ■^

New instructions can be easily added by only makingchanges to the microprogram in microprogrammedcontrol implementation