Push Button

A momentary source: it outputs logic HIGH (1) only while you hold it pressed and springs back to logic LOW (0) the instant you release. This mirrors a real push button wired with a pull-down resistor, whose default idle state is 0 and which is pulled to 1 only while the contact is closed. It is the tool of choice for generating a short, deliberate pulse, such as a manual clock tick or a one-shot trigger.

Basic

Pressed versus released

At rest the button reads 0. Press and hold it and its output goes to logic HIGH (1) for exactly as long as you keep it down; let go and it snaps back to 0. Unlike a switch, it does not remember its state, so it cannot latch anything on its own.

StateOutput
Released0
Pressed1
Intermediate

Pull-down: the meaning of the idle 0

In hardware a floating input is neither a clean 1 nor a clean 0, so a real button needs a pull-down resistor tying its line to ground. That resistor holds the output at a defined logic LOW (0) while the button is open, and closing the button connects it to VCC to force a logic HIGH (1). The simulated button already behaves this way: active-high, defined at 0 when idle.

Pull-down: the meaning of the idle 0
Advanced

A one-shot clock pulse

Wire the button to the clock input of a flip-flop or counter. Each press produces one 0-to-1-to-0 pulse, and the rising edge advances the sequential element exactly once, letting you step a design by hand. In real boards this pulse must first be debounced, because mechanical contacts bounce and would otherwise fire several edges per press.

A one-shot clock pulse

Citations

  • Texas Instruments. (2011). Choosing an appropriate pull-up/pull-down resistor for open drain outputs (Report No. SLVA485). Reference 1
  • Horowitz, P., & Hill, W. (2015). The art of electronics (3rd ed.). Cambridge University Press. Reference 2