Finite String Pattern Recogniser
Finite String Pattern Recogniser
COURSE PROJECT :
1
1. Aditi Kanjolia , 1200202
2. Kanza Naeem, 1200214
3. Himanshu Soni, 1100216
Email ID :
Contents
A Finite string pattern recognizer has one input (X) and one output (Z). The
Output is asserted whenever the input sequence 010 has been observed, as long
as the sequence 100 has never been seen.
Methodology:
X: 0 0 1 0 1 0 1 0 0 1 0
Z: 0 0 0 1 0 1 0 1 0 0 0
X: 1 1 0 1 1 0 1 0 0 1 0
Z: 0 0 0 0 0 0 0 1 0 0 0
.
Simulate the realization - Verify I/O behaviour of your state diagram to ensure it
matches specification.
We will be needed to design a FSM for the problem. A finite-state machine (FSM) , or simply
a state machine, is a mathematical model of computation used to design both computer
programs and sequential logic circuits. It is conceived as an abstract machine that can be in
one of a finite number of states. The machine is in only one state at a time; the state it is in
at any given time is called the current state. It can change from one state to another when
initiated by a triggering event or condition; this is called a transition. A particular FSM is
defined by a list of its states, and the triggering condition for each transition.
For our problem, we need to have six states, marked as S0,S1..and so on. The FSm design
goes as follows.
State Table:
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
ab
ab
ab
cx
X
0
1
0
1
0
1
0
1
0
1
0
1
0
1
cx
1
0
0
0
A+
0
1
0
0
0
1
1
0
1
1
1
0
1
1
cx
cx
X
0
B+
0
0
0
1
1
0
1
1
0
0
1
1
1
1
C+
1
0
1
0
1
0
0
0
1
0
0
0
0
0
O/P
0
0
0
0
1
0
0
0
0
0
0
0
0
0
X
0
else
Z <= '0';
NEXT_STATE <= S2;
end if;
when S4 =>
if X = '0' then
Z <= '0';
NEXT_STATE <= S5;
else
Z <= '0';
NEXT_STATE <= S4;
end if;
when S5 =>
if X = '0' then
Z <= '0';
NEXT_STATE <= S6;
else
Z <= '0';
NEXT_STATE <= S2;
end if;
when S6 =>
if X = '0' then
Z <= '0';
NEXT_STATE <= S6;
else
Z <= '0';
NEXT_STATE <= S6;
end if;
end case;
end process;
-- Process to hold synchronous elements (flip-flops)
SYNCH: process
Begin
wait until CLOCK'event and CLOCK = '1';
CURRENT_STATE <= NEXT_STATE;
end process;
end Behavioral;
Bibliography:
10