2 bit selection ina register VHDL

Discussion in 'VHDL' started by Govinda, Aug 2, 2007.

  1. Govinda

    Govinda

    Joined:
    Aug 2, 2007
    Messages:
    7
    Likes Received:
    0
    Hi,

    Can anyone here please help me in figuring out how to do this? My circuit has to select the first two bits that are '1' in a 16 bit register that could have any number of ones, randomly spreadout. I'm a VHDL and logic design newbie and would appreciate ideas on this one. The software implementation is quite straight forward for this one but I'm having trouble in 'thinking hardware'

    Thanks,
    G
     
    Govinda, Aug 2, 2007
    #1
    1. Advertisements

  2. Govinda

    sridar

    Joined:
    Jun 5, 2007
    Messages:
    51
    Likes Received:
    0
    Hi,

    with the state machine you can do it.

    State machine will be in state1(initial state).

    Go to the next state (state2) if the bit in register is '1'.

    Then select the next state(state3), if the bit is again '1' else start with the initial state again.

    code (you) will be in state3 only if two bits are consequtively.
     
    sridar, Aug 3, 2007
    #2
    1. Advertisements

  3. Govinda

    sridar

    Joined:
    Jun 5, 2007
    Messages:
    51
    Likes Received:
    0
    Hi,

    with the state machine you can do it.

    State machine will be in state1(initial state).

    Go to the next state (state2) if the bit in register is '1'.

    Then select the next state(state3), if the bit is again '1' else start with the initial state again.

    code (you) will be in state3 only if two bits are consequtively.

    Regards,

    Sridar S
    (VHDL long live!)
     
    sridar, Aug 3, 2007
    #3
  4. Govinda

    Govinda

    Joined:
    Aug 2, 2007
    Messages:
    7
    Likes Received:
    0
    Sorry for not being clear before. I dont have a clock to run my state machine on. I may use a signal for reset(or loading new data into the register) but cannot use any signal to help in the state transition. Is htere a combinatorial way to do this?

    G
     
    Govinda, Aug 5, 2007
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.