Interrupts क्या होते हैं? Types, Working और Examples आसान भाषा में


Interrupts क्या होते हैं? Types, Working और Examples आसान भाषा में

Interrupt एक ऐसा signal होता है जो CPU को अचानक notify करता है कि कोई high-priority task perform करना है। इससे processor अपना current task रोक कर, नए interrupt को handle करता है और फिर वापस लौटता है।

🔹 Interrupt कैसे काम करता है?

  1. Interrupt आता है (External या Internal)
  2. Processor current instruction को pause करता है
  3. ISR (Interrupt Service Routine) execute होती है
  4. Interrupt handle होने के बाद processor वापस main program पर लौटता है

🔸 Types of Interrupts

  • Hardware Interrupt: जब कोई external device जैसे keyboard या timer interrupt generate करता है।
  • Software Interrupt: जब program के अंदर से interrupt call किया जाता है (जैसे INT instruction)।
  • Maskable Interrupt: जिसे disable (mask) किया जा सकता है।
  • Non-maskable Interrupt: जिसे disable नहीं किया जा सकता (जैसे emergency conditions)।
  • Vectored Interrupt: जिसका fixed address होता है जहां ISR होता है।
  • Non-vectored Interrupt: जिसका address manually assign करना पड़ता है।

🔍 Example:

मान लीजिए आप कोई text टाइप कर रहे हैं और अचानक keyboard से key press होता है। यह CPU के लिए एक hardware interrupt है। CPU तुरंत उस key press को process करता है और फिर वापस typing process पर लौटता है।

📌 Importance of Interrupts

  • Real-time processing में मदद
  • CPU का efficient use
  • Multiple tasks एक साथ handle करने की क्षमता

📘 निष्कर्ष

Interrupts embedded systems और microprocessor-based systems का integral हिस्सा हैं। इनके बिना efficient task handling संभव नहीं है। हर प्रकार का interrupt अपने खास उद्देश्य के लिए होता है।

Related Post

Comments

Comments