



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




v.1.0.
Contents 1 Sequence Detector for the sequence โ1011โ 3 1.1 Introduction................................. 3 1.2 Objectives.................................. 3 1.3 Design Example............................... 3 1.4 Testbench.................................. 6 2 Assignment 7
1 0 1
1 use ieee.std_logic_1164.all; 2 3 entity sequence_decoder is 4 5 port ( 6 clk : in std_logic; 7 n_rst : in std_logic; 8 d_in : in std_logic; 9 d_out : out std_logic); 10 11 end sequence_decoder; 12 13 architecture sequence_decoder_arch of sequence_decoder is 14 15 -- Define a enumeration type for the states 16 type state_type is (s0, s1, s2, s4); 17 18 -- Define the needed internal signals 19 signal current_state, next_state : state_type; 20 21 begin -- sequence_decoder_arch 22 23 -- purpose: Implements the registers for the sequence decoder 24 -- type : sequential 25 -- inputs : clk, rst, next_state 26 -- outputs: current_state 27 reg: process (clk, rst) -- The register process 28 begin -- process register 29 if rst = โ1โ then -- asynchronous reset (active high) 30 current_state <= ???; 31 elsif clkโevent and clk = โ1โ then -- rising clock edge
d_in clk rst d_out Figure 4: Block diagram of the testing environment 2 Assignment You have to perform the following tasks and in-order to get approved on this assignment you are required to complete all tasks in time: