DELD Algorithmic State Machine
DELD Algorithmic State Machine
DELD Algorithmic State Machine
UNIT III
Algorithmic State Machine
Syllabus
Reference Books:
entry
State Name Binary code
Register operation or outputs
exit
Cntd…
Example
Entry
q1 binary code(00)
Z=1
Exit
Decision box
The decision box is diamond shaped
box.
It has two or more exit paths.
A decision box may be conditioned on
a signal or a test of some kind.
Cntd…
Decision box has exit path that checks condition
true or false.
1 0
D
q2 010 q3 100
Draw ASM chart for given diagram
Reset
w=1
w=0 A z = 0 B z = 0
w=0
w=0 w=1
C z = 1
w=1
State table
A A B 0
B A C 0
C A C 1
ASM Chart
Reset
0
w
1
0
w
1
0 1
w
Multiplexer controller method:
Problem Statement:
Draw ASM Chart for the following state machine:
A 2 bit up counter with output Q1Q0 and enable
signal ‘X’ is to be design. If ‘X’ = 0, counter
changes the state as ‘00-01-10-11-00’. If ‘X’ =
1, counter should remain in present state.
Design your circuit using JK FF and suitable
mux.
State Table
Present State Next State Input Mux input
A B A+ B+ Mux 1 Mux 2
0 0 0 0 X’ 0 X
0 0 0 1 X
0 1 0 1 X’ X X’
0 1 1 0 X
1 0 1 0 X’ 1 X
1 0 1 1 X
1 1 1 1 X’ X’ X’
1 1 0 0 X
VHDL
V Very high speed integrated circuit
H Hardware
D Description
L Language
Entity Declaration
Architecture
Design Units
To describe an entity, VHDL provides
five different types of design units:
Entity declaration
Architecture body
Configuration declaration
Package declaration
Package body
Entity Declaration
Entity declaration describes the external view of
the entity (e.g. The input and output signal names).
It specifies the name of the entity being modeled
and lists the sets of interface ports.
It is most basic building block in a design.
It specifies I/O pins of the circuit .
Syntax :
Entity Entity_name is
port (Port_name :mode Port_type;
Port_name :mode Port_type);
End entity_name ;
Example
Entity for And Gate :-
entity ANDGate is
port ( A, B : in std_logic;
C : out std_logic );
end ANDGate;
Entity for 4:1 MUX :-
entity Mux is
port ( a,b,c,d : in std_logic; so,s1: in std_logic;
y : out std_logic );
end mux ;
From above examples
Entity_name : It is an identifier defined by user.
Port_name/Port_type : Name of Port and Port Date
types
Modes:
In(Input) :to read the value from user.
Out :output
Inout:Bi-directinal port
Buffer :Outport with read capabilities .
Architecture
The architecture body contains the internal
description of the entity. For example, as a set of
interconnected components that represents the
structure of the entity or as a set of concurrent or
sequential statements that represents the behavior
of the entity.
Architecture architecture_name of
entity_name is
{ block declaration }
Begin
{
}
End architecture_name ;
Architecture
The internal details of an entity are
specified by an architecture body. This can
be specified either as a description of the
structure or as a description of the
behavior. There are three modeling styles:
Library IEEE;
Use IEEE.Std_Logic_1164.All;
Entity Fulladder is
Port(A,B,Cin :in bit;
S,Cout:out bit);
End fulladder;
Architecture Adder of Fulladder is
Begin
S<= A xor B xor Cin;
Cout<= (A and B) or (B and Cin) or (Cin And A);
End Adder;
Design 4 bit counter
Library IEEE;
Use IEEE.Std_Logic_1164.All;
Entity c1 is
Port (Clk,reset: in STD_lOGIC ;
Q :out STD_LOGIC_VECTOR(3 DOWNTO 0));
End C1;
Architecture Counter of C1 is
Signal Count: out STD_LOGIC_VECTOR(3 DOWNTO 0);
Begin
Process(clk,reset)
Begin
If (reset=‘0’) then
Count <= “0000”;
Elseif (cLK=‘1’) then
Count <= Count +1;
end if ;
End if ;
End process;
Q<=count ;
End counter;
Data Objects