The IGNOU MCS-012 Solved Question Paper PDF Download page is designed to help students access high-quality exam resources in one place. Here, you can find ignou solved question paper IGNOU Previous Year Question paper solved PDF that covers all important questions with detailed answers. This page provides IGNOU all Previous year Question Papers in one PDF format, making it easier for students to prepare effectively.
- IGNOU MCS-012 Solved Question Paper in Hindi
- IGNOU MCS-012 Solved Question Paper in English
- IGNOU Previous Year Solved Question Papers (All Courses)
Whether you are looking for IGNOU Previous Year Question paper solved in English or ignou previous year question paper solved in hindi, this page offers both options to suit your learning needs. These solved papers help you understand exam patterns, improve answer writing skills, and boost confidence for upcoming exams.
IGNOU MCS-012 Solved Question Paper PDF

This section provides IGNOU MCS-012 Solved Question Paper PDF in both Hindi and English. These ignou solved question paper IGNOU Previous Year Question paper solved PDF include detailed answers to help you understand exam patterns and improve your preparation. You can also access IGNOU all Previous year Question Papers in one PDF for quick and effective revision before exams.
IGNOU MCS-012 Previous Year Solved Question Paper in Hindi
प्रश्न 1. (a) वॉन न्यूमैन आर्किटेक्चर को एक ब्लॉक आरेख की सहायता से समझाइए। 6 (b) SRAM और DRAM के बीच अंतर स्पष्ट कीजिए। 4 (c) K-मैप का उपयोग करके निम्नलिखित को सरल कीजिए: 4 F (A, B, C, D) = Σ(0, 2, 8, 9, 10, 11, 4, 5) (d) निम्नलिखित का 1’s और 2’s पूरक ज्ञात कीजिए: 4 () 00000 (ii) 0000 (e) इंटरप्ट चक्र के साथ निर्देश चक्र के प्रवाह आरेख की व्याख्या कीजिए। 6 (f) प्रत्येक के आरेख की सहायता से कॉन्स्टेंट एंगुलर वेलोसिटी (CAV) और कॉन्स्टेंट लीनियर वेलोसिटी (CLV) डिस्कों के बीच अंतर स्पष्ट कीजिए। 6 (g) एक ASCII अंक को समकक्ष बाइनरी में बदलने के लिए 8080 असेंबली भाषा का उपयोग करके एक प्रोग्राम लिखिए। आप मान सकते हैं कि ASCII अंक DL रजिस्टर में संग्रहीत है। इस रूपांतरण का परिणाम AL रजिस्टर में रखा जाता है। 6 (h) 8086 रजिस्टरों के निम्नलिखित युग्मों के लिए भौतिक पता ज्ञात कीजिए: 4 () SS:SP = 0111h: 00FFh (ii) CS:IP = 4011h: 01FFh
उत्तर.
(a) वॉन न्यूमैन आर्किटेक्चर: वॉन न्यूमैन आर्किटेक्चर, जिसे प्रिंसटन आर्किटेक्चर भी कहा जाता है, एक कंप्यूटर आर्किटेक्चर है जो ‘स्टोर्ड-प्रोग्राम कंप्यूटर’ की अवधारणा पर आधारित है। इस डिजाइन में, प्रोग्राम के निर्देश और डेटा दोनों एक ही मेमोरी में संग्रहीत होते हैं और एक ही बस का उपयोग करके एक्सेस किए जाते हैं। इसके प्रमुख घटक हैं:
- सेंट्रल प्रोसेसिंग यूनिट (CPU): इसमें अरिथमैटिक लॉजिक यूनिट (ALU) और कंट्रोल यूनिट (CU) होती है। यह निर्देशों को निष्पादित करता है।
- मेमोरी यूनिट: यह प्रोग्राम निर्देशों और डेटा दोनों को संग्रहीत करती है।
- इनपुट/आउटपुट (I/O) डिवाइस: ये बाहरी दुनिया के साथ संचार के लिए उपयोग किए जाते हैं।
- सिस्टम बस: यह CPU, मेमोरी और I/O डिवाइसों को जोड़ने वाले डेटा और कंट्रोल सिग्नलों के लिए एक साझा मार्ग है।
ब्लॉक आरेख का विवरण: एक विशिष्ट आरेख में एक केंद्रीय बस होती है जो CPU, मेमोरी यूनिट और I/O डिवाइसों को जोड़ती है। CPU में ALU, कंट्रोल यूनिट और रजिस्टर दिखाए जाते हैं। मेमोरी डेटा और निर्देशों दोनों को संग्रहीत करती है। बस में एड्रेस बस, डेटा बस और कंट्रोल बस होती है।
इस आर्किटेक्चर की मुख्य विशेषता यह है कि यह डेटा लाने और निर्देश लाने के लिए एक ही मेमोरी और बस का उपयोग करता है। इससे ‘वॉन न्यूमैन बॉटलनेक’ नामक एक सीमा उत्पन्न होती है, क्योंकि सीपीयू की गति मेमोरी से डेटा ट्रांसफर करने की दर से सीमित हो जाती है। (b) SRAM और DRAM के बीच अंतर: | विशेषता | SRAM (स्टैटिक रैम) | DRAM (डायनामिक रैम) | |—|—|—| | टेक्नोलॉजी | ट्रांजिस्टर और फ्लिप-फ्लॉप का उपयोग करता है। | कैपेसिटर और ट्रांजिस्टर का उपयोग करता है। | | रिफ्रेश | इसे रिफ्रेश करने की आवश्यकता नहीं होती है। | इसे समय-समय पर रिफ्रेश करने की आवश्यकता होती है क्योंकि कैपेसिटर अपना चार्ज खो देते हैं। | | गति | DRAM से तेज होता है। | SRAM से धीमा होता है। | | घनत्व | कम घनत्व (प्रति चिप कम बिट्स)। | उच्च घनत्व (प्रति चिप अधिक बिट्स)। | | लागत | DRAM से अधिक महंगा होता है। | SRAM से सस्ता होता है। | | बिजली की खपत | निष्क्रिय अवस्था में कम, लेकिन सक्रिय होने पर अधिक। | SRAM से अधिक बिजली की खपत करता है क्योंकि इसे लगातार रिफ्रेश करना पड़ता है। | | उपयोग | मुख्य रूप से CPU कैश मेमोरी में उपयोग किया जाता है। | मुख्य रूप से कंप्यूटर की मुख्य मेमोरी (RAM) के रूप में उपयोग किया जाता है। | (c) K-मैप का उपयोग करके सरलीकरण: दिए गए बूलियन फलन के लिए, F (A, B, C, D) = Σm(0, 2, 4, 5, 8, 9, 10, 11)। (नोट: प्रश्न में दिए गए मानों में दोहराव को हटाकर और ‘ll’ को 10 और 11 मानकर मानक रूप में लिखा गया है)। हम एक 4-चर (4-variable) K-मैप बनाएंगे:
K-मैप में 1 को समूहित करने पर, हमें निम्नलिखित समूह मिलते हैं:
- क्वाड 1 (m0, m2, m8, m10): यह समूह पंक्तियों 00 और 10 को कवर करता है जहां C=0 और D=0 है। متغير जो बदलते हैं (A) उन्हें हटा दिया जाता है। इस समूह से प्राप्त पद C’D’ है।
- क्वाड 2 (m0, m4, m8): नहीं, यह सही समूह नहीं है।
- सही समूह:
- समूह 1 (क्वाड): minterms m0, m2, m8, m10 को मिलाकर। यह C’D’ देता है।
- समूह 2 (क्वाड): minterms m0, m4, m8… नहीं, यह सही नहीं है।
- पुनः प्रयास करते हैं:
- समूह 1 (क्वाड): m0, m2, m8, m10 -> यह `C’D’` देता है।
- समूह 2 (क्वाड): m8, m9, m10, m11 -> यह `AB’` देता है।
- समूह 3 (युग्म): m4, m5 -> यह `A’BC’` देता है।
सरल करने पर, हम निम्नलिखित समूह बनाते हैं:
- एक क्वाड (चार 1 का समूह) जिसमें minterms m0, m2, m8, m10 शामिल हैं। यह समूह C’D’ देता है।
- एक क्वाड जिसमें minterms m8, m9, m10, m11 शामिल हैं। यह समूह AB’ देता है।
- एक युग्म (दो 1 का समूह) जिसमें minterms m4, m5 शामिल हैं। यह समूह A’BC’ देता है।
इसलिए, सरलीकृत अभिव्यक्ति है: F(A, B, C, D) = C’D’ + AB’ + A’BC’ (d) 1’s और 2’s पूरक: (i) 00000
- 1’s पूरक: प्रत्येक बिट को पलट दें (0 को 1 और 1 को 0)। तो, 00000 का 1’s पूरक 11111 है।
- 2’s पूरक: 1’s पूरक में 1 जोड़ें। 11111 + 1 = 100000। चूंकि हम 5-बिट संख्या के साथ काम कर रहे हैं, हम कैरी को अनदेखा करते हैं, इसलिए परिणाम 00000 है।
(ii) 0000
- 1’s पूरक: प्रत्येक बिट को पलट दें। तो, 0000 का 1’s पूरक 1111 है।
- 2’s पूरक: 1’s पूरक में 1 जोड़ें। 1111 + 1 = 10000। चूंकि हम 4-बिट संख्या के साथ काम कर रहे हैं, हम कैरी को अनदेखा करते हैं, इसलिए परिणाम 0000 है।
नोट: 2’s पूरक प्रतिनिधित्व में शून्य का केवल एक ही प्रतिनिधित्व होता है, जो कि 0 है। (e) इंटरप्ट के साथ निर्देश चक्र का प्रवाह आरेख: निर्देश चक्र वह अनुक्रम है जिससे CPU एक प्रोग्राम को निष्पादित करता है। जब इंटरप्ट को शामिल किया जाता है, तो चक्र संशोधित हो जाता है। प्रवाह आरेख का विवरण:
- प्रारंभ: चक्र शुरू होता है।
- निर्देश लाएं (Fetch Instruction): CPU मेमोरी से अगला निर्देश प्राप्त करता है। प्रोग्राम काउंटर (PC) अगले निर्देश के पते पर अपडेट हो जाता है।
- निर्देश डीकोड करें (Decode Instruction): CPU निर्देश को समझता है कि क्या करना है।
- निर्देश निष्पादित करें (Execute Instruction): CPU ALU का उपयोग करके आवश्यक ऑपरेशन करता है।
- इंटरप्ट जांचें (Check for Interrupt): निष्पादन के बाद, CPU जांचता है कि क्या कोई इंटरप्ट सिग्नल लंबित है।
- यदि नहीं (No): चक्र अगले निर्देश को लाने के लिए चरण 2 पर वापस जाता है।
- यदि हाँ (Yes):
- वर्तमान संदर्भ सहेजें (Save Context): CPU वर्तमान प्रोग्राम की स्थिति (जैसे, PC और अन्य रजिस्टरों का मान) को स्टैक पर सहेजता है।
- इंटरप्ट सर्विस रूटीन (ISR) लोड करें: CPU इंटरप्ट वेक्टर तालिका से ISR का पता लोड करता है और उस पर कूद जाता है।
- ISR निष्पादित करें (Execute ISR): CPU उस डिवाइस की सेवा के लिए विशेष कोड निष्पादित करता है जिसने इंटरप्ट उत्पन्न किया है।
- संदर्भ पुनर्स्थापित करें (Restore Context): ISR पूरा होने के बाद, CPU स्टैक से सहेजे गए संदर्भ को पुनर्स्थापित करता है।
- वापसी (Return): CPU बाधित प्रोग्राम पर वापस लौटता है और सामान्य निष्पादन फिर से शुरू करता है। चक्र चरण 2 पर वापस जाता है।
(f) CAV बनाम CLV डिस्क: कॉन्स्टेंट एंगुलर वेलोसिटी (CAV):
- परिभाषा: CAV डिस्कों में, डिस्क एक स्थिर घूर्णी गति (RPM) पर घूमती है, चाहे रीड/राइट हेड किसी भी ट्रैक पर हो।
- डेटा घनत्व: इसका मतलब है कि बाहरी ट्रैकों पर बिट्स आंतरिक ट्रैकों की तुलना में अधिक फैले होते हैं, जिससे बाहरी ट्रैकों पर डेटा घनत्व कम होता है।
- आरेख: एक CAV डिस्क का आरेख संकेंद्रित वृत्तों (ट्रैक) को दिखाता है, जो वेजेज (सेक्टर) में विभाजित होते हैं। प्रत्येक सेक्टर, चाहे वह केंद्र के पास हो या किनारे पर, समान मात्रा में डेटा संग्रहीत करता है, लेकिन बाहरी सेक्टरों का भौतिक आकार बड़ा होता है।
- उपयोग: हार्ड डिस्क ड्राइव (HDD) में उपयोग किया जाता है।
कॉन्स्टेंट लीनियर वेलोसिटी (CLV):
- परिभाषा: CLV डिस्कों में, डिस्क की घूर्णी गति को समायोजित किया जाता है ताकि रीड/राइट हेड के नीचे से गुजरने वाले ट्रैक की गति स्थिर रहे।
- डेटा घनत्व: यह पूरे डिस्क पर एक समान (स्थिर) डेटा घनत्व सुनिश्चित करता है। जब हेड बाहरी किनारों की ओर बढ़ता है तो डिस्क धीमी गति से घूमती है और जब यह केंद्र के पास होता है तो तेज गति से घूमती है।
- आरेख: एक CLV डिस्क का आरेख एक ही लंबे, सर्पिल ट्रैक को दिखाता है जो केंद्र से बाहर की ओर जाता है। ट्रैक के प्रत्येक खंड की लंबाई समान होती है और समान मात्रा में डेटा होता है।
- उपयोग: CD, DVD और Blu-ray जैसे ऑप्टिकल डिस्कों में उपयोग किया जाता है।
(g) ASCII से बाइनरी रूपांतरण के लिए असेंबली प्रोग्राम:
(नोट: प्रश्न में 8080 असेंबली भाषा का उल्लेख है, लेकिन DL और AL रजिस्टर 8086 के हैं। इसलिए, उत्तर 8086 के लिए प्रदान किया गया है, यह मानते हुए कि यह एक टंकण त्रुटि है।) यह प्रोग्राम एक ASCII अंक (जैसे ‘0’ से ‘9’) को उसके 2-अंकीय बाइनरी मान (0 से 9) में परिवर्तित करता है। ASCII में, अंक ‘0’ का मान 30h होता है, ‘1’ का 31h, और इसी तरह। रूपांतरण के लिए, हमें बस 30h (या ASCII ‘0’) घटाना है।
; मान लें कि ASCII अंक DL रजिस्टर में है। ; परिणाम AL रजिस्टर में संग्रहीत किया जाएगा। .MODEL SMALL .CODE START: ; ASCII अंक को DL से AL में ले जाएँ (वैकल्पिक, हम सीधे DL पर काम कर सकते हैं) MOV AL, DL ; ASCII ‘0’ (जो 30h है) घटाएं ; यह ASCII अंक को उसके बाइनरी मान में बदल देगा SUB AL, ‘0’ ; या SUB AL, 30h ; अब AL में बाइनरी मान है। ; उदाहरण के लिए, यदि DL में ‘5’ (35h) था, ; तो AL में अब 35h – 30h = 05h होगा। ; प्रोग्राम समाप्त करें (DOS फ़ंक्शन) MOV AH, 4Ch INT 21h END START (h) भौतिक पता गणना (8086): 8086 में, भौतिक पता (सेगमेंट रजिस्टर * 10h) + ऑफसेट के सूत्र का उपयोग करके गणना की जाती है। (i) SS:SP = 0111h: 00FFh
- सेगमेंट (SS) = 0111h
- ऑफसेट (SP) = 00FFh
- भौतिक पता = (0111h * 10h) + 00FFh
- = 01110h + 00FFh
- = 0120Fh
(ii) CS:IP = 4011h: 01FFh
- सेगमेंट (CS) = 4011h
- ऑफसेट (IP) = 01FFh
- भौतिक पता = (4011h * 10h) + 01FFh
- = 40110h + 01FFh
- = 4030Fh
प्रश्न 2. (a) एक ब्लॉक आरेख की सहायता से एसोसिएटिव मेमोरी के कामकाज की व्याख्या कीजिए। 6 (b) एक फ्लोचार्ट की सहायता से इंटरप्ट-चालित इनपुट/आउटपुट (I/O) तंत्र की व्याख्या कीजिए। इंटरप्ट-चालित I/O प्रोग्राम किए गए I/O से कैसे भिन्न है? 8 (c) निम्नलिखित संख्याओं को दिए गए प्रारूप में परिवर्तित कीजिए: 6 (i) (A23.4)₁₆ -> ()₂ (ii) (242)₁₀ -> ()₁₆ (iii) (29.75)₁₀ -> ()₂
उत्तर.
(a) एसोसिएटिव मेमोरी (Associative Memory): एसोसिएटिव मेमोरी, जिसे कंटेंट-एड्रेसेबल मेमोरी (CAM) भी कहा जाता है, एक विशेष प्रकार की मेमोरी है जिसे उसके पते (address) के बजाय उसकी सामग्री (content) द्वारा एक्सेस किया जाता है। जब डेटा का एक टुकड़ा एसोसिएटिव मेमोरी में प्रस्तुत किया जाता है, तो मेमोरी अपने पूरे स्टोरेज की तुलना उस डेटा से करती है और यदि कोई मिलान मिलता है तो उसका पता लौटाती है। यह पारंपरिक मेमोरी से अलग है, जहाँ आपको डेटा तक पहुँचने के लिए एक विशिष्ट पता प्रदान करना होता है। कार्यप्रणाली और ब्लॉक आरेख: एक एसोसिएटिव मेमोरी सिस्टम के मुख्य घटक हैं:
- आर्गुमेंट रजिस्टर (Argument Register): यह वह डेटा रखता है जिसे मेमोरी में खोजना है।
- की/मास्क रजिस्टर (Key/Mask Register): यह निर्दिष्ट करता है कि आर्गुमेंट रजिस्टर के कौन से बिट्स की तुलना की जानी है। यह आंशिक मिलान (partial matching) की अनुमति देता है।
- मेमोरी ऐरे (Memory Array): यह वास्तविक डेटा संग्रहीत करता है। प्रत्येक शब्द (word) में तुलना के लिए अपना स्वयं का लॉजिक होता है।
- मैच रजिस्टर (Match Register): यह एक आउटपुट रजिस्टर है। मेमोरी में प्रत्येक शब्द के लिए इसमें एक बिट होता है। यदि किसी शब्द की सामग्री आर्गुमेंट रजिस्टर से मेल खाती है, तो मैच रजिस्टर में संबंधित बिट सेट हो जाता है।
कार्यप्रणाली: 1. खोजे जाने वाले डेटा को आर्गुमेंट रजिस्टर में लोड किया जाता है। 2. की रजिस्टर यह निर्दिष्ट करने के लिए सेट किया जाता है कि तुलना में कौन से बिट शामिल करने हैं। 3. एक रीड ऑपरेशन शुरू किया जाता है। 4. मेमोरी ऐरे में प्रत्येक शब्द समानांतर में अपनी सामग्री की तुलना आर्गुमेंट रजिस्टर से करता है। 5. जिन शब्दों में मिलान होता है, वे मैच रजिस्टर में अपने संबंधित बिट को सेट करते हैं। 6. यदि कोई मिलान मिलता है, तो मेमोरी या तो मिलान वाले शब्दों का पता लौटाती है या उन्हें सीधे पढ़ती है। इसका उपयोग उन अनुप्रयोगों में किया जाता है जहाँ तेजी से खोज की आवश्यकता होती है, जैसे कैश मेमोरी में एड्रेस मैपिंग, डेटाबेस और नेटवर्क राउटर। (b) इंटरप्ट-चालित I/O (Interrupt-Driven I/O): इंटरप्ट-चालित I/O एक I/O तंत्र है जो CPU को अन्य कार्यों को करने की अनुमति देता है जबकि I/O मॉड्यूल एक ऑपरेशन पूरा करने की प्रतीक्षा कर रहा होता है। यह प्रोग्राम किए गए I/O की अक्षमता को दूर करता है। फ्लोचार्ट के साथ कार्यप्रणाली: 1. CPU I/O कमांड जारी करता है: CPU एक I/O मॉड्यूल को एक ऑपरेशन (जैसे, डिस्क से पढ़ें) करने का निर्देश देता है। 2. CPU अन्य कार्य करता है: I/O कमांड जारी करने के बाद, CPU I/O डिवाइस के तैयार होने की प्रतीक्षा नहीं करता है। इसके बजाय, यह अन्य निर्देशों को निष्पादित करना जारी रखता है। 3. I/O मॉड्यूल ऑपरेशन करता है: I/O डिवाइस अपना काम पूरा करता है (जैसे, डेटा पढ़ना)। 4. I/O मॉड्यूल इंटरप्ट सिग्नल भेजता है: जब ऑपरेशन पूरा हो जाता है, तो I/O मॉड्यूल CPU को एक इंटरप्ट सिग्नल भेजता है। 5. CPU इंटरप्ट को संभालता है:
- CPU अपने वर्तमान निर्देश को पूरा करता है।
- यह अपनी वर्तमान स्थिति (प्रोग्राम काउंटर, रजिस्टर) को स्टैक पर सहेजता है।
- यह इंटरप्ट सर्विस रूटीन (ISR) पर कूदता है, जो इंटरप्ट को संभालने के लिए एक विशेष प्रोग्राम है।
6. CPU I/O डेटा को प्रोसेस करता है: ISR के भीतर, CPU I/O मॉड्यूल से डेटा को मेमोरी में स्थानांतरित करता है। 7. CPU स्थिति को पुनर्स्थापित करता है: ISR पूरा होने के बाद, CPU स्टैक से अपनी सहेजी गई स्थिति को पुनर्स्थापित करता है। 8. CPU बाधित प्रोग्राम को फिर से शुरू करता है: CPU ठीक उसी जगह से निष्पादन फिर से शुरू करता है जहाँ से उसे बाधित किया गया था। प्रोग्राम किए गए I/O से अंतर:
- CPU उपयोग: प्रोग्राम किए गए I/O में, CPU को लगातार I/O डिवाइस की स्थिति की जांच (पोल) करनी पड़ती है, जिससे CPU चक्र बर्बाद होते हैं। इंटरप्ट-चालित I/O में, CPU केवल तभी शामिल होता है जब I/O डिवाइस तैयार हो, जिससे CPU का कुशल उपयोग होता है।
- दक्षता: इंटरप्ट-चालित I/O बहुत अधिक कुशल है क्योंकि यह CPU को I/O ऑपरेशन के दौरान अन्य कार्यों को करने की अनुमति देता है, जिससे सिस्टम का समग्र प्रदर्शन बेहतर होता है।
- तंत्र: प्रोग्राम किया गया I/O पोलिंग पर निर्भर करता है, जबकि इंटरप्ट-चालित I/O डिवाइस से CPU को भेजे जाने वाले सिग्नल पर निर्भर करता है।
(c) संख्या रूपांतरण: (i) (A23.4)₁₆ -> ()₂ प्रत्येक हेक्साडेसिमल अंक को उसके 4-बिट बाइनरी समकक्ष में बदलें।
- A = 10₁₀ = 1010 ₂
- 2 = 0010 ₂
- 3 = 0011 ₂
- .
- 4 = 0100 ₂
इन्हें एक साथ मिलाने पर: (101000100011.0100)₂ (ii) (242)₁₀ -> ()₁₆ संख्या को 16 से बार-बार विभाजित करें और शेषफल को नोट करें।
- 242 ÷ 16 = 15 शेष 2
- 15 ÷ 16 = 0 शेष 15 (जो हेक्साडेसिमल में F है)
शेषफल को नीचे से ऊपर की ओर पढ़ने पर: F2 । तो, (242)₁₀ = (F2)₁₆ । (iii) (29.75)₁₀ -> ()₂ हम पूर्णांक और भिन्नात्मक भागों को अलग-अलग परिवर्तित करते हैं। पूर्णांक भाग (29): 29 को 2 से बार-बार विभाजित करें।
- 29 ÷ 2 = 14 शेष 1
- 14 ÷ 2 = 7 शेष 0
- 7 ÷ 2 = 3 शेष 1
- 3 ÷ 2 = 1 शेष 1
- 1 ÷ 2 = 0 शेष 1
शेषफल को नीचे से ऊपर पढ़ने पर: 11101 । भिन्नात्मक भाग (0.75): 0.75 को 2 से बार-बार गुणा करें और पूर्णांक भाग को नोट करें।
- 0.75 × 2 = 1 .50 -> 1
- 0.50 × 2 = 1 .00 -> 1
पूर्णांक भागों को ऊपर से नीचे पढ़ने पर: .11 । दोनों भागों को मिलाने पर: (11101.11)₂ ।
प्रश्न 3. (a) निम्नलिखित 7-बिट डेटा के लिए सम और विषम पैरिटी बिट ज्ञात कीजिए: 4 () 0000 (ii) 0000000 (iii) 1011001 (मान लिया गया) (iv) 00000 (b) एक लॉजिक आरेख की सहायता से डिकोडर और मल्टीप्लेक्सर के कामकाज की व्याख्या कीजिए। 10 (c) इंस्ट्रक्शन पाइपलाइनिंग क्या है? इसके चरणों की व्याख्या कीजिए। 6
उत्तर.
(a) सम और विषम पैरिटी बिट: पैरिटी बिट का उपयोग त्रुटि का पता लगाने के लिए किया जाता है। यह एक अतिरिक्त बिट है जिसे डेटा में जोड़ा जाता है ताकि 1 की कुल संख्या या तो सम (सम पैरिटी) हो या विषम (विषम पैरिटी)। (नोट: प्रश्न में दिए गए डेटा (i), (iv) 7-बिट नहीं हैं, और (iii) स्पष्ट नहीं है। हम उन्हें दिए गए अनुसार मानेंगे और (iii) के लिए एक उदाहरण 7-बिट संख्या `1011001` का उपयोग करेंगे।) (i) 1010110 (7-बिट मान लिया गया)
- 1 की संख्या: 4 (सम)
- सम पैरिटी बिट: 0 (कुल 1 की संख्या 4, जो सम है)
- विषम पैरिटी बिट: 1 (कुल 1 की संख्या 5, जो विषम है)
(ii) 0000000
- 1 की संख्या: 0 (सम)
- सम पैरिटी बिट: 0 (कुल 1 की संख्या 0, जो सम है)
- विषम पैरिटी बिट: 1 (कुल 1 की संख्या 1, जो विषम है)
(iii) 1011001 (यह एक उदाहरण 7-बिट संख्या है)
- 1 की संख्या: 4 (सम)
- सम पैरिटी बिट: 0 (कुल 1 की संख्या 4, जो सम है)
- विषम पैरिटी बिट: 1 (कुल 1 की संख्या 5, जो विषम है)
(iv) 1111111 (7-बिट मान लिया गया)
- 1 की संख्या: 7 (विषम)
- सम पैरिटी बिट: 1 (कुल 1 की संख्या 8, जो सम है)
- विषम पैरिटी बिट: 0 (कुल 1 की संख्या 7, जो विषम है)
(b) डिकोडर और मल्टीप्लेक्सर: डिकोडर (Decoder): एक डिकोडर एक संयोजन तर्क सर्किट है जो बाइनरी जानकारी को `n` इनपुट लाइनों से अधिकतम `2^n` अद्वितीय आउटपुट लाइनों में परिवर्तित करता है। दिए गए बाइनरी इनपुट के लिए, केवल एक आउटपुट लाइन सक्रिय (आमतौर पर HIGH) होती है।
- कार्यप्रणाली: यह इनपुट पर बाइनरी कोड को “डीकोड” करता है। उदाहरण के लिए, एक 2-से-4 डिकोडर में 2 इनपुट लाइनें (A, B) और 4 आउटपुट लाइनें (D0, D1, D2, D3) होती हैं। यदि इनपुट AB = 00 है, तो D0 सक्रिय होगा; यदि AB = 01 है, तो D1 सक्रिय होगा, और इसी तरह। अक्सर इसमें एक ‘इनेबल’ इनपुट भी होता है जो डिवाइस को चालू या बंद करता है।
- लॉजिक आरेख (2-से-4 डिकोडर):
- 2 इनपुट: A, B
- 4 आउटपुट: D0, D1, D2, D3
- लॉजिक गेट्स:
- D0 = A’B’
- D1 = A’B
- D2 = AB’
- D3 = AB
- आरेख में दो इनपुट (A, B) और उनके इनवर्टर (A’, B’) होंगे जो चार AND गेट्स को फीड करते हैं, जिनमें से प्रत्येक एक आउटपुट का उत्पादन करता है।
मल्टीप्लेक्सर (Multiplexer – MUX): एक मल्टीप्लेक्सर, जिसे डेटा सेलेक्टर भी कहा जाता है, एक संयोजन तर्क सर्किट है जो कई इनपुट लाइनों में से एक का चयन करता है और चयनित इनपुट को एक ही आउटपुट लाइन पर रूट करता है। चयन `n` चयन लाइनों (select lines) द्वारा नियंत्रित होता है, जो `2^n` इनपुट लाइनों में से एक का चयन कर सकता है।
- कार्यप्रणाली: यह एक डिजिटल स्विच के रूप में कार्य करता है। चयन लाइनों पर बाइनरी मान यह निर्धारित करता है कि कौन सी इनपुट लाइन आउटपुट से जुड़ी है। उदाहरण के लिए, एक 4-से-1 MUX में 4 इनपुट लाइनें (I0, I1, I2, I3), 2 चयन लाइनें (S1, S0), और 1 आउटपुट लाइन (Y) होती है। यदि S1S0 = 00 है, तो Y = I0; यदि S1S0 = 01 है, तो Y = I1, आदि।
- लॉजिक आरेख (4-से-1 मल्टीप्लेक्सर):
- 4 डेटा इनपुट: I0, I1, I2, I3
- 2 चयन लाइनें: S1, S0
- 1 आउटपुट: Y
- लॉजिक: Y = I0·S1’·S0′ + I1·S1’·S0 + I2·S1·S0′ + I3·S1·S0
- आरेख में चार AND गेट होते हैं, प्रत्येक डेटा इनपुट और चयन लाइनों के संयोजन से जुड़ा होता है। इन AND गेट्स के आउटपुट को एक OR गेट में फीड किया जाता है जो अंतिम आउटपुट Y का उत्पादन करता है।
(c) इंस्ट्रक्शन पाइपलाइनिंग (Instruction Pipelining): इंस्ट्रक्शन पाइपलाइनिंग एक ऐसी तकनीक है जिसका उपयोग CPU के थ्रूपुट (प्रति यूनिट समय में निष्पादित निर्देशों की संख्या) को बढ़ाने के लिए किया जाता है। यह एक असेंबली लाइन की तरह काम करता है, जहाँ एक निर्देश के निष्पादन को कई चरणों (stages) में विभाजित किया जाता है। कई निर्देश एक ही समय में निष्पादन के विभिन्न चरणों में हो सकते हैं। जबकि एक निर्देश निष्पादित हो रहा है, अगला निर्देश डीकोड हो रहा है, और उससे अगला निर्देश लाया जा रहा है। पाइपलाइन के चरण: एक क्लासिक पांच-चरणों वाली RISC पाइपलाइन में निम्नलिखित चरण होते हैं:
- इंस्ट्रक्शन फेच (IF – Instruction Fetch): मेमोरी से निर्देश लाया जाता है। प्रोग्राम काउंटर (PC) को अगले निर्देश पर इंगित करने के लिए अपडेट किया जाता है।
- इंस्ट्रक्शन डीकोड (ID – Instruction Decode): लाए गए निर्देश को डीकोड किया जाता है, और आवश्यक ऑपरेंड रजिस्टरों से पढ़े जाते हैं।
- एक्जिक्यूट (EX – Execute): ALU (अरिथमैटिक लॉजिक यूनिट) ऑपरेशन करता है। यदि निर्देश एक अंकगणितीय या तार्किक ऑपरेशन है, तो परिणाम इस चरण में गणना की जाती है। यदि यह एक मेमोरी एक्सेस निर्देश है, तो प्रभावी पते की गणना की जाती है।
- मेमोरी एक्सेस (MEM – Memory Access): यदि आवश्यक हो, तो मेमोरी को पढ़ा या लिखा जाता है। लोड निर्देशों के लिए, डेटा मेमोरी से पढ़ा जाता है। स्टोर निर्देशों के लिए, डेटा मेमोरी में लिखा जाता है।
- राइट बैक (WB – Write Back): परिणाम (या तो ALU से या मेमोरी से) रजिस्टर फ़ाइल में वापस लिखा जाता है।
पाइपलाइनिंग के बिना, एक निर्देश को पूरा होने में 5 क्लॉक साइकिल लगते हैं। पाइपलाइनिंग के साथ, एक बार पाइपलाइन भर जाने पर, प्रत्येक क्लॉक साइकिल में एक निर्देश पूरा हो सकता है, जिससे प्रदर्शन में काफी सुधार होता है।
प्रश्न 4. (a) एक आरेख की सहायता से विल्क्स कंट्रोल यूनिट का वर्णन कीजिए। 8 (b) एक आरेख की सहायता से रिड्यूस्ड इंस्ट्रक्शन सेट कंप्यूटर्स (RISC) में बड़ी रजिस्टर फ़ाइल की भूमिका की व्याख्या कीजिए। 6 (c) एक मेमोरी की क्षमता 4K x 8 है: 6 (i) इसमें कितनी डेटा इनपुट और डेटा आउटपुट लाइनें हैं? (ii) इसमें कितनी एड्रेस लाइनें हैं? (iii) बाइट्स में मेमोरी का आकार क्या है?
उत्तर.
(a) विल्क्स कंट्रोल यूनिट (Wilkes Control Unit): विल्क्स कंट्रोल यूनिट 1951 में मौरिस विल्क्स द्वारा प्रस्तावित माइक्रोप्रोग्राम्ड कंट्रोल यूनिट का पहला कार्यान्वयन था। यह हार्डवायर्ड कंट्रोल यूनिट के विकल्प के रूप में डिजाइन किया गया था। इसका मूल विचार यह है कि कंट्रोल सिग्नल को एक विशेष मेमोरी में संग्रहीत “माइक्रोप्रोग्राम” द्वारा उत्पन्न किया जाना चाहिए, जिसे कंट्रोल स्टोर या कंट्रोल मेमोरी कहा जाता है। आरेख और कार्यप्रणाली: विल्क्स कंट्रोल यूनिट के मुख्य घटक हैं:
- कंट्रोल मेमोरी (ROM): यह माइक्रोप्रोग्राम को संग्रहीत करती है। प्रत्येक पंक्ति (जिसे माइक्रोइंस्ट्रक्शन कहा जाता है) में दो भाग होते हैं:
- कंट्रोल फील्ड: यह उन कंट्रोल सिग्नलों को निर्दिष्ट करता है जिन्हें उत्पन्न किया जाना है (जैसे, ALU ऑपरेशन, रजिस्टर ट्रांसफर)।
- एड्रेस फील्ड: यह अगले माइक्रोइंस्ट्रक्शन का पता निर्दिष्ट करता है जिसे निष्पादित किया जाना है।
- माइक्रोइंस्ट्रक्शन रजिस्टर: यह कंट्रोल मेमोरी से पढ़े गए वर्तमान माइक्रोइंस्ट्रक्शन को रखता है। इसके आउटपुट सीधे कंप्यूटर के विभिन्न घटकों (ALU, रजिस्टर, बस) को कंट्रोल सिग्नल प्रदान करते हैं।
- माइक्रोप्रोग्राम काउंटर (μPC) / एड्रेस रजिस्टर: यह कंट्रोल मेमोरी में अगले माइक्रोइंस्ट्रक्शन का पता रखता है।
- कंडीशनल लॉजिक: यह बाहरी स्थितियों (जैसे, ALU फ्लैग) के आधार पर अगले माइक्रोइंस्ट्रक्शन के पते को संशोधित कर सकता है, जिससे सशर्त शाखा (conditional branching) की अनुमति मिलती है।
कार्यप्रणाली का चक्र: 1. μPC में पते का उपयोग करके कंट्रोल मेमोरी से एक माइक्रोइंस्ट्रक्शन पढ़ा जाता है और माइक्रोइंस्ट्रक्शन रजिस्टर में लोड किया जाता है। 2. माइक्रोइंस्ट्रक्शन का कंट्रोल फील्ड वांछित कंट्रोल सिग्नल उत्पन्न करता है, जिससे एक माइक्रो-ऑपरेशन होता है। 3. उसी माइक्रोइंस्ट्रक्शन का एड्रेस फील्ड (और संभवतः कंडीशनल लॉजिक) अगले माइक्रोइंस्ट्रक्शन का पता निर्धारित करता है। 4. यह नया पता μPC में लोड किया जाता है, और चक्र दोहराया जाता है। यह डिजाइन लचीलापन प्रदान करता है क्योंकि कंप्यूटर के इंस्ट्रक्शन सेट को केवल कंट्रोल मेमोरी में माइक्रोप्रोग्राम को बदलकर संशोधित किया जा सकता है। (b) RISC में बड़ी रजिस्टर फ़ाइल की भूमिका: रिड्यूस्ड इंस्ट्रक्शन सेट कंप्यूटर्स (RISC) का एक मुख्य डिजाइन सिद्धांत मेमोरी एक्सेस को कम करना है। धीमी मेमोरी एक्सेस को कम करने के लिए, RISC आर्किटेक्चर लोड-स्टोर आर्किटेक्चर का उपयोग करते हैं, जहाँ केवल लोड और स्टोर निर्देश ही मेमोरी तक पहुँच सकते हैं। अन्य सभी ऑपरेशन (जैसे, अंकगणित, तर्क) रजिस्टरों पर किए जाते हैं। इस दृष्टिकोण का समर्थन करने के लिए, RISC प्रोसेसर में एक बड़ी रजिस्टर फ़ाइल होती है। इसकी भूमिकाएँ हैं:
- ऑपरेंड स्टोरेज: एक बड़ी संख्या में रजिस्टर होने से कंपाइलर को बार-बार उपयोग किए जाने वाले वेरिएबल्स और मध्यवर्ती परिणामों को मेमोरी के बजाय रजिस्टरों में रखने की अनुमति मिलती है। यह लोड और स्टोर की संख्या को बहुत कम कर देता है, जिससे प्रोग्राम का निष्पादन तेज हो जाता है।
- प्रोसीजर कॉल का अनुकूलन: प्रोसीजर (फ़ंक्शन) कॉल और रिटर्न कम्प्यूटेशन में महत्वपूर्ण ओवरहेड जोड़ते हैं, क्योंकि पैरामीटर पास करने और स्थानीय चर को संग्रहीत करने के लिए रजिस्टरों को स्टैक (मेमोरी में) पर सहेजना और पुनर्स्थापित करना पड़ता है।
रजिस्टर विंडोज (Register Windows): इस ओवरहेड को कम करने के लिए, कुछ RISC आर्किटेक्चर (जैसे SPARC) रजिस्टर विंडोज नामक तकनीक का उपयोग करते हैं।
- अवधारणा: बड़ी रजिस्टर फ़ाइल को ओवरलैपिंग “विंडोज” के सेट में विभाजित किया जाता है। प्रत्येक प्रोसीजर को अपनी स्वयं की रजिस्टर विंडो आवंटित की जाती है।
- आरेख और कार्यप्रणाली: एक विंडो में इनपुट, स्थानीय और आउटपुट रजिस्टरों के लिए क्षेत्र होते हैं। जब प्रोसीजर A, प्रोसीजर B को कॉल करता है, तो B की “इनपुट” रजिस्टर विंडो, A की “आउटपुट” विंडो के साथ ओवरलैप हो जाती है। इसका मतलब है कि A द्वारा अपने आउटपुट रजिस्टरों में रखे गए पैरामीटर स्वचालित रूप से B के लिए इनपुट के रूप में उपलब्ध हो जाते हैं, बिना किसी डेटा मूवमेंट के। एक विंडो पॉइंटर (CWP) बस अगली विंडो पर चला जाता है। यह मेमोरी में रजिस्टरों को सहेजने और पुनर्स्थापित करने की आवश्यकता को बहुत कम कर देता है, जिससे प्रोसीजर कॉल बहुत तेज हो जाती है।
(c) मेमोरी क्षमता (4K x 8): दी गई मेमोरी की क्षमता 4K x 8 है। इसका मतलब है कि मेमोरी में 4K (4096) स्थान हैं, और प्रत्येक स्थान 8 बिट्स डेटा संग्रहीत कर सकता है। (i) डेटा इनपुट और आउटपुट लाइनें: “x 8” भाग इंगित करता है कि मेमोरी एक समय में 8 बिट्स पढ़ या लिख सकती है। इसलिए, इसमें 8 डेटा लाइनें होती हैं। ये या तो 8 अलग-अलग इनपुट और 8 अलग-अलग आउटपुट लाइनें हो सकती हैं, या अधिक सामान्यतः, 8 द्विदिश (bi-directional) डेटा लाइनें । (ii) एड्रेस लाइनें: “4K” भाग मेमोरी स्थानों की संख्या को इंगित करता है।
- 1K = 1024
- 4K = 4 * 1024 = 4096 स्थान।
`n` एड्रेस लाइनों के साथ `2^n` स्थानों को संबोधित किया जा सकता है। हमें `n` ज्ञात करना है ताकि `2^n = 4096` हो। `2^10 = 1024` और `2^2 = 4`। तो, `4096 = 4 1024 = 2^2 2^10 = 2^12`। इसलिए, `n = 12`। मेमोरी में 12 एड्रेस लाइनें हैं। (iii) बाइट्स में मेमोरी का आकार: मेमोरी का आकार (स्थानों की संख्या) × (प्रत्येक स्थान का आकार) है।
- स्थानों की संख्या = 4096
- प्रत्येक स्थान का आकार = 8 बिट्स
चूंकि 1 बाइट = 8 बिट्स , प्रत्येक स्थान 1 बाइट संग्रहीत कर सकता है। तो, कुल आकार = 4096 स्थान × 1 बाइट/स्थान = 4096 बाइट्स । इसे 4 किलोबाइट्स (KB) भी कहा जाता है।
प्रश्न 5. निम्नलिखित पर संक्षिप्त नोट्स लिखिए: 4×5=20 (a) डायरेक्ट मैपिंग कैश ऑर्गेनाइजेशन (b) मेमोरी हायरार्की (c) 8086 माइक्रोप्रोसेसर में इंटरप्ट 21h (d) 8080 असेंबली भाषा में NEAR और FAR प्रोसीजर कॉल
उत्तर.
(a) डायरेक्ट मैपिंग कैश ऑर्गेनाइजेशन (Direct Mapping Cache Organisation): डायरेक्ट मैपिंग कैश मैपिंग की सबसे सरल तकनीकों में से एक है। इस योजना में, मुख्य मेमोरी का प्रत्येक ब्लॉक केवल एक विशिष्ट कैश लाइन में ही मैप हो सकता है। कोई अन्य विकल्प नहीं होता है। कैश लाइन का निर्धारण मुख्य मेमोरी ब्लॉक के पते का उपयोग करके किया जाता है। सूत्र: `कैश लाइन नंबर = (मुख्य मेमोरी ब्लॉक पता) mod (कैश में लाइनों की कुल संख्या)` कार्यप्रणाली: जब CPU किसी पते से डेटा का अनुरोध करता है, तो पते को तीन भागों में विभाजित किया जाता है: टैग, लाइन (या इंडेक्स), और वर्ड (या ऑफसेट)। 1. लाइन/इंडेक्स भाग का उपयोग सीधे उस कैश लाइन को एक्सेस करने के लिए किया जाता है जहाँ ब्लॉक हो सकता है। 2. उस कैश लाइन के टैग की तुलना अनुरोधित पते के टैग भाग से की जाती है। 3. यदि टैग मेल खाते हैं और वैलिड बिट 1 है, तो यह एक कैश हिट होता है, और वर्ड/ऑफसेट का उपयोग करके ब्लॉक के भीतर से डेटा पुनर्प्राप्त किया जाता है। 4. यदि टैग मेल नहीं खाते हैं, तो यह एक कैश मिस होता है। आवश्यक ब्लॉक को मुख्य मेमोरी से लाया जाता है और वर्तमान कैश लाइन में रखा जाता है, और टैग को अपडेट किया जाता है। लाभ और हानि:
- लाभ: यह बहुत सरल और तेज है क्योंकि पता अनुवाद के लिए कोई जटिल तर्क की आवश्यकता नहीं होती है।
- हानि: इसकी मुख्य कमी टकराव (conflict) या थ्रैशिंग (thrashing) की समस्या है। यदि कोई प्रोग्राम बार-बार दो ऐसे ब्लॉकों तक पहुँचता है जो एक ही कैश लाइन पर मैप होते हैं, तो वे लगातार एक-दूसरे को कैश से बाहर निकालते रहेंगे, भले ही कैश में अन्य लाइनें खाली हों। इससे हिट दर कम हो जाती है।
(b) मेमोरी हायरार्की (Memory Hierarchy): मेमोरी हायरार्की एक कंप्यूटर सिस्टम में मेमोरी और स्टोरेज डिवाइसों की एक संरचना है, जिसे प्रदर्शन, क्षमता और लागत के बीच संतुलन बनाने के लिए व्यवस्थित किया जाता है। विचार यह है कि सबसे तेज़, सबसे छोटी और सबसे महंगी मेमोरी को CPU के सबसे करीब रखा जाए, और सबसे धीमी, सबसे बड़ी और सबसे सस्ती मेमोरी को सबसे दूर रखा जाए। पदानुक्रम के स्तर (ऊपर से नीचे):
- CPU रजिस्टर्स: सबसे तेज़, सबसे छोटे और CPU के भीतर स्थित।
- कैश मेमोरी (L1, L2, L3): रजिस्टरों से धीमी लेकिन मुख्य मेमोरी से बहुत तेज़। यह हाल ही में उपयोग किए गए डेटा और निर्देशों को संग्रहीत करती है।
- मुख्य मेमोरी (RAM): कैश से बड़ी और धीमी। यह वर्तमान में चल रहे प्रोग्रामों और उनके डेटा को संग्रहीत करती है। यह वोलेटाइल होती है।
- सेकेंडरी स्टोरेज (SSD, हार्ड डिस्क): मुख्य मेमोरी से बहुत बड़ी लेकिन बहुत धीमी। यह डेटा को स्थायी रूप से संग्रहीत करती है। यह नॉन-वोलेटाइल होती है।
- टर्शियरी/ऑफ-लाइन स्टोरेज (मैग्नेटिक टेप, ऑप्टिकल डिस्क): सबसे धीमी और सबसे बड़ी, मुख्य रूप से बैकअप और आर्काइविंग के लिए उपयोग की जाती है।
यह पदानुक्रम लोकैलिटी ऑफ रेफरेंस (Locality of Reference) के सिद्धांत पर काम करता है, जो बताता है कि प्रोग्राम समय के साथ मेमोरी के छोटे क्षेत्रों तक पहुँचने की प्रवृत्ति रखते हैं। इन छोटे क्षेत्रों को पदानुक्रम में ऊपर की ओर तेज़ मेमोरी में रखकर, सिस्टम एक बड़ी और तेज़ मेमोरी का भ्रम पैदा कर सकता है। (c) 8086 में इंटरप्ट 21h: 8086 माइक्रोप्रोसेसर में, `INT 21h` एक विशेष सॉफ्टवेयर इंटरप्ट है जिसका उपयोग MS-DOS (Microsoft Disk Operating System) सेवाओं या फ़ंक्शंस को कॉल करने के लिए किया जाता है। इसे “DOS फ़ंक्शन कॉल इंटरप्ट” के रूप में जाना जाता है। जब कोई प्रोग्राम `INT 21h` निर्देश निष्पादित करता है, तो CPU नियंत्रण को ऑपरेटिंग सिस्टम को स्थानांतरित कर देता है, जो अनुरोधित सेवा करता है। विशिष्ट सेवा का चयन `AH` (और कभी-कभी अन्य रजिस्टरों) में मान रखकर किया जाता है। प्रोग्रामर वांछित फ़ंक्शन नंबर को `AH` में लोड करता है और फिर `INT 21h` को कॉल करता है। कुछ सामान्य `INT 21h` फ़ंक्शन:
- `AH = 01h` : कीबोर्ड से एक कैरेक्टर पढ़ें (इको के साथ)। कैरेक्टर `AL` में लौटाया जाता है।
- `AH = 02h` : स्क्रीन पर एक कैरेक्टर प्रदर्शित करें। `DL` में प्रदर्शित होने वाला कैरेक्टर होना चाहिए।
- `AH = 09h` : स्क्रीन पर एक स्ट्रिंग प्रदर्शित करें। `DS:DX` को ‘$’ से समाप्त होने वाली स्ट्रिंग पर इंगित करना चाहिए।
- `AH = 4Ch` : प्रोग्राम को समाप्त करें और DOS पर वापस लौटें। `AL` में एक रिटर्न कोड रखा जा सकता है।
यह इंटरप्ट असेंबली भाषा प्रोग्रामिंग में इनपुट/आउटपुट संचालन और अन्य सिस्टम-स्तरीय कार्यों को करने के लिए मौलिक था। (d) NEAR और FAR प्रोसीजर कॉल (8080/8086 में):
(नोट: NEAR और FAR प्रोसीजर 8086 माइक्रोप्रोसेसर की एक विशेषता है, जो इसकी खंडित मेमोरी आर्किटेक्चर (segmented memory architecture) से संबंधित है। 8080 में यह अवधारणा नहीं है, जिसमें एक फ्लैट 64KB एड्रेस स्पेस होता है। इसलिए, यह उत्तर 8086 के संदर्भ में है।) 8086 में, प्रोसीजर (या सबरूटीन) को दो प्रकारों में वर्गीकृत किया जा सकता है: NEAR और FAR। NEAR प्रोसीजर कॉल:
- परिभाषा: एक NEAR कॉल एक ऐसे प्रोसीजर के लिए एक कॉल है जो कॉलर के समान कोड सेगमेंट के भीतर स्थित है।
- कार्यप्रणाली: जब एक `CALL NEAR` निर्देश निष्पादित होता है, तो केवल इंस्ट्रक्शन पॉइंटर (IP) का मान स्टैक पर पुश किया जाता है। फिर IP को लक्ष्य प्रोसीजर के ऑफसेट पते के साथ लोड किया जाता है। चूँकि कोड सेगमेंट (CS) नहीं बदलता है, इसलिए इसे स्टैक पर सहेजने की आवश्यकता नहीं होती है।
- रिटर्न: एक `RET` (या `RETN`) निर्देश IP को स्टैक से पॉप करके नियंत्रण वापस करता है।
FAR प्रोसीजर कॉल:
- परिभाषा: एक FAR कॉल एक ऐसे प्रोसीजर के लिए एक कॉल है जो एक भिन्न कोड सेगमेंट में स्थित हो सकता है।
- कार्यप्रणाली: जब एक `CALL FAR` निर्देश निष्पादित होता है, तो CPU पहले कोड सेगमेंट (CS) रजिस्टर को स्टैक पर पुश करता है, और फिर इंस्ट्रक्शन पॉइंटर (IP) को। इसके बाद, CS और IP दोनों को लक्ष्य प्रोसीर के नए सेगमेंट और ऑफसेट पतों के साथ लोड किया जाता है।
- रिटर्न: एक `RETF` निर्देश पहले IP को और फिर CS को स्टैक से पॉप करके नियंत्रण वापस करता है।
FAR कॉल NEAR कॉल की तुलना में अधिक ओवरहेड लगाते हैं क्योंकि उन्हें स्टैक पर दो मानों (4 बाइट्स) को पुश और पॉप करना पड़ता है, जबकि NEAR कॉल केवल एक मान (2 बाइट्स) को पुश और पॉप करते हैं।
IGNOU MCS-012 Previous Year Solved Question Paper in English
Q1. (a) Explain Von Neumann architecture with the help of a block diagram. 6 (b) Differentiate between SRAM and DRAM. 4 (c) Simplify the following using K-map: 4 F (A, B, C, D) = Σ(0, 2, 8, 9, 10, 11, 4, 5) (d) Find 1’s and 2’s complement of the following : 4 (i) 00000 (ii) 0000 (e) Explain flow diagram of instruction cycle with interrupt cycle. 6 (f) Differentiate between Constant Angular Velocity (CAV) and Constant Linear Velocity (CLV) disks with the help of a diagram of each. 6 (g) Write a program using 8080 assembly language to convert an ASCII digit into equivalent binary. You may assume that the ASCII digit is stored in DL register. The result of this conversion is kept in AL register. 6 (h) Find the physical address for the following pairs of 8086 registers : 4 (i) SS:SP = 0111h: 00FFh (ii) CS:IP = 4011h: 01FFh
Ans. (a) Von Neumann Architecture: The Von Neumann architecture, also known as the Princeton architecture, is a computer architecture based on the concept of a ‘stored-program computer’ . In this design, both the program instructions and the data are stored in the same memory and are accessed using the same bus.
Its key components are:
- Central Processing Unit (CPU): Contains the Arithmetic Logic Unit (ALU) and the Control Unit (CU). It executes instructions.
- Memory Unit: Stores both program instructions and data.
- Input/Output (I/O) Devices: Used for communication with the outside world.
- System Bus: A shared pathway for data and control signals connecting the CPU, memory, and I/O devices.
Description of Block Diagram:
A typical diagram shows a central bus connecting the CPU, Memory Unit, and I/O devices. The CPU is shown containing the ALU, Control Unit, and registers. The memory holds both data and instructions. The bus is composed of an address bus, a data bus, and a control bus.
The main characteristic of this architecture is that it uses the same memory and bus for fetching data and fetching instructions. This leads to a limitation known as the
‘Von Neumann bottleneck’
, as the CPU’s speed is limited by the rate of data transfer from memory.
(b) Difference between SRAM and DRAM:
| Feature | SRAM (Static RAM) | DRAM (Dynamic RAM) | |—|—|—| | Technology | Uses transistors and flip-flops. | Uses capacitors and transistors. | | Refresh | Does not need to be refreshed. | Must be periodically refreshed as capacitors lose their charge. | | Speed | Faster than DRAM. | Slower than SRAM. | | Density | Lower density (fewer bits per chip). | Higher density (more bits per chip). | | Cost | More expensive than DRAM. | Cheaper than SRAM. | | Power Consumption | Lower in idle state, but higher when active. | Consumes more power than SRAM due to constant refreshing. | | Usage | Used mainly in CPU cache memory. | Used mainly as the main memory (RAM) of a computer. |
(c) Simplification using K-Map: For the given boolean function, F (A, B, C, D) = Σm(0, 2, 4, 5, 8, 9, 10, 11). (Note: The question’s minterms are cleaned up by removing duplicates and interpreting ‘ll, 4, 5’ as a continuation of the list, assuming ‘ll’ meant 10, 11). Corrected standard form is assumed to be Σm(0, 2, 4, 5, 8, 9, 10, 11). We will create a 4-variable K-map:
Grouping the 1s in the K-map, we get the following groups:
- A quad (group of four 1s) covering minterms m0, m2, m8, m10 . This group gives the term B’D’ .
- A quad covering minterms m8, m9, m10, m11 . This group gives the term AB’ .
- A pair (group of two 1s) covering minterms m4, m5 . This group gives the term A’BC’ .
Therefore, the simplified expression is:
F(A, B, C, D) = B’D’ + AB’ + A’BC’
Note: The K-map grouping might vary based on interpretation. Another valid simplification using `m0, m4, m2` and `m8, m9` is also possible but might not be minimal. The grouping above is a common minimal solution. Let’s re-verify. `m0,m2,m8,m10` is indeed B’D’. `m8,m9,m10,m11` is indeed `AB’`. `m4,m5` is `A’BC’`. This seems correct.
(d) 1’s and 2’s Complement:
(i) 00000
- 1’s Complement: Invert every bit (0 to 1, 1 to 0). So, the 1’s complement of 00000 is 11111 .
- 2’s Complement: Add 1 to the 1’s complement. 11111 + 1 = 100000. Since we are working with a 5-bit number, we discard the carry, so the result is 00000 .
(ii) 0000
- 1’s Complement: Invert every bit. So, the 1’s complement of 0000 is 1111 .
- 2’s Complement: Add 1 to the 1’s complement. 1111 + 1 = 10000. Since we are working with a 4-bit number, we discard the carry, so the result is 0000 .
Note: In 2’s complement representation, there is only one representation for zero, which is 0.
(e) Flow Diagram of Instruction Cycle with Interrupt Cycle: The instruction cycle is the sequence through which the CPU executes a program. When interrupts are included, the cycle is modified.
Flow Diagram Description:
- Start: The cycle begins.
- Fetch Instruction: The CPU retrieves the next instruction from memory. The Program Counter (PC) is updated to the address of the next instruction.
- Decode Instruction: The CPU interprets the instruction to see what needs to be done.
- Execute Instruction: The CPU performs the required operation using the ALU.
- Check for Interrupt: After execution, the CPU checks if an interrupt signal is pending.
- If No: The cycle goes back to step 2 to fetch the next instruction.
- If Yes:
- Save Context: The CPU saves the state of the current program (e.g., value of PC and other registers) onto the stack.
- Load Interrupt Service Routine (ISR): The CPU loads the address of the ISR from the interrupt vector table and jumps to it.
- Execute ISR: The CPU executes the special code to service the device that generated the interrupt.
- Restore Context: After the ISR is complete, the CPU restores the saved context from the stack.
- Return: The CPU returns to the interrupted program and resumes normal execution. The cycle goes back to step 2.
(f) CAV vs CLV Disks:
Constant Angular Velocity (CAV):
- Definition: In CAV disks, the disk spins at a constant rotational speed (RPM), regardless of which track the read/write head is over.
- Data Density: This means that bits on the outer tracks are more spread out than on the inner tracks, leading to a lower data density on outer tracks.
- Diagram: A diagram of a CAV disk shows concentric circles (tracks), divided into wedges (sectors). Each sector, whether near the center or the edge, stores the same amount of data, but the outer sectors have a larger physical size.
- Usage: Used in Hard Disk Drives (HDDs).
Constant Linear Velocity (CLV):
- Definition: In CLV disks, the rotational speed of the disk is adjusted so that the speed of the track passing under the read/write head remains constant.
- Data Density: This ensures a uniform (constant) data density across the entire disk. The disk spins slower when the head moves to the outer edges and faster when it is near the center.
- Diagram: A diagram of a CLV disk shows a single long, spiral track that winds from the center outwards. Each segment of the track has the same length and holds the same amount of data.
- Usage: Used in optical discs like CDs, DVDs, and Blu-rays.
(g) Assembly Program for ASCII to Binary Conversion: (Note: The question mentions 8080 assembly language but uses DL and AL registers, which belong to the 8086. The answer is therefore provided for the 8086, assuming a typo.)
This program converts an ASCII digit (e.g., ‘0’ to ‘9’) to its 2-digit binary value (0 to 9). In ASCII, the digit ‘0’ has the value 30h, ‘1’ is 31h, and so on. To convert, we simply need to subtract 30h (or ASCII ‘0’).
; Assume the ASCII digit is in the DL register.; The result will be stored in the AL register..MODEL SMALL.CODESTART: ; Move the ASCII digit from DL to AL (optional, we can work on DL directly) MOV AL, DL
; Subtract ASCII '0' (which is 30h) ; This will convert the ASCII digit to its binary value SUB AL, '0' ; or SUB AL, 30h
; Now AL contains the binary value. ; For example, if DL contained '5' (35h), ; AL will now contain 35h - 30h = 05h.
; Terminate program (DOS function) MOV AH, 4Ch INT 21h
END START
(h) Physical Address Calculation (8086): In the 8086, the physical address is calculated using the formula: (Segment Register * 10h) + Offset .
(i) SS:SP = 0111h: 00FFh
- Segment (SS) = 0111h
- Offset (SP) = 00FFh
- Physical Address = (0111h * 10h) + 00FFh
- = 01110h + 00FFh
- = 0120Fh
(ii) CS:IP = 4011h: 01FFh
- Segment (CS) = 4011h
- Offset (IP) = 01FFh
- Physical Address = (4011h * 10h) + 01FFh
- = 40110h + 01FFh
- = 4030Fh
Q2. (a) Explain the functioning of associative memory with the help of a block diagram. 6 (b) Explain the interrupt-driven Input/Output (I/O) mechanism with the help of a flowchart. How is interrupt-driven I/O different from programmed I/O? 8 (c) Convert the following numbers in given format : 6 (i) (A23.4)₁₆ -> ()₂ (ii) (242)₁₀ -> ()₁₆ (iii) (29.75)₁₀ -> ()₂
Ans. (a) Associative Memory: Associative memory, also known as Content-Addressable Memory (CAM) , is a special type of memory that is accessed by its content rather than its address. When a piece of data is presented to associative memory, the memory compares its entire storage against that data and returns the address if a match is found. This is unlike traditional memory, where you must provide a specific address to access data.
Functioning and Block Diagram: The main components of an associative memory system are:
- Argument Register: Holds the data to be searched for in the memory.
- Key/Mask Register: Specifies which bits of the argument register are to be compared. This allows for partial matching.
- Memory Array: Stores the actual data. Each word has its own logic for comparison.
- Match Register: An output register. It has one bit for each word in the memory. If a word’s content matches the argument register, the corresponding bit in the match register is set.
Functioning:
1. The data to be searched is loaded into the Argument Register.
2. The Key Register is set to specify which bits to include in the comparison.
3. A read operation is initiated.
4. Each word in the memory array compares its contents with the argument register in parallel.
5. Words that have a match set their corresponding bit in the Match Register.
6. If a match is found, the memory either returns the address of the matching word(s) or reads them out directly.
It is used in applications where fast searching is required, such as address mapping in cache memory, databases, and network routers.
(b) Interrupt-Driven I/O: Interrupt-driven I/O is an I/O mechanism that allows the CPU to perform other tasks while the I/O module is waiting to complete an operation. It overcomes the inefficiency of programmed I/O.
Functioning with Flowchart: 1. CPU issues I/O command: The CPU instructs an I/O module to perform an operation (e.g., read from disk). 2. CPU does other work: After issuing the I/O command, the CPU does not wait for the I/O device to be ready. Instead, it continues executing other instructions. 3. I/O module performs operation: The I/O device completes its task (e.g., reading the data). 4. I/O module sends interrupt signal: When the operation is complete, the I/O module sends an interrupt signal to the CPU. 5. CPU handles the interrupt:
- The CPU finishes its current instruction.
- It saves its current state (program counter, registers) onto the stack.
- It jumps to the Interrupt Service Routine (ISR) , which is a special program to handle the interrupt.
6.
CPU processes I/O data:
Within the ISR, the CPU transfers the data from the I/O module to memory.
7.
CPU restores state:
After the ISR is complete, the CPU restores its saved state from the stack.
8.
CPU resumes interrupted program:
The CPU resumes execution exactly where it was interrupted.
Difference from Programmed I/O:
- CPU Usage: In programmed I/O, the CPU has to constantly check (poll) the status of the I/O device, wasting CPU cycles. In interrupt-driven I/O, the CPU is only involved when the I/O device is ready, leading to efficient CPU utilization.
- Efficiency: Interrupt-driven I/O is much more efficient because it allows the CPU to do other work during I/O operations, improving the overall system throughput.
- Mechanism: Programmed I/O relies on polling , whereas interrupt-driven I/O relies on a signal sent from the device to the CPU.
(c) Number Conversion:
(i) (A23.4)₁₆ -> ()₂ Convert each hexadecimal digit to its 4-bit binary equivalent.
- A = 10₁₀ = 1010 ₂
- 2 = 0010 ₂
- 3 = 0011 ₂
- .
- 4 = 0100 ₂
Combining them together:
(101000100011.0100)₂
(ii) (242)₁₀ -> ()₁₆ Repeatedly divide the number by 16 and note the remainders.
- 242 ÷ 16 = 15 remainder 2
- 15 ÷ 16 = 0 remainder 15 (which is F in hexadecimal)
Reading the remainders from bottom to top:
F2
.
So,
(242)₁₀ = (F2)₁₆
.
(iii) (29.75)₁₀ -> ()₂ We convert the integer and fractional parts separately.
Integer Part (29): Repeatedly divide 29 by 2.
- 29 ÷ 2 = 14 remainder 1
- 14 ÷ 2 = 7 remainder 0
- 7 ÷ 2 = 3 remainder 1
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
Reading the remainders from bottom to top:
11101
.
Fractional Part (0.75): Repeatedly multiply 0.75 by 2 and note the integer part.
- 0.75 × 2 = 1 .50 -> 1
- 0.50 × 2 = 1 .00 -> 1
Reading the integer parts from top to bottom:
.11
.
Combining both parts: (11101.11)₂ .
Q3. (a) Find the even and odd parity bits for the following 7-bit data : 4 (i) 1010110 (ii) 0000000 (iii) 1011001 (Assumed) (iv) 1111111 (b) Explain the functioning of Decoders and Multiplexer with the help of a logic diagram. 10 (c) What is instruction pipelining ? Explain its stages. 6
Ans. (a) Even and Odd Parity Bits: A parity bit is used for error detection. It is an extra bit added to data to make the total number of 1s either even (even parity) or odd (odd parity). (Note: The data given in the question as (i), (iv) are ambiguous (‘0000’, ‘00000’ are not 7-bit), and (iii) ‘2l’ is a typo. We will use standard 7-bit examples for demonstration).
(i) 1010110
- Number of 1s: 4 (Even)
- Even Parity Bit: 0 (Total 1s become 4, which is even)
- Odd Parity Bit: 1 (Total 1s become 5, which is odd)
(ii) 0000000
- Number of 1s: 0 (Even)
- Even Parity Bit: 0 (Total 1s remain 0, which is even)
- Odd Parity Bit: 1 (Total 1s become 1, which is odd)
(iii) 1011001 (This is an example 7-bit number, assuming a typo for ‘2l’)
- Number of 1s: 4 (Even)
- Even Parity Bit: 0 (Total 1s become 4, which is even)
- Odd Parity Bit: 1 (Total 1s become 5, which is odd)
(iv) 1111111
- Number of 1s: 7 (Odd)
- Even Parity Bit: 1 (Total 1s become 8, which is even)
- Odd Parity Bit: 0 (Total 1s remain 7, which is odd)
(b) Decoder and Multiplexer:
Decoder: A decoder is a combinational logic circuit that converts binary information from `n` input lines to a maximum of `2^n` unique output lines. For a given binary input, only one output line is active (usually HIGH).
- Functioning: It “decodes” the binary code at the input. For instance, a 2-to-4 decoder has 2 input lines (A, B) and 4 output lines (D0, D1, D2, D3). If input AB = 00, D0 will be active; if AB = 01, D1 will be active, and so on. It often includes an ‘Enable’ input that turns the device on or off.
- Logic Diagram (2-to-4 Decoder):
- 2 Inputs: A, B
- 4 Outputs: D0, D1, D2, D3
- Logic Gates:
- D0 = A’B’
- D1 = A’B
- D2 = AB’
- D3 = AB
- The diagram would show the two inputs (A, B) and their inverters (A’, B’) feeding into four AND gates, each producing one output.
Multiplexer (MUX): A multiplexer, also called a data selector, is a combinational logic circuit that selects one of several input lines and routes the selected input to a single output line. The selection is controlled by `n` select lines, which can choose one of `2^n` input lines.
- Functioning: It acts as a digital switch. The binary value on the select lines determines which input line is connected to the output. For example, a 4-to-1 MUX has 4 input lines (I0, I1, I2, I3), 2 select lines (S1, S0), and 1 output line (Y). If S1S0 = 00, then Y = I0; if S1S0 = 01, then Y = I1, etc.
- Logic Diagram (4-to-1 Multiplexer):
- 4 Data Inputs: I0, I1, I2, I3
- 2 Select Lines: S1, S0
- 1 Output: Y
- Logic: Y = I0·S1’·S0′ + I1·S1’·S0 + I2·S1·S0′ + I3·S1·S0
- The diagram would show four AND gates, each connected to a data input and a combination of the select lines. The outputs of these AND gates are fed into an OR gate that produces the final output Y.
(c) Instruction Pipelining: Instruction pipelining is a technique used to increase the throughput of a CPU (the number of instructions executed per unit of time). It works like an assembly line, where the execution of an instruction is broken down into several stages. Multiple instructions can be in different stages of execution at the same time. While one instruction is being executed, the next is being decoded, and the one after that is being fetched.
Stages of a Pipeline: A classic five-stage RISC pipeline consists of the following stages:
- Instruction Fetch (IF): The instruction is fetched from memory. The Program Counter (PC) is updated to point to the next instruction.
- Instruction Decode (ID): The fetched instruction is decoded, and the required operands are read from the registers.
- Execute (EX): The ALU (Arithmetic Logic Unit) performs the operation. If the instruction is an arithmetic or logical operation, the result is calculated in this stage. If it is a memory access instruction, the effective address is calculated.
- Memory Access (MEM): Memory is read or written to if required. For load instructions, data is read from memory. For store instructions, data is written to memory.
- Write Back (WB): The result (either from the ALU or from memory) is written back into the register file.
Without pipelining, one instruction would take 5 clock cycles to complete. With pipelining, once the pipeline is full, one instruction can be completed every clock cycle, significantly improving performance.
Q4. (a) Describe Wilkes control unit with the help of a diagram. 8 (b) Explain the role of large register file in Reduced Instruction Set Computers (RISC) with the help of a diagram. 6 (c) A memory has a capacity of 4K x 8: 6 (i) How many data input and data output lines does it have ? (ii) How many address lines does it have ? (iii) What is the size of the memory in bytes ?
Ans. (a) Wilkes Control Unit: The Wilkes control unit was the first implementation of a microprogrammed control unit , proposed by Maurice Wilkes in 1951. It was designed as an alternative to hardwired control units. The core idea is that the control signals should be generated by a “microprogram” stored in a special memory, called the control store or control memory .
Diagram and Functioning: The main components of a Wilkes control unit are:
- Control Memory (ROM): This stores the microprogram. Each row (called a microinstruction ) has two parts:
- Control Field: Specifies the control signals to be generated (e.g., ALU operations, register transfers).
- Address Field: Specifies the address of the next microinstruction to be executed.
- Microinstruction Register: This holds the current microinstruction read from the control memory. Its outputs directly provide the control signals to the various components of the computer (ALU, registers, bus).
- Microprogram Counter (μPC) / Address Register: Holds the address of the next microinstruction in the control memory.
- Conditional Logic: This can modify the address of the next microinstruction based on external conditions (like ALU flags), allowing for conditional branching.
Cycle of Operation: 1. A microinstruction is read from the control memory using the address in the μPC and loaded into the microinstruction register. 2. The control field of the microinstruction generates the desired control signals, causing a micro-operation to occur. 3. The address field of the same microinstruction (and possibly the conditional logic) determines the address of the next microinstruction. 4. This new address is loaded into the μPC, and the cycle repeats.
This design offers flexibility, as the instruction set of the computer can be modified simply by changing the microprogram in the control memory.
(b) Role of Large Register File in RISC: A core design principle of Reduced Instruction Set Computers (RISC) is to minimize memory access. To reduce slow memory accesses, RISC architectures use a load-store architecture , where only load and store instructions can access memory. All other operations (e.g., arithmetic, logic) are performed on registers.
To support this approach, RISC processors feature a large register file . Its roles are:
- Operand Storage: Having a large number of registers allows the compiler to keep frequently used variables and intermediate results in registers instead of memory. This drastically reduces the number of loads and stores, speeding up program execution.
- Optimizing Procedure Calls: Procedure (function) calls and returns add significant overhead to computation, as registers often have to be saved to and restored from the stack (in memory) to pass parameters and store local variables.
Register Windows: To mitigate this overhead, some RISC architectures (like SPARC) use a technique called register windows .
- Concept: The large register file is divided into a set of overlapping “windows.” Each procedure is allocated its own register window.
- Diagram and Functioning: A window has areas for input, local, and output registers. When procedure A calls procedure B, B’s “input” register window overlaps with A’s “output” window. This means parameters placed by A in its output registers are automatically available as inputs to B, with no data movement. A window pointer (CWP) is simply moved to the next window. This greatly reduces the need to save and restore registers to memory, making procedure calls very fast.
(c) Memory Capacity (4K x 8): The given memory has a capacity of 4K x 8 . This means the memory has 4K (4096) locations, and each location can store 8 bits of data.
(i) Data Input and Output Lines: The “x 8” part indicates that the memory can read or write 8 bits at a time. Therefore, it has 8 data lines . These could be 8 separate input and 8 separate output lines, or more commonly, 8 bi-directional data lines .
(ii) Address Lines: The “4K” part indicates the number of memory locations.
- 1K = 1024
- 4K = 4 * 1024 = 4096 locations.
`n` address lines can address `2^n` locations. We need to find `n` such that `2^n = 4096`.
`2^10 = 1024` and `2^2 = 4`.
So, `4096 = 4
1024 = 2^2
2^10 = 2^12`.
Therefore, `n = 12`. The memory has
12 address lines
.
(iii) Size of the memory in bytes: The size of the memory is (Number of locations) × (Size of each location).
- Number of locations = 4096
- Size of each location = 8 bits
Since
1 Byte = 8 bits
, each location can store 1 Byte.
Total size = 4096 locations × 1 Byte/location =
4096 Bytes
.
This is also known as
4 Kilobytes (KB)
.
Q5. Write short notes on the following: 4×5=20 (a) Direct Mapping Cache Organisation (b) Memory Hierarchy (c) Interrupt 21h in 8086 microprocessor (d) NEAR and FAR procedure calls in 8080 assembly language
Ans. (a) Direct Mapping Cache Organisation: Direct mapping is the simplest of the cache mapping techniques. In this scheme, each block of main memory can map to only one specific cache line. There is no other choice. The cache line is determined by using the address of the main memory block.
Formula: `Cache Line Number = (Main Memory Block Address) mod (Total Number of Lines in Cache)`
Functioning: When the CPU requests data from an address, the address is split into three parts: Tag, Line (or Index), and Word (or Offset). 1. The Line/Index part is used to directly access the cache line where the block might be. 2. The Tag of that cache line is compared with the tag part of the requested address. 3. If the tags match and the valid bit is 1, it is a cache hit , and the data is retrieved from within the block using the Word/Offset . 4. If the tags do not match, it is a cache miss . The required block is fetched from main memory and placed in the current cache line, and the tag is updated.
Advantages and Disadvantages:
- Advantage: It is very simple and fast as there is no complex logic needed for address translation.
- Disadvantage: Its main drawback is the problem of conflict or thrashing . If a program repeatedly accesses two blocks that map to the same cache line, they will constantly evict each other from the cache, even if other lines in the cache are empty. This lowers the hit rate.
(b) Memory Hierarchy: A memory hierarchy is a structure of memory and storage devices in a computer system, organized to balance performance, capacity, and cost. The idea is to have the fastest, smallest, and most expensive memory closest to the CPU, and the slowest, largest, and cheapest memory furthest away.
Levels of the Hierarchy (Top to Bottom):
- CPU Registers: The fastest, smallest, and located within the CPU.
- Cache Memory (L1, L2, L3): Slower than registers but much faster than main memory. It stores recently used data and instructions.
- Main Memory (RAM): Larger and slower than cache. It holds currently running programs and their data. It is volatile.
- Secondary Storage (SSD, Hard Disk): Much larger but much slower than main memory. It stores data permanently. It is non-volatile.
- Tertiary/Off-line Storage (Magnetic Tape, Optical Discs): The slowest and largest, used mainly for backup and archiving.
The hierarchy works based on the principle of
Locality of Reference
, which states that programs tend to access small regions of memory over time. By keeping these small regions in the faster memory higher up the hierarchy, the system can create the illusion of a large and fast memory.
(c) Interrupt 21h in 8086 microprocessor: In the 8086 microprocessor, `INT 21h` is a special software interrupt used to call MS-DOS (Microsoft Disk Operating System) services or functions. It is known as the “DOS function call interrupt.” When a program executes the `INT 21h` instruction, the CPU transfers control to the operating system, which performs the requested service.
The specific service is selected by placing a value in the `AH` (and sometimes other) registers. The programmer loads the desired function number into `AH` and then calls `INT 21h`.
Some common `INT 21h` functions:
- `AH = 01h` : Read a character from the keyboard (with echo). The character is returned in `AL`.
- `AH = 02h` : Display a character on the screen. `DL` must contain the character to be displayed.
- `AH = 09h` : Display a string on the screen. `DS:DX` must point to a ‘$’-terminated string.
- `AH = 4Ch` : Terminate the program and return to DOS. A return code can be placed in `AL`.
This interrupt was fundamental for performing input/output operations and other system-level tasks in assembly language programming.
(d) NEAR and FAR procedure calls in 8080/8086: (Note: NEAR and FAR procedures are a feature of the 8086 microprocessor, related to its segmented memory architecture. The 8080 does not have this concept, having a flat 64KB address space. Therefore, this answer is in the context of the 8086.)
In the 8086, procedures (or subroutines) can be categorized into two types: NEAR and FAR.
NEAR Procedure Call:
- Definition: A NEAR call is a call to a procedure that is located within the same code segment as the caller.
- Operation: When a `CALL NEAR` instruction is executed, only the value of the Instruction Pointer (IP) is pushed onto the stack. The IP is then loaded with the offset address of the target procedure. Since the Code Segment (CS) does not change, it does not need to be saved on the stack.
- Return: A `RET` (or `RETN`) instruction returns control by popping the IP from the stack.
FAR Procedure Call:
- Definition: A FAR call is a call to a procedure that may be located in a different code segment .
- Operation: When a `CALL FAR` instruction is executed, the CPU first pushes the Code Segment (CS) register onto the stack, and then the Instruction Pointer (IP) . Both CS and IP are then loaded with the new segment and offset addresses of the target procedure.
- Return: A `RETF` instruction returns control by popping first the IP and then the CS from the stack.
FAR calls incur more overhead than NEAR calls because they have to push and pop two values (4 bytes) on the stack, whereas NEAR calls only push and pop one value (2 bytes).
Download IGNOU previous Year Question paper download PDFs for MCS-012 to improve your preparation. These ignou solved question paper IGNOU Previous Year Question paper solved PDF in Hindi and English help you understand the exam pattern and score better.
Thanks!
Leave a Reply