A clock cycle is one period of the clock: the time from one rising edge to the next. In a synchronous CPU, every register changes only at an edge, so the cycle is the basic unit of work.
In Tiny8, each cycle does one register-transfer step:
- 3 cycles of fetch (F1, F2, F3);
- 1 cycle of decode (D);
- 1 or 2 cycles of execute (E1, E2).
So LOAD, STORE, ADD and SUB take 6 cycles; JMP, JZ and HALT take 5.
Counting cycles for a program run:
- Count how many times each kind of instruction actually executes, including every pass of a loop.
- Multiply by its cycle count and add.
The total feeds the CPI (cycles ÷ instructions) and the cpu execution time (cycles × clock period).