您将学到什么

  • Identify the input switch and output light as digital I/O primitives.
  • Trace a single signal from source to sink.
  • Recognize that 'no logic' is still a valid circuit — just a wire.
  • Connect this to physical buttons and LEDs in microcontroller projects.
  • Build the mental model that more-complex circuits add gates to this base.

工作原理

The simplest circuit you can build: an input switch wired directly to an output light. Flipping the switch turns the light on; releasing turns it off. No gates, no logic — just a direct wire.

Why include this in a logic simulator? Because it teaches the I/O abstraction: switches produce digital values (0 or 1), lights consume them. Every more-elaborate circuit ultimately reduces to this — sources of truth flowing through some logic to drive observable outputs.

The schematic introduces three primitives: 1. Input switch: A user-controlled toggle producing 0 or 1. 2. Wire: A logical connection that transmits the same value end-to-end. 3. Output light: A visualizer that lights up when its input is 1.

From this base, every other DigiSim circuit adds gates between the switch and the light to compute *something* about the input(s). Mastering this template means you can read schematics: where signals enter, where they exit, and what flows where.

真值表

Just two rows — one input, one output, identity function.

输入 输出
Switch Light
0 0 Switch off → light off
1 1 Switch on → light on

布尔表达式

Y=AY = A

The output equals the input — identity function. No logic, just a wire.

逐步尝试

在上方嵌入式电路中设置输入,然后阅读预期结果并验证。

  1. 1
    Switch = 0
    预期: Light = 0
    您将看到: Switch off — light dark. The starting state of any unpowered circuit.
  2. 2
    Switch = 1
    预期: Light = 1
    您将看到: Switch on — light on. The input signal flows directly to the output without modification.

使用的组件

实际应用

Pull-up / pull-down resistor inputs. Microcontrollers reading button presses use the same I/O abstraction — a button is the switch, an LED is the light, and the GPIO line carries the digital signal.

LED indicators. Power lights, status lights, fault lights — any LED on a control panel is the simplest output light driven by a logic signal.

Test fixtures. Bench testing a digital signal often involves driving it with a switch and observing it with an LED to confirm the path is intact.

Educational starting point. Every introductory digital electronics class begins with switch + LED to establish the I/O model before introducing logic gates.

常见问题

Why is this called a circuit if there are no gates?
A circuit is any connected collection of components, with or without logic. A switch + light + wire is a complete circuit, even if the only function is identity. More elaborate circuits add gates between the input and output.
Could this be useful in a real product?
Yes — every LED indicator on a control panel is essentially this circuit (with a current-limiting resistor in the physical version). Status lights for power, fault indicators, activity LEDs all work this way.
What's the difference between this and a buffer?
A buffer also implements Y = A but provides drive-strength amplification. A wire passes the signal at the source's drive strength; a buffer regenerates a clean, full-strength signal. For long wires or high fan-out, you need a buffer; for short signal paths a wire is fine.
How is this different from analog electronics?
In digital, the signal is 0 or 1 — the wire transmits one of two discrete states. In analog, the wire carries any voltage in a continuous range. Digital simulators abstract over the analog physics; here, switch on means "input voltage above threshold," but you only see 0 or 1.
Why include this in a simulator with hundreds of complex circuits?
It's the entry point. Anyone new to digital logic should start here, see how the simulator represents I/O, and then add gates from this base. Every more-complex circuit decomposes back to switches and lights at the I/O level.

继续学习