string recognize and led

Discussion in 'VHDL' started by Amit, Nov 8, 2007.

  1. Amit

    Amit Guest

    Hello group,

    I'm writing a code to recognize two strings of 0s and 1s base on a
    Moore machine. The goal is to wait for two numbers (let's say 75). One
    string will represent 7 and the other represents 5.

    Let's say:

    5= 000010000100
    7= 000010000110


    Now, when the appropriate string (digit) is recongnized the number
    must be displayed on an LED on Altera board (DE2). I understand that
    I have to add a mulitplexer to do this but the thing I am not sure
    that how can I keep the number (7) intact till recognizing the next
    appropriate number (5)? (other numbers must be ignored)

    Do I need a latch? if this is right, then can I only simulate it using
    if statement?

    Regards,
    ak
    Amit, Nov 8, 2007
    #1
    1. Advertising

  2. Amit

    KJ Guest

    "Amit" <> wrote in message
    news:...
    >
    > Hello group,
    >
    > I'm writing a code to recognize two strings of 0s and 1s base on a
    > Moore machine.

    Not how I would approach it, but OK.

    > The goal is to wait for two numbers (let's say 75). One
    > string will represent 7 and the other represents 5.
    >
    > Let's say:
    >
    > 5= 000010000100
    > 7= 000010000110
    >
    >
    > Now, when the appropriate string (digit) is recongnized the number
    > must be displayed on an LED on Altera board (DE2). I understand that
    > I have to add a mulitplexer to do this but the thing I am not sure
    > that how can I keep the number (7) intact till recognizing the next
    > appropriate number (5)? (other numbers must be ignored)

    process(Clock)
    begin
    if rising_edge(Clock) then
    if (Input_String = "000010000100") then
    Led_Display <= Whatever you need to display a '5'
    elsif (Input_String = "000010000110") then
    Led_Display <= Whatever you need to display a '7'
    end if;
    end if;
    end process;
    >
    > Do I need a latch?

    A flip flop(s) to hold the data.

    > if this is right, then can I only simulate it using
    > if statement?
    >

    Why restrict yourself to only one statement type. Use the appropriate
    statements.

    KJ
    KJ, Nov 8, 2007
    #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. network lines

    VHDL code to light up LED???

    network lines, May 25, 2004, in forum: VHDL
    Replies:
    8
    Views:
    8,528
    Symon
    May 27, 2004
  2. Flemming Hansen

    LED decoder with CoolRunner II

    Flemming Hansen, Jan 9, 2006, in forum: VHDL
    Replies:
    5
    Views:
    1,613
    Mike Treseler
    Jan 23, 2006
  3. Replies:
    1
    Views:
    559
    Chris Lambacher
    Jul 31, 2006
  4. =?iso-8859-1?q?J=FCrgen_Gerstacker?=

    A swing/awt component that looks like a LED

    =?iso-8859-1?q?J=FCrgen_Gerstacker?=, Dec 15, 2006, in forum: Java
    Replies:
    2
    Views:
    1,077
    =?iso-8859-1?q?J=FCrgen_Gerstacker?=
    Dec 17, 2006
  5. XRay123

    LED Flashing

    XRay123, Mar 11, 2010, in forum: VHDL
    Replies:
    2
    Views:
    1,587
    XRay123
    Mar 21, 2010
Loading...

Share This Page