Electronic – Up/Down Counter Not Counting Down

counter

I'm trying to build a 2 bit counter using JK flip flops. In the simulation it counts up just fine, but when I switch it to count down, it starts at 3 and then goes to zero and counts up again. The clock is connected to a 555 timer, just didnt show it.

enter image description here

Design equation:

Y = M'Q + MQ'

Where Y is the output, those AND and OR gates. M is the control input (switch), it counts down if M = 1 (closed switch) and up if M = 0 (open switch)

Best Answer

The flip flops contain the true count state and it seems that you should be using them to drive your display.

What happens if you disconnect wires to U14 A & B and connect
U14A to U15A pin 5 and
U14B to U2A pin 5.

ie take the two Q outputs as outputs.