Hi all
I have this project (to be implemented with IC chips on breadboard) where basically i have to:
1) Check the difference of 2 inputs (I0, I1), and if it is equal to a fixed value (for e.g 7)
2) If so light up a green LED.
3) If not (failed tries = 1), reset the circuit and allow user to input in the correct value again.
4) If the value is still incorrect (failed tries = 2), lock the circuit.
The problem i am having now is how to implement the memory portion of "failed tries".
I initally thought that since for step 1, i used a combination of AND and NOT gates to force the output to be 1 only if the fixed value 7 is met. So this would imply that the output is 0 when the value is not met.
As such i would use the 0 from the output as indication that the user has inputted in a wrong value and feed it into a flip-flop (e.g D flip flop), saving it into its output as 1 to indicate failed tries = 1.
However the problem occurs when the user inputs the wrong value again
(failed tries = 2).
I tried to tie the first flip flop output (with failed tries = 1) to the 2nd flip flop (which is supposed to store failed tries = 2).
I thought this might work but upon simulation, i noticed that since the output of my check difference of inputs (in step 1) is also 0 when the user fails (the AND and NOT gate combination could not discriminate between 1st and 2nd try), tying the 1st flip flop o/p (try1) to the 2nd flip flop o/p (try2) will result in an immediate change in try2 (try1 = 1, try2 = 1), indicating that 2 tries are up, which is not what happened.
Sorry for the confusing post, hope that the attached diagram helps. The V1 to V4 represent the result of part 1 (i.e. the difference between the 2 inputs (which are not shown)).
Any advice on how to go about this memory problem is greatly appreciated
Thanks.
I have this project (to be implemented with IC chips on breadboard) where basically i have to:
1) Check the difference of 2 inputs (I0, I1), and if it is equal to a fixed value (for e.g 7)
2) If so light up a green LED.
3) If not (failed tries = 1), reset the circuit and allow user to input in the correct value again.
4) If the value is still incorrect (failed tries = 2), lock the circuit.
The problem i am having now is how to implement the memory portion of "failed tries".
I initally thought that since for step 1, i used a combination of AND and NOT gates to force the output to be 1 only if the fixed value 7 is met. So this would imply that the output is 0 when the value is not met.
As such i would use the 0 from the output as indication that the user has inputted in a wrong value and feed it into a flip-flop (e.g D flip flop), saving it into its output as 1 to indicate failed tries = 1.
However the problem occurs when the user inputs the wrong value again
(failed tries = 2).
I tried to tie the first flip flop output (with failed tries = 1) to the 2nd flip flop (which is supposed to store failed tries = 2).
I thought this might work but upon simulation, i noticed that since the output of my check difference of inputs (in step 1) is also 0 when the user fails (the AND and NOT gate combination could not discriminate between 1st and 2nd try), tying the 1st flip flop o/p (try1) to the 2nd flip flop o/p (try2) will result in an immediate change in try2 (try1 = 1, try2 = 1), indicating that 2 tries are up, which is not what happened.
Sorry for the confusing post, hope that the attached diagram helps. The V1 to V4 represent the result of part 1 (i.e. the difference between the 2 inputs (which are not shown)).
Any advice on how to go about this memory problem is greatly appreciated
Thanks.
Last edited: