Algorithmic State Machine
Algorithmic State Machine
UNIT III
Algorithmic State Machine
Reference Books:
It is used for indicating the It describes the effect of an Its rounded corners are
state of the controller in the input on the control. different from the state box
control sequence
It is rectangular in shape. It is diamond shaped box. It is oval shaped.
In this box, information will The input condition to be The input path to this box
be written as register tested will be written inside. must come from one of the
operations or output value exit paths of the decision
for given state. box.
For each state there is one It has two or more exit paths. These are familiar in
entry and exit point. conventional flowcharts.
Entry
State Name Binary code
Register operation or Condition Conditional outputs
Outputs Expression or actions
0(false) 1(true)
exit
Digital Electronics & Logic
ASM
Design
Example
entry
q1 001
1 0
D
q2 010 q3 100
A documentation language
A simulation language
A synthesis language
Technology independent logic design
On your PC
VHDL SYNTHESIS CPLD / FPGA
Program TOOL ( Programmable H/W )
( XILINX Software ) The above device then
operates as the desired
For Syntax Check Digital Circuit
Converts VHDL Programming
Half-Adder , MUX , Instructions
( Half-Adder , MUX ,
Counter , Code Program Counter ,
into a GATE-
µController LEVEL NETLIST Or even a MicroController
)
(11000011….) ASM
Digital Electronics & Logic Design
A VHDL Progra ay co sist of….
• ENTITY Declaration.
compulsory
• ARCHITECTURE Body.
• Configuration Declaration.
• Package optional
* Package Body.
* Package Declaration.
All Declarations are called P.D.U’s ( Primary
Design Units )
All
DesignBody’s are called S.D.U’s ( Secondary Design
Digital Electronics & Logic
ASM
Syntax For Entity Declaration
ENTITY entity_name IS
PORT
(
signalname_1 : [ MODE ] [ DATATYPE ] ;
signalname_2 : [ MODE ] [ DATATYPE ] ;
signalname_3 : [ MODE ] [ DATATYPE ] ;
. NO Semi-
. colon after
signalname_n : [ MODE ] [ DATATYPE ]
); Last Signal
END entity_name ;
ENTITY and_gate IS
PORT
(
A : IN STD_LOGIC ;
B : IN STD_LOGIC ;
Y : OUT STD_LOGIC
);
END and_gate ;
BEGIN
Here you
Mention “ The Logical Relationship between your INPUTS & OUTPUTS”
END arch_name ;
BEGIN
Y < = A and B ;
END arch_name ;
end mux41;
begin
end mux41_arch;
IF reset='1' THEN
tempcount <= "000" ;
ELSE
tempcount <= tempcount - 1 ;
END IF;
END IF;
END PROCESS;
Q <= tempcount;
carry1
a x1 c1
add1
b x2 s1
cout
sum1
carry2
x1 c1
add2
cin X2 s1 sum
architecture adder_arch is
component add is
port
(
x1,x2 : in std_logic;
s1,c1 : out std_logic);
end component;
begin
cout<=carry1 OR carry2;