Electrical – How to design a binary up down counter using D flip flop’s and the ‘up’ or ‘down’ count will be controlled by another flip flop

counterflipflop

I have to design a 4bit Binary Up Down counter using D flip-flops . But here is the catch I cannot directly use a switch to control whether the counter will count up or down, I have to do that using a D flip flop. Any help on how I can solve this?

N.B. I can design an up down counter , but I need to know how to use another D flip flop to control the whether I want up or down count

Best Answer

Without knowing exactly what "using a D flip flop" means, I can provide at least two approaches.

First, instead of a single switch, you can provide two - an up/down switch and a "load control" switch. Using an NO switch operating on the open-to-close action for the control switch can be done by

schematic

simulate this circuit – Schematic created using CircuitLab

But keep in mind that I have provided no debouncing on the clock switch, which you must provide.

Alternatively, if you want the control FF driven by the same clock which drives the counter, you can do it but you have to delay the clock between the control FF and the counter in order to allow a change in the control input to settle before the counter acts on it.

schematic

simulate this circuit

Note that a pair of inverters makes a perfectly usable delay, and multiple pairs of inverters make for longer delays.