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.
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)