2 bit selection ina register VHDL

Joined
Aug 2, 2007
Messages
7
Reaction score
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
 
Joined
Jun 5, 2007
Messages
51
Reaction score
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.
 
Joined
Jun 5, 2007
Messages
51
Reaction score
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!)
 
Joined
Aug 2, 2007
Messages
7
Reaction score
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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top