Computers are capable of dizzying feats, but they’re built from humble origins. At the lowest level, computers run on electric currents limited to two states: power or no power.
There are many ways to represent the two states:
0 for the remainder of the lesson. This piece of information (power or no power) localized to a single location is called a bit.
Logic gates receive one or more inputs of current and alter the power according to their rules.
Some logic gates will only output power if both of their inputs are powered:
logic_gate(1, 1) # 1 logic_gate(0, 1) # 0 logic_gate(1, 0) # 0 logic_gate(0, 0) # 0
Other logic gates output power if either of the inputs are powered:
logic_gate(1, 1) # 1 logic_gate(0, 1) # 1 logic_gate(1, 0) # 1 logic_gate(0, 0) # 0
Click on the inputs to activate their current and see how power is routed through the collected logic gates.