The Machine Cycle
You have probably heard of computer programming languages such as COBOL, BASIC, and RPG. There are dozens of programming languages in common usage. However, in the end, COBOL. BASIC, RPG. and the other languages are translated into the only language that a computer understands-its own machine language. Machine-language instructions arc represented inside the computer as strings of binary digits. up to 64 digits in length. An overview of machine languages and of some of the more popular higher-level programming languages is provided in new topics , "Programming Concepts and Languages .
Op-code |
Operand |
(add to accumulator) |
11011101 (a RAM address) |
Every computer has a machine cycle. The following actions take place during the machine cycle (see Figure 5):
Fetch instruction. The next machine-language instruction to be executed too-code and operand) is retrieved, or ‘fetched." from RAM or cache memory and loaded to the instruction register in the control unit (see Figure 4).
• Decode instruction. The instruction b decoded and interpreted .
• execute instruction. Using whatever processor resources are needed (primarily the arithmetic and logic unit), the instruction b executed.
• Place result ill memory. The results arc placed in the appropriate memory position (usually RAM or a register in the arithmetic and logic unit called the accumulator). (See Figure 4)
The speed of a processor is sometimes measured by how long it takes to complete a machine cycle. The timed interval that comprises the machine cycle is the total of the instruction time, or I-time, and the execution time, or E-time (see Figure 5). The I-time is made up of the first two activities of the machine cycle-fetch and decode the instruction. The E-time comprises the last two activities of the machine cycle-execute the instruction and store the results.