Presentation is loading. Please wait.

Presentation is loading. Please wait.

6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.

Similar presentations


Presentation on theme: "6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a."— Presentation transcript:

1 6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a sequential circuit which is basically a circuit that can store information x w clock Sequence detector Two main models for sequential circuits: Mealy and Moore model. In a Mealy model circuit the output depends on the inputs and the state of the system, while in a Moore model, the output of the system only depends on its state

2 6/27/20062 Sequential circuits - Sequence detectors Lecture Notes – Lab 5 Storage elements A combinational circuit and storage elements are interconnected to form a sequencial circuit. The information stored at any time defines the state of the circuit at that time. The next state of the storage elements is a function of the inputs and the present state. Synchronous sequential circuit can be defined from the knowledge of its signals at discrete instants.

3 6/27/20063 A sequence detector of 110 Lecture Notes – Lab 5 x w clock Sequence detector Values are only important on the rising edges of the clock pulses

4 6/27/20064 Moore State Machine for the sequence detector 110 Lecture Notes – Lab 5 ABCDstateA A/0B/0C/0D/1 0 1 1 10 0 1 0

5 6/27/20065 Variables Lecture Notes – Lab 5 Essentially equivalent to their conventional programming language counterparts; used for computations within processes, functions and procedures. The declaration of a variable has the following form: variable variable_name: variable type:= initial value Examples: VARIABLE STATE : STD_LOGIC_VECTOR(1 DOWNTO 0):= "00"; VARIABLE STATE : STD_LOGIC:= ‘0’; VARIABLE DONE: BOOLEAN:= FALSE;

6 6/27/20066 VHDL implementation for a sequence detector 110 Lecture Notes – Lab 5 ARCHITECTURE seq_det_arch of seq_det is BEGIN process1: PROCESS(CLK) VARIABLE STATE : STD_LOGIC_VECTOR(1 DOWNTO 0):= "00"; BEGIN IF (CLK = ‘1’) THEN CASE STATE IS WHEN "00" => -- State A IF (X = '0') THEN STATE := "00"; W <= '0'; ELSE STATE := "01"; W <= '0'; END IF; WHEN "01" => -- State B IF (X = '1') THEN STATE := "10"; W <= '0'; ELSE STATE := "00"; W <= '0'; END IF; ENTITY seq_det IS PORT ( CLK : IN STD_LOGIC; X : IN STD_LOGIC; W : OUT STD_LOGIC ); END seq_det; Continued…

7 6/27/20067 WHEN "10" => -- State C IF (X = '1') THEN STATE := "10"; W <= '0'; ELSE STATE := "11"; W <= '1'; END IF; WHEN OTHERS => -- State D IF (X = '1') THEN STATE := "01"; W <= '0'; ELSE STATE := "00"; W <= '0'; END IF; END CASE; END IF; END PROCESS; END seq_det_arch; VHDL implementation for a sequence detector 110 Lecture Notes – Lab 5

8 6/27/20068 VHDL implementation for a sequence detector 110 Lecture Notes – Lab 5 Simulation waveform

9 6/27/20069 Enumerated Types Lecture Notes – Lab 5 VHDL supports the definition of new language types defined by the programmer. Examples: type state_type is (state0, state1, state2, state3); type state_type2 is (A, B, C, D); type instr_code is (add, sub, beq, load, read); The definition explicitly enumarates all possible values that a variable or signal of this type can assume. See sequence.vhd

10 6/27/200610 signal_name’event function attribute Lecture Notes – Lab 5 signal_name’event function attribute returns a Boolean value signifying a change in value on this signal. Example: state_register: process (clk, reset) if (reset = '1') then state <= A; elsif (clk'event and clk = '1') then --if not, and rising state <= next_state; end if; end process;

11 6/27/200611 Design a sequence detector Lecture Notes – Lab 5 -Specs - Synchronous with CLK - Serial input X - The sequence to be detected is 00101 - Output Z: 00000 when no sequence is detected, 00001 when the first bit of the sequence is detected, 00010 when the second bit is detected, 00100 when the third bit is detected, 01000 when the fourth bit is detected, and 10000 when the whole sequence is detected - If input Y is one, the system is reset to output 00000

12 6/27/200612 Design a sequence detector Lecture Notes – Lab 5 - Step 1: Block diagram of the system - Step 2: Design the state machine for the system - Step 3: Implement the system in VHDL - Step 4: Simulate the system implemented in step 4 - Step 5: Program the Xilinx chip and test the system


Download ppt "6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a."

Similar presentations


Ads by Google