You are on page 1of 13

EEE 4211 Microprocessor and I/O System

SAP-1 Controller SAP-2

SAP-1 control Signals


Instruction

T1
Ep Lm Ep Lm Ep Lm

T2
Cp Cp Cp

T3
Ce Li Ce Li Ce Li

T4
Ei Lm Ei Lm Ei Lm

T5
Ce La Ce Lb Ce Lb

T6
X Eu La Su La

LDA

ADD
SUB

OUT
HLT

Ep Lm
Ep Lm

Cp
Cp

Ce Li
Ce Li

Ea Lo
X

X
X

X
X

State Equations
Ep= T1 Cp= T2 Lm= T1+ T4.LDA+T4.ADD+T4.SUB Ce= T3+ T5.LDA+T5.ADD+T5.SUB Li= T3 Ei= T4.LDA+T4.ADD+T4.SUB La= T5.LDA+T6.ADD+T6.SUB Ea= T4.OUT Su= T6.SUB Eu= T6.ADD Lb= T5.ADD+T5.SUB Lo= T4.OUT

Implementation of HLT

LDA I7 I6 I5 i4 ADD Instruction Decoder 4-16 SUB OUT HLT CLK Oscillator/ Clock Generator

Microprogramming
Reduces the complexity of control circuit. In Microprogramming, microinstructions are stored in a ROM instead of producing them with hardwired control matrix.

Construction of Microinstruction for SAP-1


For LDA, at t1, the states of control Signals are: Cp=0 Ep=1 Lm=1 Ce=0 Li=0 Ei=0 La=0 Ea=0 Su=0 Eu=0 Lb=0 Lo=0 So the Controller has to generate the control word/ Microinstruction 0110 0000 0000 or 600h In this way, microinstructions will be generated and stored in the control ROM.

SAP-1 Control ROM


Address
0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH

Contents
600H 200H 180H 240H 120H 000H 240H 102H 024H 240H 102H 028H 011H 000H 000H x

Routine
Fetch

Active
EP Lm Cp Ce Li Ei Lm Ce La None Ei Lm Ce Lb Eu La Ei Lm Ce Lb Su La Ea Lo

LDA

ADD

SUB

OUT

Microprogrammed Controller circuit


I7 I6 I5 I4

Address ROM 16X4 T3


Load

T1
CLR

Presettable CLR Counter

Control ROM

12 bit

SAP-2
8 bit microprocessor 16 bit address bus Includes jump instructions.

Block Diagram of SAP-2


Hex Keyboard 8 A 8 In Port 1

In Port 2

PC

Mar

8 Bit Address and Data Bus

64 K Memory 8 OUTPUT PORT 8 Hex DIsplay

MDR

IR

Controller

16

8
8 ALU 2 FLAGS 8 8 TMP 16 8 B 8 C

16
8

OUTPUT PORT

SAP-2 Instructions
43 INSTRUCTIONS Conditional and Unconditional brunches Call and Ret instructions.

CALL and RET instructions


In SAP-2 complex CALL and RET instructions are implemented. The syntax of call is CALL addr When call is executed, the PC is automatically saved into the memory location FFFE and FFFFh. SAP-2 Goes to the subroutine addressed by call. The sub routine must end with a RET. After completion o, PC is again loaded from memory location FFFE and FFFFh.

You might also like