Electronic – Creating a simple toggle

digital-logicflipflopintegrated-circuit

I have a signal that goes high at random intervals, and I would like to have each rising edge toggle an output. Something like this:

I've looked into flip-flops, but they all seem more complicated than what I'm looking forĀ (I don't understand why most of them need a clock). Is a flip-flop the appropriate component to achieve these results? If so, which one?

Best Answer

A D flip-flop is the (or at least a) solution for this. You would connect your input signal to the flip-flop's clock input, and the ~Q output of the flip-flop back to the D input. There are also T flip-flops that effectively have the ~Q to D connection internally.

If the flip-flop you choose has Set and Clear (or Reset) inputs, they should be connected to whatever level will allow the flip-flop to operate (usually High, I think).