Lab 3 Discussion


You need a way to remember the inputs that are coming in over a number of clock periods until 5 1's have been input and the flip flop fires. When the final 1 input comes in, the flipflop should be set to 1 on the next falling clock. Here are some possible ideas:


  1. You could have a shift register for each of the three inputs. Then you could shift in a 1 every time it appears, and ignore the zeros. Your firing logic would use all 3 inputs plus all register bits to determine whether there were 5 1's input in the past as well as current state. You would need 4 bits of shift register storage for each of the 3 inputs.
  2. Or, you could have a counter for each of the three inputs, counting the 1's as they come in. You would need a 3-bit counter for each input. Your firing logic would use all 3 current inputs plus the counters to determine whether there are 5 inputs total.
  3. Or you could have a single counter that could increment by 1, 2, or 3 when the inputs come in. This is a complicated counter, but you save on storage space. Your firing logic would use all 3 inputs plus the contents of the counter to determine whether there had been 5 1's input.
  4. Or, you could come up with another strategy on your own.

Whatever strategy you use, you should somehow store the 1's that were input in the past. When the stored 1's plus the current inputs are >=5, the AP flipflop should fire.


Note that there will be two logic blocks - one that uses current inputs and stores them, and one that decides whether the AP flipflop should fire.


The timing should be as follows ( I stretched hold time and clock to Q delay so you could see what was happening):