MAKE // mistermills.tech

Inputs, Logic and Outputs

Input and output devices, true and false, and the logic gates that decide what a computer does with an input.

Watch: How Computers Work: Circuits & Logic (Code.org)

Inputs and outputs#

Input device
Sends data into a computer. A keyboard and mouse send binary signals when their buttons are pressed.
Output device
Receives data from a computer and turns it into something a person can see, hear or feel. A monitor receives binary data and displays it using red, green and blue sub-pixels.

Some devices are both.

On your whiteboards

Draw a Venn diagram with Input on one side, Output on the other, and Both in the middle. Sort these into it:

keyboard, mouse, monitor, speakers, microphone, webcam, printer, touchscreen, game controller, headset with a microphone, a micro:bit’s buttons, a micro:bit’s LEDs, a Minecraft lever, a redstone lamp

Read: Input & output devices (Khan Academy)

True or false#

Boolean
A binary variable, having two possible values, sometimes referred to as “true” (1) or “false” (0).
Truth Table
A diagram made of rows and columns showing all the possible boolean outputs that a given set of boolean inputs can generate.

On your whiteboards

Evaluate each of these as TRUE or FALSE:

  1. I have two siblings
  2. The door is shut
  3. It is raining
  4. The year 2012 is in the past

Logic gates#

Logic Gate
A device that produces a single Boolean output from one or more inputs.

Each gate has a symbol, used in circuit diagrams. The inputs are on the left (A and B) and the output is on the right (Q).

The symbols for the NOT, AND, OR and XOR gates

Watch: Boolean Logic & Logic Gates (CrashCourse)

NOT#

A device which outputs the opposite of an input signal.

A Q
0 1
1 0

AND#

A device which only outputs a 1 if BOTH inputs are 1.

A B Q
0 0 0
0 1 0
1 0 0
1 1 1

OR#

A device which outputs a 1 if either of its inputs are 1.

A B Q
0 0 0
0 1 1
1 0 1
1 1 1

XOR#

An eXclusive OR gate. A device that outputs a 1 if and only if one of its inputs is 1, but not if both inputs are 1.

A B Q
0 0 0
0 1 1
1 0 1
1 1 0

On your whiteboards

Which gate matches each of these?

  1. A microwave only runs when the door is closed and the start button is pressed.
  2. A car’s inside light comes on when the driver’s door or the passenger’s door is open.
  3. A fridge light is on when the door is not closed.
  4. A hallway light has a switch at each end. Flipping either switch changes the light.

Logic circuits#

Logic Circuit
An electrical device that combines two or more logic gates to produce one or many outputs.

The output of one gate can become an input to another gate.

A circuit where A AND B feeds one input of an XOR gate, and C feeds the other

On your whiteboards

Complete the truth table for the circuit above. With three inputs there are 8 rows, starting at 0 0 0 and ending at 1 1 1.

Read: Logic Gates and Logic Circuits (Khan Academy)

Memory#

Every circuit above forgets. As soon as an input turns off, its output changes back. A computer also needs to remember things: which apps are open, what you have typed, and every number it is in the middle of working out.

Memory
A circuit that keeps its output after its input has gone away.
Bit
One ON or OFF fact. The smallest thing a memory circuit can store.

The trick to memory is a loop. If a gate’s output is wired back into its own input, the circuit can hold itself in place. Nothing has to keep pressing a button.

RS latch#

An RS latch has two inputs, Set (S) and Reset (R), and one output (Q). It is made of two NOT gates wired in a loop, so each gate keeps the other one in place.

  • Pressing Set turns the output ON.
  • Pressing Reset turns the output OFF.
  • When neither is pressed, the output stays the same as it was last.
S R Q
0 0 stays the same
1 0 1
0 1 0

Pressing both at once is not used, because the latch can not be ON and OFF at the same time.

When you press Set and let go, the button’s signal is gone, but the loop has already flipped to its ON position and holds itself there. That is how it stores one bit: the latch is always resting in one of two positions, and the position it is resting in is the fact it remembers.

T flip-flop#

A T flip-flop (T for Toggle) has one input and one output. Each time the input gets a pulse (a short ON, like a button press), the output flips to the opposite of what it was, and stays there.

Output before the pulse Output after the pulse
0 1
1 0

A T flip-flop turns a temporary input (a button that pops back out) into a permanent switch (like a lever). A click pen works the same way: one click and the tip stays out, another click and it stays in.

On your whiteboards

For each of these, decide whether it needs an RS latch (separate ON and OFF buttons) or a T flip-flop (one button that toggles):

  1. A laptop’s power button
  2. A burglar alarm that turns on when a window opens, and only turns off when the owner types a code
  3. The caps lock key
  4. A “call for help” light on a hospital bed that a nurse switches off

Clocks and timers#

Clock signal
A signal that turns ON and OFF over and over by itself, at a steady speed.
Frequency
How many ON-OFF cycles a clock makes every second.
Timer
A circuit that waits a set amount of time, then does something once.
A clock signal switching between ON and OFF at a steady rate

A computer’s clock keeps all of its parts working in step, like a drummer keeping a band in time. On every tick, each part of the processor does one small step of its work. A processor advertised at 3 GHz has a clock that ticks about 3 billion times every second. A redstone clock can tick at most a few times a second.

A clock can be made by feeding a NOT gate’s output back into its own input, through a delay. The output flips, the flip travels around the loop, and when it arrives the output flips again. A longer delay means a slower clock (a lower frequency).

A clock that runs forever wastes power and gets in the way, so clocks usually have an enable switch. The clock only runs while the enable switch is ON.

A timer is just a delay. A microwave counts down and then beeps once. A traffic light waits a set time before changing. Clocks and timers are often used together: a timer can count clock ticks, and do something after a certain number of them.

On your whiteboards

  1. Name three things in your home that use a timer.
  2. A clock takes 2 seconds to make one full ON-OFF cycle. How many cycles does it make in one minute?
  3. Why would a game console need its clock to be much faster than a microwave’s timer?

Creating an IPO Table#

  1. Input: a device senses something about the world (a player stepping on a plate, an arrow hitting a target, the sun going down).
  2. Process: logic gates, memory and clocks decide what that means.
  3. Output: a device communicates the decision back to the user, by something they can see, hear or feel.

Example IPO chart

Front door
Input A pressure plate outside the door, and a lever inside labelled “Lock”
Process The door opens if the plate is pressed AND the lock is NOT on. Plate AND (NOT Lock)
Output Sticky pistons pull the wall open (movement), and a note block on a gold block rings (sound)
Why these parts A plate is hands-free, like a real automatic door. The bell tells someone inside that a visitor arrived.
Edit this page

Last updated 23 Oct 2026

↑↓ to move · Enter to open