Computer-science_A-level_Cie
-
computers-and-components6 主题
-
logic-gates-and-logic-circuits2 主题
-
central-processing-unit-cpu-architecture6 主题
-
assembly-language-4 主题
-
bit-manipulation1 主题
-
operating-systems3 主题
-
language-translators2 主题
-
data-security3 主题
-
data-integrity1 主题
-
ethics-and-ownership3 主题
-
database-concepts3 主题
-
database-management-systems-dbms-1 主题
-
data-definition-language-ddl-and-data-manipulation-language-dml1 主题
-
computational-thinking-skills1 主题
-
algorithms14 主题
-
data-types-and-records2 主题
-
arrays2 主题
-
files1 主题
-
introduction-to-abstract-data-types-adt1 主题
-
programming-basics1 主题
-
constructs2 主题
-
structured-programming1 主题
-
program-development-life-cycle2 主题
-
program-design-2 主题
-
program-testing-and-maintenance3 主题
-
user-defined-data-types1 主题
-
file-organisation-and-access-3 主题
-
floating-point-numbers-representation-and-manipulation3 主题
-
protocols2 主题
-
circuit-switching-packet-switching1 主题
-
processors-parallel-processing-and-virtual-machines5 主题
-
boolean-algebra-and-logic-circuits4 主题
-
purposes-of-an-operating-system-os3 主题
-
translation-software3 主题
-
encryption-encryption-protocols-and-digital-certificates3 主题
-
artificial-intelligence-ai4 主题
-
recursion1 主题
-
programming-paradigms4 主题
-
object-oriented-programming7 主题
-
file-processing-and-exception-handling2 主题
-
data-representation5 主题
-
multimedia3 主题
-
compression2 主题
-
networks-and-the-internet11 主题
state-transition-diagrams
State-Transition Diagrams
What are state-transition diagrams?
-
A state-transition diagram shows how a system moves between different states based on inputs
-
Each state represents a condition or situation of the system
-
Transitions are arrows that show movement between states when certain inputs occur
-
Transitions may also produce outputs, shown as labels on the arrows
-
These diagrams model finite-state machines (FSMs), which are widely used in computing
Key elements
|
Element |
Description |
|---|---|
|
State |
Circle labelled with a name (e.g. S1, S2) showing a situation the system can be in |
|
Initial state |
Starting point, sometimes marked with an arrow pointing to it |
|
Transition |
Arrow from one state to another, labelled with input and output |
|
Input |
Event or data that causes a transition (e.g. Button-Y pressed) |
|
Output |
Action or signal produced by a transition (e.g. Output-A) |
|
Next state |
The state the system moves into after the transition |
How to read labels on transitions
-
Labels are often written as Input | Output
-
If no output is produced, “none” may be written
-
Example:
Button-Y | Output-Bmeans pressing Button-Y in the current state produces Output-B and causes a transition to the next state -
The diagram below shows the key features of a state-transition diagram:

-
States are circles labelled S1, S2, etc
-
Transitions are arrows between states, labelled with Input | Output
-
The initial state is marked with an incoming arrow
Completing transition tables
-
Exam questions often ask you to convert a diagram into a table
-
The table normally has columns for Current state, Input, Output, Next state
-
Work through the diagram row by row, following the arrows for each possible input
Example table structure:
|
Current state |
Input |
Output |
Next state |
|---|---|---|---|
|
S1 |
Button-Y |
Output-A |
S2 |
|
S1 |
Button-Z |
Output-B |
S3 |
Examiner Tips and Tricks
-
Always identify the initial state before tracing
-
Highlight or mark inputs and outputs on your diagram to avoid missing one
-
For tables, keep the order consistent: Input → Output → Next state
-
Use arrows systematically, avoid guessing paths
-
Remember: more than one sequence can sometimes reach the same state, but exams often ask for the minimum changes
Worked Example
Part of a program is represented by the following state‑transition diagram

A. Complete the table to show the inputs, outputs and next states.
Assume that the current state for each row is given by the ‘Next state’ on the previous row. For example, the first Input‑A is made when in state S1.
If there is no output for a given transition, then the output cell should contain ‘none’.
The first two rows have been completed.
|
Input |
Output |
Next state |
|---|---|---|
|
S1 |
||
|
Input-A |
none |
S3 |
|
Output-W |
||
|
none |
||
|
Input-B |
||
|
Input-A |
||
|
S4 |
[5]
B. Identify the input sequence that will cause the minimum number of state changes in the transition from S1 to S4
[1]
Answers
A.
|
Input |
Output |
Next state |
|---|---|---|
|
S1 |
||
|
Input-A |
none |
S3 |
|
Input-A |
Output-W |
S3 |
|
Input-B |
none |
S2 |
|
Input-B |
none |
S5 |
|
Input-A |
none |
S2 |
|
Input-A |
Output-X |
S4 |
-
One mark per row 3 to 7 [5 marks]
B. Input-B, Input-A [1 mark]
Responses