2 bit selection ina register VHDL

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

  1. Govinda

    Govinda

    Joined:
    Aug 2, 2007
    Messages:
    7
    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. Advertising

  2. Govinda

    sridar

    Joined:
    Jun 5, 2007
    Messages:
    51
    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. Advertising

  3. Govinda

    sridar

    Joined:
    Jun 5, 2007
    Messages:
    51
    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
    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. 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. Christian Vallant

    8 bit into 256 bit shift register

    Christian Vallant, May 23, 2006, in forum: VHDL
    Replies:
    8
    Views:
    4,071
    Mike Treseler
    May 24, 2006
  2. markryde@gmail.com
    Replies:
    3
    Views:
    1,863
    Timothy Bendfelt
    Jan 19, 2007
  3. benn686@hotmail.com
    Replies:
    9
    Views:
    1,061
    Juha Nieminen
    Aug 22, 2007
  4. Jeff.M
    Replies:
    6
    Views:
    206
    Lasse Reichstein Nielsen
    May 4, 2009
  5. lokesh kumar
    Replies:
    1
    Views:
    430
    goouse99@gmail.com
    Jul 12, 2013
Loading...

Share This Page