Simulator

A flip-flop simulator on real 74HC chips

Mokxi is a free online flip-flop simulator that runs in your browser, with nothing to install and no account needed. Two NAND gates of a 74HC00, each one’s output wired into the other’s input: an SR latch, the smallest circuit that remembers a bit. A slide switch sets and resets it, and two LEDs show Q and Q-bar.

  • 505parts on the bench
  • 45boards running now
  • 1.00xreal time, on every board
An SR latch from two NAND gateslive0.000 s 0.00x
Hold the button
Click the slide switch to set and reset the latch, or click anything else to open it in the editor.

What you can do here

In the circuit above, or in the editor it opens.

  • Set and reset an SR latch made of two cross-coupled NAND gates
  • Clock a 74HC74 D flip-flop from a button and watch it copy D on the edge
  • Build a JK flip-flop, or a T flip-flop that toggles on every clock
  • Chain flip-flops into a counter or a shift register
  • Watch Q and Q-bar on the logic analyzer as the clock runs
  • Package your latch as a chip of your own and reuse it

What the running circuit shows

Two gates that hold each other’s answer.

Each NAND gate’s output goes to one input of the other, and the free input of each, set and reset, is held high by a 10k pull-up. Both are active low: the switch grounds one of them, that gate’s output goes high, and the other gate, now seeing a high on both inputs, goes low and feeds that back. In the engine the latch starts set, with the green Q LED lit and the red Q-bar LED dark; slide the switch and they swap.

The gates are a real 74HC00, powered from its own VCC and GND pins, so the outputs are real voltages: Q sits at about 4.74 V with the green LED lit and about 8.7 mA through it, and Q-bar at about 4.60 V with the red one lit and about 13.2 mA. The 74HC74 on the same bench is a D flip-flop: move its D switch and nothing happens; press the clock button and Q takes the new value on the rising edge, then holds it however D moves.

How the flip-flops are modeled

Chips with pins, thresholds and delays.

Each gate answers by the controlling-value rule: a NAND with a 0 on either input knows its output is 1 even if the other input is still unknown. That is what lets the latch climb out of the unknown state it powers up in, the way a real one does. Every change reaches the output after the 74HC00’s typical 9 nanosecond delay, and an unpowered chip’s outputs float rather than read 0.

What it leaves out: the slide switch here is always on one side or the other, so the moment a real switch spends between its contacts, when both inputs are high and the latch is holding, passes too fast to see. Wire set and reset to two pushbuttons with pull-ups instead and the latch holds its bit while neither is pressed. Metastability, a flip-flop caught exactly on an edge, is not modeled.

How it works

Three steps from a blank tab to a running circuit.

  1. Open the editor

    It runs in your browser tab. Nothing to install, and you need no account to start.

    Your first project
  2. Wire it and write the code

    Drag parts onto a breadboard, run each wire from pin to pin, and write the sketch beside it.

    Wiring
  3. Press Run

    Your sketch compiles in the tab and runs on a model of the chip, with the Serial Monitor beside it.

    Run and serial
Reviews

What makers say about Mokxi.

“The AI checker helps check and correct my circuits, and it has way more components than Tinkercad. As a student I really appreciate the tool.”

ChloeEngineering student

“I’d been looking for a real online electronic simulator that was intuitive and complete when I found Mokxi. I was able to quickly import a Fritzing file and my Arduino sketch and start testing. Mokxi has all of the makings for the best online Arduino simulator I have been able to find!”

JayModel builderFeatured in his DioramaOS post

“I’m using Mokxi to develop and simulate an STM32-based four-wheel-drive robot car before building the actual hardware. It allows me to experiment with DC motor control, PWM, RPM measurement using photointerrupters, and different acceleration, braking, and reversing strategies, helping me understand and refine the system before implementing it in real life.”

NusretRobot car builder, Hamburg

Share your story

FAQ

Questions, answered.

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Can I simulate a JK flip-flop?

Yes. Build one from a 74HC74 and its steering gates, D = J·Q-bar + K-bar·Q, as the flip-flops page does, and tie J and K high for a T flip-flop that toggles on every clock.

What is the difference between a latch and a flip-flop?

A latch, like the one above, follows its inputs whenever they change. A flip-flop changes only on a clock edge: a 74HC74 copies D at the instant its clock rises and ignores D the rest of the time.

Does it work on a Chromebook?

Yes. It runs in Chrome with nothing to install, which is how many school digital electronics classes use it.

More simulators

Each one opens on a circuit that is already running.

Set a latch

Open the circuit, flip the switch and press Run. Nothing to install, and no account needed.