This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:cs:chapter_3_8 [2025/12/05 08:54] – [Instruction encoding] ktokarz | en:multiasm:cs:chapter_3_8 [2025/12/05 09:59] (current) – [Instruction Execution Process] ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Instruction Execution Process ====== | ===== Instruction Execution Process ====== | ||
| - | As we already mentioned, instructions are executed by the processor in a few steps. You can find in the literature descriptions that there are three, four, or five stages of instruction execution. Everything depends on the level of detail one considers. The three stages | + | As we already mentioned, instructions are executed by the processor in a few steps. You can find in the literature descriptions that there are three, four, or five stages of instruction execution. Everything depends on the level of detail one considers. The three-stage |
| - | It is worth remembering that even a simple fetch step can be divided into a set of smaller actions which must be performed by the processor. The real execution of instructions depends on the processor' | + | It is worth remembering that even a simple fetch step can be divided into a set of smaller actions which must be performed by the processor. The real execution of instructions depends on the processor' |
| - Fetching the instruction: | - Fetching the instruction: | ||
| - | * The processor addresses the instruction by sending the content of the IP register | + | * The processor addresses the instruction by sending the content of the IP register |
| - | * The processor reads the code of the instruction from program memory | + | * The processor reads the code of the instruction from program memory |
| * The processor stores the code of the instruction in the instruction register. | * The processor stores the code of the instruction in the instruction register. | ||
| * The processor prepares the IP (possibly increments) to point to the next instruction in a stream. | * The processor prepares the IP (possibly increments) to point to the next instruction in a stream. | ||
| - Instruction decoding: | - Instruction decoding: | ||
| - | * A simple instruction can be interpreted directly by instruction decoder logic. | + | * A simple instruction can be interpreted directly by the instruction decoder logic. |
| * More complex instructions are processed in some steps by microcodes. | * More complex instructions are processed in some steps by microcodes. | ||
| * Results are provided to the execution unit. | * Results are provided to the execution unit. | ||
| Line 18: | Line 18: | ||
| - Instruction execution: | - Instruction execution: | ||
| * The execution unit performs actions as encoded in the instruction (simple or with microcode). | * The execution unit performs actions as encoded in the instruction (simple or with microcode). | ||
| - | * In modern processors there are more execution units, they can execute | + | * In modern processors, there are more execution units, |
| - Writing back the result: | - Writing back the result: | ||
| * The processor writes the result of calculations into the register or memory. | * The processor writes the result of calculations into the register or memory. | ||