Docsity

Micro-programmed State Machines (Lecture 10), Slides of Digital Systems Design

Partial preview of the text

Download Micro-programmed State Machines (Lecture 10) and more Slides Digital Systems Design in PDF only on Docsity!

Micro

programmed State

Micro

-programmed State

Machines

Lect re 10Lect

ure 10

Dr. Shoab A. Khan

Micro-programmable State machines

ƒ^

A Micro-Programmable State machine substitutescombinational cloud of FSM with Programmablecombinational cloud of FSM with ProgrammableMemory (PM)

ƒ^

The control signals for all the states are stored andread from PM instead of being generated bycombination logic

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Example Design addr

5

PM

2

addr^6

9

5

data

cntr

input current state

4

4

next state

rst_n

„^

2-bit input and 4-bit current state constitutes 6-bit address of PM „^

9-bit wide PM contents are 5-bit output bits for control and 4-bit „^ Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

9 bit wide PM contents are 5 bit output bits for control and 4 bitnext state

Micro-programmed Sate Machine Implementation^ „

Number of 1s detected problem of Chapter 9 „^

Combinational cloud is replaced by PM

00

0

00

1

0

0

0

0

1

0

Program Memory

input

00

1

01 0110

0 1 0

addr

0

1

0

0

1

1

0

0 0 0

1

0

next state

out

current state

101111

1 0 1

1

1

0 0

1

1

0

0

1

input

next_state

out

current_state

input

clk

t^

t t

out t

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

current_state

out

rst_n

Design Example: 4 Entry FIFO as Micro-program State machine 1. Design a first-in, first-out (FIFO) queue that consists of four registers

R0, R1, R2, and R

  1. Write and Delete are the two operations on the queue3.

Write moves data from the fifo_in to R0 that is the tail of the queue

Delete deletes the first entry at the head of the queue

y^

q

The head of the queue is available on the fifo_out

Writing into a full queue or deletion from an empty queue causes anERROR conditionERROR condition

Assertion of Write and Delete at the same time also causes anERROR condition Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

FIFO Design

ƒ^

Design consists of datapath and controller

ƒ^

Datapath^ ‰

Four registers

-^

Shift registers

One 4:1 MUX

‰

One

4:1 MUX

ƒ^

Controller^ ‰

Input signals

‰

Input signals

-^

Write

-^

Delete

O t

t^

i^

l

‰

O

utput signals•^ out_sel•^ write en

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

_

-^

Error

FIFO/LIFO

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Counter-based FSM: Bit serial adder

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Modifications to Counter-based Microcontrollers 1^ ƒ

Mechanism for changing count sequence ƒ^

Begin another sequence under control of micro ƒ^

Begin another sequence under control of micro-program memory Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Loadable Counter for

Goto

capability

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Example: Complete Design

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Conditional Execution

ƒ^

2-bit control allowing on selection of twoconditional inputs and two signals true and falseconditional inputs and two signals true and false

ƒ^

The conditions come from the status register inthe data path

ƒ^

Example:^ ‰

zero and positive flags are used for providingconditional executionconditional execution ‰ if (r1 > r2) jump label3; // compute r1-r2 jump if result ispositive ‰ if (r1 == r2) jump label1; // compute r1 r2 jump if result‰ if (r1 == r2) jump label1; // compute r1-r2, jump if resultis zero ‰ jump label 2 // unconditional jump

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Conditional load

sel

load

FALSE(normal

execution:

never

load

branch

address)

COND0(load

branch

address

if

COND

is

TRUE)
(^

COND1(load branch address if COND1 is TRUE)(load

branch

address

if

COND

is

TRUE)

TRUE(^

d^

l^

l^

l^

d b

h^

dd

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

(unconditional

jump:

always

load

b

ranch

address)

Pipelined Register

ƒ

Often counters are replaced with an ALUbased program counter register ƒ

The critical path of the design is long as it

p

g

g

goes from the counter to ROM toarchitecture to functional units generating

g

g

COND0 and COND1 to conditional MUX. ƒ

The critical path can be broken byThe

critical path can be broken by

inserting a pipeline register in the design Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan