Sequence Detector (Mealy Machine-1011) VHDL Code
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-O7m-C7qf8kUZtvzIonqrhXV5p_3U5aYjfyFhhic3ReIO7l5eWiWGhLgKdauh-Kp3FTKpFdt8IBBFpCguDcSeQiwn66zboxucPG6zwsXFYy78S7lmYw4yh7ILsaJhZ7DjKBxEsjd292BIEzs7sduDgPaRG3kn9SHJ8XVu-PsIcY_8En5w5zpKjbU3EA/w205-h220/New%20Bitmap%20Image.bmp)
A sequence detector is a sequential circuit that outputs '1' when a particular pattern of bits sequentially arrives at its data input. A sequence detector typically has 1-bit Data Input, CLOCK Input and RESET Input. It generates 1-Bit Output. In this design, circuit receives input at W, generates output on Z. Every change occurs on Positive clock. The design detects occurrence of '1011' (non-overlapping) in the input sequence and produces output '1' after successfully detecting the sequence. VHDL Code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity Mealy_1011 is Port ( W, clk, reset : in STD_LOGIC; z : out STD_LOGIC); end Mealy_1011; architecture Behavioral of Mealy_1011 is type state_type is (a,b,c,d); signal Y : state_type; begin process(clk,reset) begin if(reset ='1') then Y <= A; ELSIF(RISING_EDGE(CLK)) THEN CASE Y IS WHEN A => IF(W='0') THEN y <= A; z <= '0