Digital counter trapped in X state

Posted by admin 12/11/2015 0 Comment(s) FAQs,

I built a counter in Micro-Cap using JK flip-flops with both the J and K inputs set to 1 so that the output will toggle with the active clock edge. When I run transient analysis, the outputs of the flip-flops are always in an X state. What is going wrong?

 

The flip-flops are being initialized to an X, unknown, state. Since the state is unknown, when the flip-flop toggles, it can only go to another unknown state so the outputs are fixed at the X state. To get past this problem, the flip-flops must be initialized to a 0 or a 1. To do this, a digital stimulus may be placed at either the clear or preset input to provide an initializing pulse. A second method would be to set the DIGINITSTATE parameter in the Global Settings. Setting this parameter to 0 will set the Q output of all latches and flip-flops in the circuit to the 0 state at the beginning of the simulation. Setting the parameter to 1 initializes them all to the 1 state, and setting the parameter to 2 initializes them all to the X state.