Instructions Formats & its Types and RISC Instruction
Instruction Format
Computer दिए गए Instruction के Base पर एक Work करता है। Computer में Instruction Field का एक Group include होते हैं। इन Field में अलग-अलग Information होती है क्योंकि Computer के लिए सब कुछ 0 और 1 में होता है इसलिए प्रत्येक Field का अलग-अलग Important होता है जिसके Base पर CPU define करता है कि क्या करना है और क्या नहीं
Types of Instruction Format
1. Three Address
General Register Organization वाले CPU, Three Address Instruction Format का use कर सकता है| Three Address Instruction Format को use करने वाले Computer में प्रत्येक Address Field या तो Register या Memory Operand को प्रदर्शित करता है| Three Address Instruction Format में Assembly Language के द्वारा program को कुछ इस प्रकार लिखा जाता है | Program Expression X = (A + B) ∗ (C + D) कुछ इस प्रकार है
ADD R1, A, B R1 ← M [A] + M [B] ADD R2, C, D R2 ← M [C] + M [D] MUL X, R1, R2 M [X] ← R1 ∗ R2
Computer में दो processor Register R1 और R2 का use किया गया है और M[ ] यहाँ Memory location है| Three Address Instruction Format का सबसे अच्छा लाभ यह है कि जब किसी Arithmetical expression को Solve करके program बनाया जाता है तो वह काफी छोटा होता है|
2. Two Address
Two Address Instruction Format वाले CPU में General Register Organization का use किया जाता है| सामान्यता Commercial वाले Computer में Two Address Instructions का मुख्यत: use किया जाता है यहाँ भी प्रत्येक Address Field या तो Processor Register या Memory word को Display कर सकती है जो CPU, General Register Organization के अंतर्गत आते है वो CPU किसी Equation program X = (A + B) ∗ (C + D) को कुछ इस प्रकार से solve करते है
MOV R1, A R1 ← M [A] ADD R1, B R1 ← R1 + M [B] MOV R2, C R2 ← M [C] ADD R2, D R2 ← R2 + M [D] MUL R1, R2 R1 ← R1∗R2 MOV X, R1 M [X] ← R1
यहाँ MOV instruction के द्वारा operands का Memory से आदान प्रदान किया जाता है एक instruction में दिए गए पहले चिन्ह को Source और Destination दोनों समझा जाता है जहाँ Operation के Result को Transfer किया जाता है |
3. One Address
One Address Instruction Format में भी Data manipulation के लिए Accumulator Register Organization का use किया जाता है One Address Instruction Format में multiplication और Division करने के लिए दूसरे Register की अवश्यकता होती है फिर भी हम यह मान सकते है कि दूसरे Register की आवश्क्यता नहीं है | AC में सभी operations के Result को सुरक्षित किया जायेगा | Accumulator register organization में किसी एक Equation X = (A + B) ∗ (C + D) को solve करने का प्रोग्राम कुछ इस प्रकार होगा |
LOAD A AC ← M [A] ADD B AC ← A [C] + M [B] STORE T M [T] ← AC LOAD C AC ← M [C] ADD D AC ← AC + M [D] MUL T AC ← AC ∗ M [T] STORE X M [X] ← AC
यहाँ सभी operations memory Operand और AC Register मध्य किये जाते है | T यहाँ Temporary Memory का Address है जहाँ Intermediate Result को सुरक्षित किया जाता है|
4. Zero Address
zero address instruction का use CPU के Stack Organization में किया जाता है| stack Organized Computer में instruction ADD और SUB के लिए किसी address field की अवश्यकता नहीं होती है हालाँकि PUSH और POP instructions को एक Address की अवशयक्ता होती है| जो stack के साथ Communication करने वाले operand display करता है stack organized Computer के द्वारा Equation X = (A + B) ∗ (C + D) को Solve करने का एक program कुछ इस प्रकार है इस program में stack के TOP को TOS ( TOP Of stack ) से display किया गया है |
PUSH A TOS ← A PUSH B TOS ← B ADD TOS ← (A + B) PUSH C TOS ← C PUSH D TOS ← D ADD TOS ← (C + D) MUL TOS ← (C + D) ∗ (A + B) POP X M [X] ← TOS
Stack Organized computer में एक Arithmetic Expression को Solve करने के लिए , Equation को Reverse Polish notation के रूप में निरूपित करने की अवश्यकता होती है|
RISC Instruction
RISC का पूरा नाम Reduced Instruction Set Computer है| इसे IBM Company द्वारा बनाया गया था। इसे कम संख्या में Computer Instruction को Execute करने के लिए Design किया गया है यह बहुत तेजी से Operation कर सके। इसके तेज होने का एक कारण यह भी है की इसमें Instruction छोटे और सरल होते है जिससे अधिकांश Instruction का Execute एक चक्र (Cycle) में पूरा हो जाता है, और Processor को एक ही समय में कई Instruction को संभालने में आसानी होती है।