Trace Tables - Lakelands Computing

Title
Go to content
Trace Tables
We use Trace Tables to track and monitor the values in an algorithm. A trace table is used to test an algorithm and predict step by step how the computer will run the algorithm. It can be used to to identify potential logic errors
(when the program compiles but does not produce the expected output).

It is probably easier to explain with an example.
iteration (loop)
count
a
starting condition02
104 (2*2)
218 (4*2)
3216
4332
5464
65128
The algorithm keeps looping until the count is = 5 then it stops . The table traces (tracks) the number of loops, the value of count and the value of a.
A common exam question on trace tables is how many times would this algoirthm run. The answer is 6, the table makes it easy to figure this out. This links in with Logic Gates too.
All Text copyright Lakelands Academy & Mr T Purslow 2020.
All images copyright free / creative commons unless otherwise stated.
You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
Back to content