1

3 bit counter

I have 3 D flip flops set up in a counter. Once it reaches 5 (101) I want to set the FF Reset inputs to high (with the OR gate).

The Resets are active low.

This almost works but, when I initially run the program, the Q outputs from the flip flops are all unknown, so, initially, the Reset input is low into the OR gate. BUT, because at first the Q outputs are unknown, the input into the OR gate is unknown. A 0 and an unknown input into the OR gate gives an unknown output, into flip flop's R. The flip flop doesnt know what to do, so Q is unknown, and this just creates a loop of unknowns going around.

Does that make sense? Basically I need a way to initially reset the flip flops in order to get a valid output on the Qs, or they will all be x. Once the FFs are reset, the Qs will take 0s and the circuit should work.

Anyone know a way to set this up?

What I'm trying to do: Get the counter to 5, and then hold the reset values high.

Gate level code (optional, dont need to look at it) (I know it's pretty messy and bad but pls ignore): NAND30 U53 is basically the OR gate in the diagram (diagram is not a 1 to 1 to code). Problem is, co4 and co5 are unknown, as they depend on outputs q1,q2,q3. dreset13 is the output from the NAND gate into the FFs.

Pragash B
  • 21
  • 2
  • So when the counter reaches 5, I want to loop the counter outputs back into the OR gate. This mean the Reset input to the OR gate won't matter, because the other input will be high, so the output of the OR gate will be high. The output feeds into the FF Reset inputs, and will always stay high. (I'm also going to use the preset input to keep it at 5). – Pragash B May 10 '20 at 18:27

1 Answers1

1

At time 0 in simulation, set the Reset input to 1, not 0. Then, after a delay (perhaps a couple clock cycles), set Reset = 0. This will reset the 3 flip flops to 0.

The names of your reset signals (R and Reset) denote active-high resets, meaning reset is asserted when the signal is 1, and released (deasserted) when the signal is 0.

You incorrectly mention "The Resets are active low.". That contradicts your circuit. Active-low reset signals would typically have a _N suffix, and the FF terminal would use a small circle, like the inverter does.

toolic
  • 57,801
  • 17
  • 75
  • 117