Organization of execution cycles
Command and Machine Cycles
A command is a collection of microinstructions that are stored as binary codes in a read-only memory (ROM) of the microprocessor control unit. The execution of the command can be considered as a process of reading from the ROM microinstructions that initiate the operation of certain functional nodes of the microprocessor at individual time intervals (cycles). The time spent executing the command is called the command cycle. Commands have different duration of command cycles, since they contain a different number of micro-commands. This circumstance is reflected in the formats of commands having a length of 1, 2 or more bytes. In the command cycle, two main phases can be distinguished:
• The sampling phase of the command. In this phase, the instruction counter, or program counter, sets the address of the first byte of the instruction to the address bus. The microprocessor generates a memory read signal, through which the contents of the addressable memory cell are sent to the instruction register via the data bus. The command counter generates an address indicating the next element of the object code. The sampling phase is the same for all teams;
• The command execution phase, starting with the decryption of the command. As a result of the decoding of the first byte, the type (code) of the operation is determined and the control signals necessary for its execution are generated in the control device. The actions of the microprocessor in this phase and its duration depend on the type of operation. To perform the operation, you may need additional access to memory or external devices for data, transferring data to the appropriate registers of the microprocessor, directly performing an operation in the ALU, displaying the results in memory or an external device, etc.
The different duration of the command cycles and the heterogeneity of their individual phases caused the organization of machine loops to execute commands. Each machine cycle represents a cycle of access to the system backbone. In the machine cycle, the next command or byte (word) of the data from the main memory is sampled, the memory is written, the data is input or output. A command cycle can contain a different number of machine cycles. In the first Ml machine cycle, the first byte of the instruction is sampled, the command code is decoded and executed, if the data is in the internal registers of the microprocessor. If the command requires access to the main memory or external devices, two, three or more machine cycles are used. Machine cycles, like command ones, are also not homogeneous, so a different number of cycles are consumed for their execution. Thus, when executing the command, all actions of the microprocessor are synchronized by nested in each other cycles of three levels: command, machine and clock.