This layer has no inputs and outputs to test.
One signal name per column. Rows hold 0, 1, or x for βdonβt careβ; C in an input column is a clock pulse (0, then 1, then 0). Lines starting with # are comments.
A truth table tells you what a circuit does. A test case tells you whether that is what you wanted. You declare the input combinations you care about together with the outputs you expect, run them, and get a verdict per row instead of a table you still have to read.
This matters as soon as a design outgrows exhaustive testing. Above ten inputs a full table is thousands of rows, but the cases that actually matter β boundary conditions, carry propagation, the one encoding that broke last time β are usually a handful. Writing them down turns a design review into something repeatable: change the circuit, rerun, see instantly whether you broke a case that used to pass.
# half adder
A B | S C
0 0 | 0 0
0 1 | 1 0
1 0 | 1 0
1 1 | 0 1Without a C, each row is simulated on its own, so a table describes a combinational circuit. With one, the rows become a sequence: they run top to bottom from power-up (every register at 0), state carries from row to row, and an x in an input column keeps its last value. A table for a 4-bit counter is then just a column of C with the count you expect after each pulse.
Read: Truth tables explained