Notes > Computer Systems > Instruction Execution
|
The Control Unit inside the CPU of a computer is where instructions in a program are decoded and followed. The control unit contains two special-purpose registers which are the program counter and the instruction register. The program counter holds the address of the next instruction to be executed and the instruction register holds the actual instruction.
The cycle that the control unit follows is known as the "machine cycle" and consists of 3 (or 4) main steps which are repeated continuously. The first step is the "fetch" stage which is where the instruction is retrieved from memory. The second step is the "decode" step where the bit pattern of the instruction is decoded in the instruction register. Thirdly, the "execute" step performs the action specified by the instruction. Lastly, the "store" step writes the result of any calculations to memory or a register. This last step can be associated with the "execute" step.
Instructions consist of an Op-code and an Operand. These instructions can be represented in hexadecimal form to make them easier to read. For example, a typical instruction may be B258 where each letter or digit represents a 4 bit long binary string. The whole instruction is therefore 16 bits (2 bytes) long. The first value ("B") in the instruction is the Op-code and this specifies what type of action (LOAD, MOVE, ADD, STORE etc...) is to take place. The following 3 values specify the addresses of registers to use in the execution of the instruction as well as where to store the result etc... The meaning of these 3 bits varies depending on the Op-code.
Try a Computer Systems Quiz in the Computing Students Computing Quizzes Section to test your knowledge.
Search for "Instruction Execution" on:
Google |
Kelkoo |
Amazon |
eBay (UK) |
eBay (US)
Search for "Instruction Execution" on the rest of Computing Students: Instruction Execution
|