Instruction Format क्या है?
Instruction Format एक structured layout है, जिसमें CPU के instruction के अलग-अलग components Opcode, Operand और Addressing Mode define किए जाते हैं। यह बताता है, कि instruction memory में कैसे stored है, CPU इसे कैसे decode और execute करेगा।
Table of Contents
ToggleKey Points
- Instruction Format CPU को instruction decode करने में मदद करता है।
- यह define करता है, कि opcode और operand कितने bits में होंगे।
- Operand register, memory, या immediate value हो सकता है।
- Instruction Format efficiency और execution speed बढ़ाने में महत्वपूर्ण है।
- Instruction Format CPU architecture (8085, 8086, ARM, MIPS) पर depend करता है।
- इससे memory utilization और programming आसान होती है।
Example : ADD R1, R2
- Opcode = ADD → operation
- Operands = R1, R2 → data
Components of Instruction Format
(Instruction Format के Components)
Instruction Format मुख्यतः तीन components में divided होता है।
1. Opcode Field
- CPU को बताता है, कि कौन सा operation perform करना है।
- Common operations : ADD, SUB, MOV, LOAD, STORE
- Example
ADD R1, R2
Opcode = ADD
2. Operand Field
- Operand वह data या address है, जिस पर operation perform होगा।
- Types
- Register : CPU के अंदर stored, जैसे R1, R2
- Memory : किसी memory address का reference, जैसे 1000H
- Immediate : Instruction के साथ embedded value, जैसे #25
- Example
MOV A, #25
Operand = A (register), #25 (immediate)
3. Address / Addressing Mode Field
- Operand की location और access method बताता है।
- CPU को पता चलता है, कि operand कहां से access करना है।
- Common Addressing Modes
- Immediate Addressing
- Register Addressing
- Direct Addressing
- Indirect Addressing
- Indexed Addressing
- Example
LOAD R1, 1000H
Address = 1000H → Direct Addressing
Types of Instruction Formats (प्रकार)
CPU के instruction formats मुख्यतः addressing और operand count पर depend करते हैं।
1. Zero-Address Instruction Format (Stack Machine)
- Operand memory से stack के top से लिया जाता है।
- Instruction में कोई explicit address नहीं होता।
- Structure : Opcode
PUSH A
POP B
ADD
2. One-Address Instruction Format
- एक operand memory या register में होता है।
- Accumulator (AC) का use होता है।
- Structure : Opcode | Address
LOAD X ; AC = X
ADD Y ; AC = AC + Y
STORE Z ; Z = AC
3. Two-Address Instruction Format
- Two operands होते हैं: source और destination।
- Result usually destination में stored होता है।
- Structure : Opcode | Source | Destination
- Example
MOV R1, R2 ; R1 = R2
ADD R1, R3 ; R1 = R1 + R3
4. Three-Address Instruction Format
- इसमें three operands होते हैं: two sources + one destination।
- Complex operations fewer instructions में perform होते हैं।
- Structure : Opcode | Source1 | Source2 | Destination
- Example :
ADD R1, R2, R3 ; R1 = R2 + R3
Advantages of Instruction Format (लाभ)
- CPU decoding is easy
- Instruction structured होने की वजह से CPU आसानी से decode कर सकता है।
- Execution speed increases
- Efficient instruction format से CPU जल्दी और organized तरीके से instructions execute करता है।
- Memory Efficient Use
- Structured format से memory का proper utilization होता है।
- Fixed or variable-length instructions में trade-off हो सकता है, लेकिन generally instruction format memory optimize करता है।
- Programming is easy
- Assembly language programmers को पता होता है कि instruction में opcode, operand और address कैसे use होंगे।
- Supports Multiple Addressing Modes
- Immediate, Direct, Indirect, Indexed जैसे addressing modes instruction format से possible होते हैं।
Disadvantages of Instruction Format (हानियाँ)
- Fixed-Length Instructions में Memory Waste
- Simple operations के लिए भी same size instruction use होती है।
- Complex Instructions Slow Decoding
- Variable-length या three-address instructions decode करना CPU के लिए complex हो सकता है।
- Flexibility may be reduced
- कुछ simple CPU architectures में instruction format fixed होने की वजह से flexibility कम होती है।
- Memory-operand instructions can be slow
- Operand memory में stored होने पर CPU को extra fetch cycles लेने पड़ते हैं।
Conclusion (निष्कर्ष)
Instruction Format Computer Architecture का core concept है। यह CPU को बताता है, कि instruction memory में कैसे store है और इसे कैसे execute करना है।
- Structured Instruction Format से CPU decoding आसान और तेज हो जाता है।
- Proper instruction format → execution speed बढ़ती है और memory efficient use होती है।
- Different formats जैसे Zero, One, Two, Three address और Variable-length अलग-अलग CPU architectures में flexibility और efficiency balance करते हैं।
अक्सर पूछे जाने वाले प्रश्न (FAQ)
Q1. Instruction Format क्या है?
- CPU के instruction का structured layout जिसमें Opcode, Operand और Addressing Mode शामिल होते हैं। यह CPU को instruction decode और execute करने में मदद करता है।
Q2. Opcode और Operand में अंतर क्या है?
- Opcode → operation बताता है (जैसे ADD, MOV), Operand → data या address होता है जिस पर operation perform होगा।
Q3. Instruction Format के मुख्य प्रकार कौन से हैं?
- Zero-Address
- One-Address
- Two-Address
- Three-Address
Q4. Addressing Mode क्या होता है?
- यह बताता है कि operand CPU को कहाँ से मिलेगा और कैसे access होगा। Common modes: Immediate, Direct, Indirect, Register, Indexed।
Q5. Three-Address Instruction Format का advantage क्या है?
- Complex operations single instruction में complete हो जाते हैं – fewer instructions और faster execution।
Q7. Instruction Format CPU performance को कैसे affect करता है?
- Efficient format → faster decoding, memory optimization और overall execution speed बढ़ती है।





