Instruction Cycle
Instruction Cycle वह complete process है, जिसके through CPU (Central Processing Unit) किसी program की एक instruction को Memory से fetch करता है, उसे decode करता है, execute करता है और फिर result को store करता है।
Table of Contents
ToggleKey Points
- Instruction Cycle CPU की basic working cycle होती है।
- इसमें मुख्यतः Fetch, Decode और Execute phases शामिल होते हैं।
- Program Counter (PC) next instruction का address hold करता है।
- Instruction पहले Main Memory से fetch की जाती है।
- Control Unit instruction को decode करती है।
- ALU (Arithmetic Logic Unit) execute phase में calculation करता है।
- हर instruction के लिए Instruction Cycle repeat होती है।
- Instruction Cycle के बिना program execution संभव नहीं है।
- Modern computers में Instruction Cycle को pipelining और cache memory से fast किया गया है।
Why Instruction Cycle is Important?
(Instruction Cycle क्यों महत्वपूर्ण है?)
- Systematic Execution is ensured : Instruction Cycle CPU को step-by-step guide देती है, कि पहले कौन-सा step करना है, और बाद में क्या। इससे program execution smooth रहता है।
- Makes Program Execution Possible : कोई भी software (IRCTC booking system, Paytm app, या MS Word) Instruction Cycle के बिना run नहीं कर सकता। यह program execution की basic foundation है।
- Coordinates between Hardware Components : Instruction Cycle Registers, ALU, Control Unit और Memory के बीच proper coordination बनाए रखती है, जिससे सभी hardware components एक synchronized और efficient तरीके से काम करते हैं।
- Helps in error-free processing : Fixed sequence (Fetch → Decode → Execute) होने से गलत execution के chances कम हो जाते हैं।
- Supports Interrupt Handling : Instruction Cycle CPU को यह ability देती है कि वह normal execution के दौरान keyboard input, mouse click या अन्य urgent interrupts को efficiently handle कर सके।
- Improves CPU performance : Modern techniques जैसे Pipelining, Cache Memory और Parallel Processing Instruction Cycle को faster बनाकर overall CPU performance को enhance करती हैं।
Types of Instruction Cycles (मुख्य प्रकार)
Instruction Cycles को generally 3 main types में classify किया जाता है:
1. Simple Instruction Cycle
- यह सबसे basic type है, जिसमें CPU एक instruction complete करने के बाद ही next instruction पर जाता है।
- कोई external interrupt इस process को disturb नहीं करता।
- Key Points :
- Sequential execution होता है
- CPU पूरा focus एक instruction पर देता है
- Easy to understand, exam-friendly
2. Instruction Cycle with Interrupt
- इस type में CPU किसी urgent external task (interrupt) को handle कर सकता है, बिना current program को completely stop किए।
- Current instruction complete होने के बाद CPU ISR (Interrupt Service Routine) execute करता है।
- Key Points :
- CPU multitasking कर सकता है
- Real-time processing possible है
- Complex hardware और control unit required होते है
3. Pipelined Instruction Cycle
- Modern CPUs में use होने वाला types जिसमें Multiple instructions एक साथ parallel stage में process होते हैं
- Fetch, Decode, Execute stages overlap कर सकते हैं
- Key Points :
- High-speed execution possible
- CPU utilization maximize होता है
- Complex hardware और advanced control logic की जरूरत होती है
Main Phases of Instruction Cycle
(Instruction Cycle के मुख्य चरण)
Instruction Cycle को generally 4 main phases में divide किया जाता है:
- Fetch Cycle
- Decode Cycle
- Execute Cycle
- Store (Write Back) Cycle
1. Fetch Phase (Fetch Cycle)
Fetch Phase वह stage है, जिसमें CPU Main Memory से instruction को fetch करता है।
- Program Counter (PC) में next instruction का address होता है
- Address को Memory Address Register (MAR) में भेजा जाता है
- Instruction memory से निकलकर Memory Data Register (MDR) में आती है
- Instruction को Instruction Register (IR) में load किया जाता है
- PC को increment कर दिया जाता है
2. Decode Phase (Decode Cycle)
Decode Phase में CPU यह समझता है, कि instruction क्या करना चाहती है।
- Control Unit (CU) instruction को decode करती है
- Opcode (ADD, SUB, LOAD, STORE) identify किया जाता है
- Operand और Addressing Mode check किया जाता है
- Required hardware resources decide किए जाते हैं
3. Execute Phase (Execute Cycle)
Execute Phase वह stage है, जहाँ actual operation perform होता है।
- ALU arithmetic या logical operation perform करता है
- Data transfer या comparison होता है
- Jump या branch instruction execute होती है
- यहाँ ALU (Arithmetic Logic Unit) सबसे ज्यादा active रहता है।
4. Store Phase (Write Back Cycle)
Store Phase में Execute Phase के बाद मिला हुआ result save किया जाता है।
- Result register या memory में save होता है
- Flags (Zero, Carry, Sign आदि) update होते हैं
Flow of Instruction Cycle (Step-by-Step Flow)
Step1 : Program Counter (PC) Instruction Address Hold करता है
- Program Counter में अगली instruction का memory address होता है।
- CPU इसी address से instruction को fetch करता है।
Step2 : Instruction Fetch की जाती है
- PC का address Memory Address Register (MAR) में जाता है।
- Instruction Main Memory से निकलकर Memory Data Register (MDR) में आती है।
- Instruction को Instruction Register (IR) में load किया जाता है।
Step3 : Program Counter Increment होता है
- PC automatically next instruction के address पर point करने लगता है।
- इससे instruction sequence maintain रहती है।
Step4 : Instruction Decode की जाती है
- Control Unit instruction को decode करती है।
- Opcode (क्या करना है) और Operand (किस पर करना है) identify होते हैं।
- Required registers और ALU decide किए जाते हैं।
Step5 : Instruction Execute होती है
- ALU arithmetic या logical operation perform करता है।
- Data transfer, comparison या jump operation होता है।
Step6 : Result Store किया जाता है
- Execution का result register या memory में store किया जाता है।
- Status flags update होते हैं।
Step7 : Interrupt Check होता है
- CPU check करता है, कि कोई interrupt आया है या नहीं।
- यदि interrupt है → Interrupt Service Routine (ISR) execute होती है। या नहीं → Next instruction cycle start हो जाती है।
Components of Instruction Cycle
| Component | Role in Instruction Cycle | Example |
|---|---|---|
| Program Counter (PC) | Next instruction का memory address store करता है और CPU को बताता है कि अगली instruction कहाँ से fetch करनी है | Queue में next person की position |
| Instruction Register (IR) | Current instruction को temporarily store करता है, CPU उसे decode और execute कर सके | Blackboard पर current topic लिखना |
| Memory Address Register (MAR) | Memory में data या instruction के location को point करता है | Library में book shelf number दिखाना |
| Memory Data Register (MDR) | Memory से data को read/write करता है | Librarian से book लेना या वापस रखना |
| ALU (Arithmetic Logic Unit) | Arithmetic और Logic operations perform करता है | Calculator की core engine |
| Control Unit (CU) | CPU के सभी operations को control और coordinate करता है | Traffic police जो signals देकर flow manage करता है |
| General Purpose Registers (GPRs) | Temporary data store करते हैं, CPU operations के लिए ready रखते हैं | Desk पर रखा temporary notebook |
Instruction Cycle Optimization Techniques
| Technique | Definition | Benefits |
|---|---|---|
| Pipelining | Instruction के stages (Fetch, Decode, Execute) को overlap करके multiple instructions parallel process करना | – High-speed execution- CPU utilization maximize- Modern CPUs में common |
| Cache Memory | Frequently used instructions और data को fast memory (CPU के पास) में store करना | – Instruction fetch time reduce- CPU execution faster- Memory access efficient |
| Parallel Processing | Multiple instructions या tasks को same time में different processors या cores पर execute करना | – High-performance computing- Real-time processing possible- Useful in servers, ISRO software |
| Branch Prediction | Conditional instructions में CPU anticipate करके next instruction ready रखता है | – Reduce CPU idle time- Faster execution of loops और conditional operations- Improves pipelining efficiency |
| Instruction Pre-fetching | CPU को future instructions advance में fetch करना | – Reduce waiting time- Smooth execution- Enhances pipelining performance |
Example (उदाहरण)
Instruction : ADD R1, R2
Execution Process
- Fetch : Instruction memory से IR में आती है
- Decode : ADD operation और registers identify होते हैं
- Execute : ALU R1 + R2 करता है
- Store : Result R1 में store होता है
Conclusion (निष्कर्ष)
Instruction Cycle CPU की basic working cycle है, जो किसी भी program की instructions को step-by-step process करती है। इसमें Fetch → Decode → Execute → Store चार main phases शामिल होते हैं।
- CPU Program Counter (PC) से instruction fetch करता है।
- Control Unit instruction को decode करती है और ALU actual operation perform करता है।
- Result register या memory में save होता है और status flags update होते हैं।
Instruction Cycle बिना program execution संभव नहीं है। Modern computers में Pipelining, Cache Memory, Parallel Processing जैसी techniques से Instruction Cycle को तेज और efficient बनाया गया है।
अक्सर पूछे जाने वाले प्रश्न (FAQ)
FAQ – Instruction Cycle
Q1: Instruction Cycle क्या होता है?
- यह CPU का पूरा process है जिसमें CPU instruction को Memory से fetch करता है, decode करता है, execute करता है और result store करता है।
Q2: Instruction Cycle के मुख्य phases कौन‑कौन से हैं?
- Fetch, Decode, Execute, और Store/Write Back।
Q3: Program Counter (PC) का role क्या है?
- PC अगली instruction का memory address hold करता है ताकि CPU sequentially instructions fetch कर सके।
Q4: Instruction Cycle क्यों जरूरी है?
- यह CPU को step-by-step program execution का guide देती है, hardware components के बीच coordination बनाती है और error-free processing सुनिश्चित करती है।
Q5: Interrupt-Driven Instruction Cycle क्या है?
- इस cycle में CPU external interrupts को handle कर सकता है, बिना current program को completely stop किए।
Q6: Pipelined Instruction Cycle क्या है और क्यों important है?
- Modern CPUs में multiple instructions parallel stages में process होते हैं। इससे high-speed execution और CPU utilization maximize होता है।
Q7: Instruction Cycle में ALU का क्या role है?
- ALU Execute phase में arithmetic और logical operations perform करता है।
Q8: Simple Instruction Cycle और Pipelined Instruction Cycle में क्या difference है?
- Simple Cycle sequentially एक instruction complete करने के बाद next पर जाता है। Pipelined Cycle में instructions overlap करके parallel process होती हैं, जिससे speed बढ़ती है।






