test pattern

Discussion in 'VHDL' started by martstev@gmail.com, Jan 14, 2009.

  1. Guest

    I am still learning VHDL and need some help please! This is what i
    have

    clk: in std_logic;
    data : in std_logic_vector ( 3 downto 0);
    data_out: out std_logic_vector (3 downto 0);

    clock is running at 20 MHz and data is synchronized with the clock.

    if data is in this order "1111", "1010" "1111", "xxxx" than, data out
    is "xxxx". So basically I have to look at the data pattern back to
    back and then activate my output..if pattern matches, "1111", "0xa"
    and "0xb", output is good to go, else have just wait...

    I was thinking to have data stored in FIFO and the have some sort of
    state machine to look for test pattern..but not sure if that's the
    best of doing this...any advice???
     
    , Jan 14, 2009
    #1
    1. Advertising

  2. LittleAlex Guest

    On Jan 14, 8:33 am, wrote:
    > I am still learning VHDL and need some help please! This is what i
    > have
    >
    > clk: in std_logic;
    > data : in std_logic_vector ( 3 downto 0);
    > data_out: out std_logic_vector (3 downto 0);
    >
    > clock is running at 20 MHz and data is synchronized with the clock.
    >
    > if data is in this order "1111", "1010" "1111", "xxxx" than, data out
    > is "xxxx". So basically I have to look at the data pattern back to
    > back and then activate my output..if pattern matches, "1111", "0xa"
    > and "0xb", output is good to go, else have just wait...
    >
    > I was thinking to have data stored in FIFO and the have some sort of
    > state machine to look for test pattern..but not sure if that's the
    > best of doing this...any advice???


    If I understand your question, you are looking for the sequence 'F'
    'A' 'B', and if found, output the data.

    This is a classic state-machine learning/homework study exercise.

    There is no need to store the codes while waiting for the pattern.
    When you get to the 'found' state, you know what the 3 previous codes
    are.

    That should be enough to get you started.

    AL
     
    LittleAlex, Jan 14, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    17
    Views:
    1,893
    Chris Uppal
    Nov 16, 2005
  2. sunny
    Replies:
    1
    Views:
    471
    Salt_Peter
    Dec 7, 2006
  3. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    726
    Skybuck Flying
    Oct 4, 2009
  4. Pallav singh
    Replies:
    0
    Views:
    375
    Pallav singh
    Jan 22, 2012
  5. Pallav singh
    Replies:
    0
    Views:
    411
    Pallav singh
    Jan 22, 2012
Loading...

Share This Page