Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

state machine

i have a array of signed 16 integer data(8,7,-1,1,5,6,2---),i want to design a state machine in vhdl with three state,in first state i need to calculate the number of ones,in 2nd state number of zeros and finally count other number. how can i start

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    defining your states is probably a good start:

    type state_t is (count_ones, count_zeros, count_others);
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ill leave the rest of your homework up to you. When you actually get stuck - come back here with further specific questions. We're not here to do your assignment for you.