12-03-2010 02:57 AM
Hello,
I'm trying to simulate a 2 binary counter using JK-FF but is is not working. I tried another way such as testing 2 JK-FF with individual clock (clock 1 and clock 2) and LED (LED 1 and LED 2). When clock 1 is ON, clock 2 is OFF, LED 1 and LED 2 is on. I spent a week to solve the problem but it doesnt work. Please, help me. Thanks.
Solved! Go to Solution.
12-03-2010 04:45 PM
Hi Joebui,
Here is another forum that deals with building a JK flip-flip that make prove helpful. There is also a community example that deals with building a flip-flop. Notice how this example uses case structures instead of multiple logical gates. A case structure will make your code cleaner and will be easier to debug.
Hope this helps,
Starla T.
12-03-2010 09:15 PM
Thank for your reply. I'm trying to build another JK-FF which use case structure. I think my JK flip flop is ok because I double check it with a truth table and it works fine. My problem here is when I put 2 individual JK flip flop in the same block diagram with individual clock and LED, the second JK's LED run when clock is low and another is high. Can you explain why we can't use multiple logic gates?
12-05-2010 12:29 PM
Go to VI properties, Execution for your flip-flop subVI and make it reentrant. That way each instance has its own memory state. As it is now as non-reentrant, each call to the subVI only goes to a single memory state and thus the other flip-flop is remembering the how the feedback registers were set in the other case where it was called.
12-06-2010 10:20 AM
Joebui:
Here is the code I promised you. Let me know if you have questions.
12-06-2010 12:25 PM
@Raven Fan: Thank you very much for your helping.