Instruction Cycle in Computer Architecture - Naukri Code 360
Instruction Cycle in Computer Architecture - Naukri Code 360
Table of contents
Start learning
Introduction
The instruction cycle is a basic computer system that deals with the central processor unit's
core operations. It is also known as the fetch-decode-execute cycle, is a fundamental concept
in computer architecture and microprocessor operation. It represents the series of steps that a
computer's central processing unit (CPU) goes through to execute a single machine
instruction.
The instruction cycle is divided into five stages, which are described below:
Initiating Cycle
During this phase, the computer system boots up and the Operating System loads into the
central processing unit's main memory. It begins when the computer system starts.
Fetching of Instruction
The first phase is instruction retrieval. Each instruction executed in a central processing unit
uses the fetch instruction. During this phase, the central processing unit sends the PC to MAR
and then the READ instruction to a control bus. After sending a read instruction on the data
bus, the memory returns the instruction that was stored at that exact address in the memory.
The CPU then copies data from the data bus into MBR, which it then copies to registers. The
pointer is incremented to the next memory location, allowing the next instruction to be
fetched from memory.
Decoding of Instruction
The second phase is instruction decoding. During this step, the CPU determines which
instruction should be fetched from the instruction and
Free whatpath,
Guided action should
hand befor
picked you! on
taken the
instruction. The instruction's opcode is also retrieved from memory, and it decodes the related
Data structures & algorithms (Beginner to…
operation that must be performed for the instruction.
13 chapters 109+ problems
Execution of Instruction
The last step is to carry out the instructions. The instruction is finally carried out at this stage.
The instruction is carried out, and the result is saved in the register. The CPU gets prepared
for the execution of the next instruction after the completion of each instruction. The execution
time of each instruction is calculated, and this information is used to determine the
processor's processing speed.
After Job
Bootcamp
Fetch Cycle
Description: The fetch cycle is the initial stage of the instruction cycle. It involves retrieving the
next instruction from memory.
Operation: The CPU uses the program counter (PC) to access the memory location where the
next instruction is stored. The instruction is fetched and placed in the instruction register (IR).
Free Guided path, hand picked for you!
Purpose: This cycle ensures that the CPU has the next instruction ready for decoding and
Data structures & algorithms (Beginner to…
execution.
13 chapters 109+ problems
Indirect Cycle
Description: The indirect cycle is sometimes required when instructions involve accessing
memory locations that contain addresses or pointers to the actual data.
Operation: During this cycle, the CPU may use an address obtained from the previous
instruction to access another memory location, which holds the data or another address to be
used in the next cycle.
Purpose: The indirect cycle enables the CPU to follow memory references and retrieve the
actual data required for execution.
Execute Cycle
Description: The execute cycle is where the central processing unit performs the operation
specified by the decoded instruction.
Operation: The CPU carries out arithmetic computations, logical operations, data transfers, or
any other actions as dictated by the instruction. This may involve accessing data from
registers or memory, performing calculations, and updating registers or memory locations.
Purpose: The execution stage accomplishes the intended operation and is where the actual
work of the instruction takes place.
Interrupt Cycle
Description: The interrupt cycle comes into play when an external event or condition triggers
an interrupt, causing the CPU to temporarily suspend its current execution to handle the
interrupt request.
Operation: The CPU saves its current state (program counter and other relevant information)
before jumping to an interrupt service routine (ISR). After servicing the interrupt, the CPU may
restore its state and continue execution.
Purpose: Interrupt cycles enable a CPU to respond to external events or asynchronous inputs
promptly without losing important data or program context.
Fetch Cycle
Use: Retrieving the next instruction from memory.
Application: Essential for the sequential execution of program instructions, ensuring the CPU
has the next instruction ready for decoding and execution.
Example: Fetching the opcode of the next instruction from memory to be decoded and
executed.
Indirect Cycle
Use: Handling instructions that involve accessing memory locations containing addresses or
pointers.
Application: Facilitates memory referencing, allowing the CPU to navigate through multiple
levels of indirection to access the actual data or instructions.
Example: Accessing data through a memory location that contains a pointer to the actual
data's location.
Execute Cycle
Use: Performing the operation specified by the decoded instruction.
Application: Where the actual computation or data manipulation occurs, making it the heart
of instruction execution.
Example: Carrying out arithmetic calculations, logical operations, data transfers, or any
actions dictated by the instruction.
Interrupt Cycle
Use: Handling external events or requests for interrupting the CPU's current execution.
Free Guided path, hand picked for you!
Application: Ensures prompt response to hardware or software events such as hardware
Data structures & algorithms (Beginner to…
interrupts, system calls, or exceptions, allowing the CPU to temporarily switch tasks.
13 chapters 109+ problems
Example: Responding to a keyboard input interrupt, saving the CPU's current state, and
invoking an interrupt service routine (ISR).
The instruction cycle is essential as it defines how a CPU processes and executes instructions
in a structured and controlled manner, ensuring accurate and efficient program execution.
Conclusion
In this blog, we have thoroughly discussed on Instruction Cycle in Computer Architecture. We
also learned about different instruction cycles, the uses of different instruction cycles, their
needs, and their importance. Later in the end we discussed the advantages and
disadvantages of the instruction Cycle in Computer Architecture.
If you're interested in learning advanced front-end web development, Coding Ninjas has one
of the best courses on the internet, which you can find here.
Recommended Reading:
Recommended Reading:
Related articles
Comments
No comments yet
A Comprehensive Guide to C Pr… Interview guide for product bas… Competitive programming DBMS - Database management…
8 chapters 40+ Problems 12 chapters 123+ Problems 16 chapters 217+ Problems 12 chapters 93+ Problems
Earn badges and level up Earn badges and level up Earn badges and level up Earn badges and level up
Start learning and practising questions If you are wondering how to prepare for Do you like competitive programming Dbms and sql queries are one of the
in C for better performance in your product-based companies like google, but get stuck because of less knowledge most frequently asked interview topics
upcoming interviews. C is what most amazon, microsoft etc., here is your of topics? Do not skip any step in your be it at any experience level or any
people fail to understand. Don’t worry,… ultimate guide for cracking your dream… competitive programming journey. Exc… professional software domain roles. W…
Prerequisites : Prerequisites : Prerequisites : Prerequisites :
Basic aptitude and enthusiasm to learn Basic knowledge of data structures and Basic knowledge of data structures and Basic knowledge of programming
coding algorithms algorithms
Library Java Python C Programming Language C++ Programming Language Cloud Computing
Node JS Machine Learning Deep Learning Big Data Operating System Go Language C#
Ruby Amazon Web Services Microsoft Azure Google Cloud Platform Data Warehousing
Internet of Things
Get the tech career you deserve faster with Coding Ninjas courses
User rating 4.7/5 1:1 doubt support 95% placement record
Request a callback
Our courses
Privacy policy
Follow us on Contact us
1800-123-3598
[email protected]
Download the naukri app