Up/Down Counter Not Counting Down

  • Thread starter Thread starter TheRedDevil18
  • Start date Start date
  • Tags Tags
    Counter Counting
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
TheRedDevil18
Messages
406
Reaction score
2

Homework Statement


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.

Homework Equations

The Attempt at a Solution


[/B]
Here is my circuit diagram:
upload_2016-8-27_22-3-42.png


When the switch is closed it should count down, and when it's open, it should count up. The clock is connected to a 555 timer, just didnt show it.
 
Physics news on Phys.org
TheRedDevil18 said:

Homework Statement


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.

Homework Equations

The Attempt at a Solution


[/B]
Here is my circuit diagram:
View attachment 105174

When the switch is closed it should count down, and when it's open, it should count up. The clock is connected to a 555 timer, just didnt show it.
I'll look more at this, but could you post your design equations?
 
berkeman said:
I'll look more at this, but could you post your design equations?

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)

And the flip flop in the simulation is a 74HC112
 
Your circuit is using the JK flip flops as T flip flops. Look them up; T flip flops change state on every clock cycle.