Sequence Detector: Experiment No: 10 Activity: To Design and Simulate ' Sequence Detector of 101'' Using VHDL
Sequence Detector: Experiment No: 10 Activity: To Design and Simulate ' Sequence Detector of 101'' Using VHDL
EXPERIMENT NO: 10 Activity: To design and simulate Sequence Detector of 101 using VHDL. CODING:
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity seq_dect is Port ( reset,clk,seq : in std_logic; z : out std_logic); end seq_dect; architecture Behavioral of seq_dect is type state_type is (A,B,C); signal state : state_type := A; begin process(clk,reset) begin if( reset = '1' ) then z <= '0'; state <= A; elsif ( rising_edge(clk) ) then case state is when A => z<= '0'; if ( seq = '0' ) then state <= A; else state <= B; end if; when B => if ( seq = '0' ) then state <= C; else state <= B; end if; when C => if ( seq = '0') then state <= A; else state<=A; z <= '1'; end if; when others => NULL; end case; end if; end process; end Behavioral;
RTL
Waveform: