JK flip flop random start outputs
There is nothing in the specifications, nor in the internal schematics, that defines what the outputs of a JK flip-flop should be at power-on.  The only way of getting a known state is to use the CLR input of the chip, which resets the whole chip into a known state.
The normal way of doing this is to hold CLR low for a short period while the chip powers up, and only then release it to HIGH.  The simplest way to do this is with a capacitor and resistor on the pin.




simulate this circuit &ndash; Schematic created using CircuitLab
You will need to experiment to get the component values right for your situation.  The larger the values the slower the capacitor will charge, and the longer the delay before the CLR pin goes high.  R2 acts as a &quot;bleed&quot; resistor to remove the charge from the capacitor ready for the next power-on. It should be much higher than the charge resistor R1 as the two of them act like a voltage divider defining the maximum level of the capacitor's charge.  It may or may not be needed depending on the self-discharge of the capacitor and leakage current of the CLR pin when VCC is removed.