Friday, February 1, 2013

System Clock, Machine cycle, Instruction cycle and T-state


System Clock, Machine cycle, Instruction cycle and T-state

The higher system clock, machine cycle and instruction cycle is used to measure the CPU/controller speed to execute/process the program (firmware). The higher clock speed will indicate more instructions processed per second. The Alternate measure of processing speed is the number of instructions a CPU can process per second (instruction per second or IPS). This unit is measure CPU/controller itself speed, is cannot indicate the whole system performance and speed, because the system performance/speed may affect by memory speed, bus speed, bus width (8 bits, 16bits, 32bits) and device that interface with CPU/controller.

System Clock

System clock is main reference clock for whole system. Normally, it is crystal clock at external. It measure in units Hertz(Hz)

T-state

T-state is sub step in machine cycle. It is one of the states in machine cycle. Normally, each state will using single system clock.

Machine Cycle

Machine cycle is defined as the time required completing the one operation. It includes of 3-6 T-state. Multiple sub process (T-state) combines and become single machine cycle. The other word, multiple system clock needed to execute single machine cycle. The sub process in machine cycle will have:-
Fetch = the program instruction is fetched to registry.
Decode = the instructions are decoded so that control unit, ALU and FPU can understand the,
Execute = the instructions are carried out
Store = the original data or the result from the ALU or FPU execution is stored either in the CPU registers or in memory, depending on the instruction.

Today technology, there have some CPU/controller using clock double up circuit to increase internal system clock. It will become the CPU/controller need lower frequency system clock but can execute higher speed.

Instruction cycle

Instruction cycle contain series of multiple machine cycle. Difference instruction may need difference machine cycle (it is depending on the CPU/controller architecture). The instruction design will affect the performance of CPU/controller. The 8085 instruction cycle consist of 1-6 machine cycle.