Document not found! Please try again

3 Designing Digital Systems with Algorithmic State Machine Charts

40 downloads 115 Views 209KB Size Report
An ASM chart is a method of describing the sequential operations of a digital ... ASM charts are similar in appearance to flowcharts used in the early days of com- .
university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

3

Designing Digital Systems with Algorithmic State Machine Charts • An ASM chart is a method of describing the sequential operations of a digital system

which has to implement an algorithm. An algorithm is a well defined sequence of steps that produces a desired sequence of actions and/or calculation results in response to a given sequence of control and data inputs. • ASM charts are similar in appearance to flowcharts used in the early days of com-

puter programming. Unlike the traditional flowchart the ASM chart includes timing information because it implicitly specifies that the FSM steps from one state to another only after each active clock edge. ASM charts are constructed of three elements.

Digital Systems © B. Schwarz

3-1

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

3.1

Graphical ASM Chart-Notations Entry path

State entry path State name

State code

Unconditional (Moore) output list Exit path

Entry path 0

Input condition

Exit false path

1

Exit true path

Conditional (Mealy) output list Exit path

• State box: A rectangle describes one state of the synchronous sequential digital system. It

is similar to a circle representing a state of a state diagram. The main difference is that it only has one output transition (exit path). The state block symbol contains a listing of all unconditional actions and (Moore) outputs associated with that state. The outputs are updated concurrently when the state is entered after an active clock edge. Ö Asserted signals are written as: Z which means Z = 1 Digital Systems © B. Schwarz

3-2

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

Ö Registered mathematical operations: COUNT ← COUNT + 1 ; MULT ← A * B The activated state will assert the enable signal which causes the counter to increment and the multiplier to operate a multiplicand and a factor. Ö Registered signal assignments: INT_REG ← INPUT_1 REG ← A(2:0) @ C(4:0) concatenation. • Condition symbol: A diamond shape contains the input condition on which depends the

branching from a given state. It has one entry point and two exit path. Condition symbols can be concatenated. Ö X means that the input signal X has to be tested. Ö X1 ∧ X2 indicates that X1 = X2 = 1 has to be true. • Conditional output box: An oval or rectangular with rounded edges represents an action,

i.e. signal assignment or calculation, that is taken if an input condition is fulfilled. Conditional output boxes are only used to depict Mealy-type outputs. The entry path to the symbol is always from a decision symbol, but its exit path can be either to a state box or to another decision symbol. Digital Systems © B. Schwarz

3-3

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

ASM Chart Representation of a Simple Moore-Type FSM Reset Transformation of a state diagram

X=1

A X=0

B Z=0

Z=0 X=0

X=1

X=0 C Z=1 X=1

Digital Systems © B. Schwarz

3-4

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

Reset

Associated ASM chart for a Moore-Type FSM Output signals Z = 0 are not depicted in order to support transparency!

0

1

1

0

0

1

Digital Systems © B. Schwarz

3-5

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

ASM Chart Representation of a simple Mealy-Type FSM State diagram Reset

X=1 / Z=0 X=0 / Z=0

B

A

X=1 / Z=1

X=0 / Z=0

It has to be checked which state is of Mooretype or Mealy-Type before transformation can be performed.

Digital Systems © B. Schwarz

3-6

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

Associated ASM Chart

Digital Systems © B. Schwarz

3-7

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

3.2

FSM as a Server's Polling Circuit • A polling circuit for a client-server system with 3 clients has to determine which client

is to be serviced by a server of many clients. • A client i requests service by asserting its service-request flag Ri to the client. In each

clock cycle the polling circuit polls its inputs Ri to determine whether service is being requested and to identify the requesting client having the highest priority. • In general the client having the highest priority is to be serviced. As long as a client

requests for service it will be granted by the polling circuit independently of other client requests. • After a request flag Ri is deasserted the polling circuit will enter the polling state at

least for one clock cycle. No other client's concurrently asserted request will change this FSM behaviour. Digital Systems © B. Schwarz

3-8

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

• Each client has a polling priority level: client0 > client1 > client2. The request Ri with

the highest priority is granted by the polling circuit with the corresponding grant bit Gi. Only one bit Gi a time can be asserted. • The FSM states are called: IDLE, GNT0, GNT1,GNT2. In IDLE state no Gi is as-

serted. • Start with a block diagram and decide which FSM type will be appropriate.

Digital Systems © B. Schwarz

3-9

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

State Diagram for the Polling Circuit State

R2, R1, R0

000

G2 G1 G0

Reset

Idle

100 x10 xx1 GNT2

GNT1

GNT0

Digital Systems © B. Schwarz

3-10

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

State Diagram with Transition Conditions ⎯R2 ∧ R1 ∧ R0 IDLE

Reset

R2∧R1∧R0 ⎯R0

⎯R1

⎯R0 ∧ R1 ⎯R2

R0

GNT0

GNT2

GNT1

G2

G1

G0

R2

R3

R1

Digital Systems © B. Schwarz

3-11

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

ASM Chart for the Polling Circuit

Idle

1

GNT0

1

0

0 1

GNT1

1

0 0

0 1

GNT2

1 0

Digital Systems © B. Schwarz

3-12

university of applied sciences hamburg Prof. Dr. J. Reichardt

DEPARTEMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Prof. Dr. B. Schwarz

VHDL Code for the Polling Circuit -- Polling circuit: client arbiter entity arbiter is port( CLK, RESET : in bit; R: in bit_vector(2 downto 0); -- device requests G: out bit_vector(2 downto 0)); -- device grants end ARBITER; architecture BEHAVIOUR of ARBITER is type STATE_TYPE is (IDLE, GNT0, GNT1, GNT2); -signal STATE, NEXT_STATE: STATE_TYPE; begin REG: process(CLK, RESET) begin if RESET = '1' then STATE

Suggest Documents