COMPUTABILITY THEORY

Turing machine for binary increment

This machine increments a binary number by one. State qScan moves right over the input until it reaches a blank B immediately after the final digit. It then moves one cell left and enters qCarry. In qCarry, every trailing 1 is replaced by 0 while the head moves left, carrying the addition toward the most significant bit. When it finds a 0, the machine writes 1 and accepts. If it instead finds a blank, the original word consisted entirely of 1s, so it writes a new leading 1. For example, 1011 becomes 1100 and 111 becomes 1000. Each edge label makes the tape operation explicit.

UPDATED 2026-09-24
TYPEState
EXAMPLETuring machine for binary increment
Make this diagram your own.

Open it in the AI editor with a prompt pre-filled — keep what works, change what doesn't.

CASE ANALYSIS

Scenario

Binary carry propagation

Key decisions

  • Right scan: qScan finds the right edge of the binary word.
  • Carry loop: every trailing 1 becomes 0 while the carry moves left.
  • Overflow case: a blank becomes 1 when the input contains only 1s.

When to reuse this

Use this state pattern to explain how a Turing machine implements binary addition one tape cell at a time.

FAQ

Frequently asked questions

Why are trailing 1s changed to 0?01
Adding one to a binary 1 produces 0 with a carry into the digit to its left.
What happens to 111?02
The carry runs past the left edge and writes a new 1, producing 1000.
Why does qScan move right first?03
Binary addition starts at the least significant digit, which is at the right end of the input.
Open this example in the editor →

Tweak it with chat, export PNG/SVG, or fork it for your own use case.