- Asked 6/22
- 2079 Baisakh · 4 marks
- 2076 Chaitra · 6 marks
- 2074 Chaitra · 6 marks
- 2074 Asoj · 6 marks
- 2073 Chaitra · 6 marks
- 2071 Shrawan · 3 marks
Instruction cycle state diagram with interrupt
Short answer
The instruction cycle comprises states: iac, if, iod, oac, of, do, os. After os, an interrupt check occurs; if a signal is pending and interrupts enabled, the CPU saves state, jumps to the service routine, and later resumes the program.
Explain the instruction cycle state diagram with interrupt.
The instruction cycle is the sequence of steps the CPU repeats to execute one instruction: fetch the instruction, decode it, fetch operands, execute, store the result, and then check for interrupts. The state diagram shows these steps as states with arrows for the transitions.
iac --> if --> iod --> oac --> of --> do --> oac --> os
^ ^ | ^ |
| +------+ +-------+
| more operands more results
| |
+-- no interrupt <-- interrupt check <---------------+
|
interrupt --> interrupt processing
States of the diagram
- Instruction address calculation (iac): find the address of the next instruction (usually PC + length).
- Instruction fetch (if): read the instruction from memory into IR.
- Instruction operation decoding (iod): find the operation type and the operands needed.
- Operand address calculation (oac): if an operand is in memory (indirect or indexed), calculate its address.
- Operand fetch (of): read the operand from memory or I/O. This pair (oac, of) repeats if there are several operands.
- Data operation (do): the ALU performs the operation.
- Operand store (os): write the result to memory, register or I/O. Multiple results repeat this step.
Interrupt handling
After each instruction the CPU checks for an interrupt signal. If none is pending, it goes to the next instruction. If one is pending and interrupts are enabled, the CPU:
- saves the current PC and processor status (usually on the stack),
- loads the PC with the address of the interrupt service routine,
- runs the routine, then restores the saved state and resumes the interrupted program.
The interrupt check is placed at the end of the cycle so that an instruction is never cut in half. The fetch and execute parts can also be shown as two main phases: the fetch cycle (iac, if) and the execute cycle (iod to os), with the interrupt cycle added when needed.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Four-segment instruction pipeline and space-time diagram · Computer Organization and Architecture, chapter 4 · asked 5×
- Instruction cycle and machine cycle · Microprocessor, chapter 1 · asked 2×
- RIM instruction in 8085 · Microprocessor, chapter 5
- Interfacing 8-bit ADC using interrupt · Instrumentation II, chapter 4 · asked 2×
- Machine cycle, T-states, ANI 55H timing · Microprocessor, chapter 2
All Computer Organization and Architecture chapter 1 questions →