I need to design a mod-5 up/down counter with control input x. When x = 0 it will count down, and when x = 1 it will count up. I'm allowed to use only a JK flip-flop and NAND gates. Complement of x is not available.
I thought a 3-bit number which is ABC. I wrote the table and I created a Karnaugh map for A which is the first digit. I am stuck there because the function I got for A is (A'.B'.C'.x'+B.C.x) and I couldn't find any way to implement this function with the given gates.
The final step must be in the JK flip-flop to make it synchronize with the clock.
I have been thinking for two hours about this. Can you give me a way to implement this function?
Note: Complements of A, B, and C are available and logic levels 1 and 0 are available.