VHDL Sample Routine
Sequence Detection
from the Technology Interface

The following is a VHDL listing and simulation of a 0 1 1 0 sequence detector. This listing includes the VHDL code and a suggested input vector file. In addition to giving the user more exposure to VHDL and sequential machines, this routine demostrates the use of an input vector file for driving the simulation.


Input Test Vector Sequence

The test vectors are used to drive the input. In some cases, particularly with very complex state machines, it is easier to define the input test vector sequence in a text form rather than to use the waveform editor for creating the input patterns. In this case the input pattern could have easily been generated with the waveform editor.

START 0 ;
STOP 1000 ;
OUTPUTS z ;
INPUTS x clk ;
PATTERN         % test every combination x %
            
0>    0 0
200>  0 1
400>  1 0
600>  1 1
800>  1 0
1000> 1 1    
1200> 0 0
1400> 0 1
1600> 0 0
1800> 0 1
2000> 0 0
3000> 0 0
;

Simulation result for detecting the 0 1 1 0 sequence.