Question:
In a 5-stage instruction pipeline (IF, ID, EX, MEM, WB), an instruction produces a result that is immediately needed by the very next instruction. What type of pipeline hazard is this, and how can hardware minimize stalling?
5-चरणीय निर्देश पाइपलाइन (IF, ID, EX, MEM, WB) में, एक निर्देश एक परिणाम उत्पन्न करता है जिसकी तुरंत अगले निर्देश को आवश्यकता होती है। यह किस प्रकार का पाइपलाइन खतरा (hazard) है, और हार्डवेयर स्टालिंग को कैसे कम कर सकता है?
Options:
- Data Hazard (RAW); minimized using Operand Forwarding (Bypassing)
- Structural Hazard; minimized using dual-port RAM
- Control Hazard; minimized using branch prediction
- Data Hazard (WAR); minimized using register renaming
- डेटा हैज़र्ड (RAW); ऑपरेंड फॉरवर्डिंग (बायपासिंग) द्वारा कम किया जाता है
- संरचनात्मक हैज़र्ड; ड्यूल-पोर्ट रैम द्वारा कम किया जाता है
- नियंत्रण हैज़र्ड; शाखा भविष्यवाणी (ब्रांच प्रेडिक्शन) द्वारा कम किया जाता है
- डेटा हैज़र्ड (WAR); रजिस्टर रीनेमिंग द्वारा कम किया जाता है
Correct Answer: a)
Explanation:
This is a Read-After-Write (RAW) data hazard, where the subsequent instruction attempts to read a source register before the previous instruction writes back its result. Hardware minimizes or eliminates stalls for ALU operations using Operand Forwarding (bypassing the result directly from the output of the EX stage to the input of the next instruction’s EX stage).
यह Read-After-Write (RAW) डेटा हैज़र्ड है। पाइपलाइन में स्टाल (बबल) से बचने के लिए हार्डवेयर ऑपरेंड फॉरवर्डिंग (बायपासिंग) का उपयोग करता है, जिससे परिणाम को WB चरण की प्रतीक्षा किए बिना सीधे अगले निर्देश को भेजा जाता है।