Microprocessor Important Questions
Microprocessor Important Questions
-Ronish Neupane
WELCOME
● Opcode Fetch: The process of fetching the operation code (opcode) from memory.
● Timing Diagram:
○ T1: Address placed on the address bus.
○ T2: Memory read signal activated.
○ T3: Opcode fetched from memory into the instruction register.
● Instruction Cycle:
○ Time taken to fetch, decode, and execute an instruction.
● Opcode MOV A, B:
○ Opcode (78H) is fetched.
○ Timing includes fetch (T1, T2, T3) and execute cycles (T4).
● Definition: Signals that pause the current process to handle high-priority tasks.
● Types:
○ Maskable Interrupts: Can be enabled or disabled (e.g., RST 7.5, RST 6.5).
○ Non-Maskable Interrupts: Always recognized (e.g., TRAP).
● Vector Address: Each interrupt corresponds to a specific memory address.
● MVI A, 35H:
○ Fetch Cycle: Opcode fetched from memory.
○ Execution Cycle: Data (35H) loaded into register A.
● LXI H, 5070H:
○ Fetch Cycle: Opcode fetched.
○ Memory Read Cycles: Lower byte (70H) and higher byte (50H) loaded into
the HL pair.
●
Linkedin
Facebook
Instagram
Telegram
1. Explain 8085 Instruction Addressing Modes with Examples [5] [2018], [2020]
● Addressing Modes:
1. The methods by which the operand of an instruction is specified.
2. Immediate Addressing:
■ Operand is directly specified in the instruction.
■ Example: MVI A, 32H (Load A with 32H).
3. Direct Addressing:
■ Address of the operand is given in the instruction.
■ Example: LDA 2000H (Load A with data from memory location
2000H).
4. Register Addressing:
■ Operand is in a register.
■ Example: MOV A, B (Move data from register B to A).
5. Register Indirect Addressing:
■ Address of the operand is in a register pair.
■Example: MOV A, M (Load A with data from memory pointed by HL
pair).
6. Implied Addressing:
■ Operand is implied in the instruction.
■ Example: CMA (Complement accumulator).
● Functional Blocks:
1. Arithmetic and Logic Unit (ALU):
■ Performs arithmetic and logical operations.
2. Registers:
■ Temporary storage for data.
■ Includes accumulator, general-purpose registers, and special-purpose
registers (e.g., PC, SP).
3. Timing and Control Unit:
■ Synchronizes operations using clock signals.
■ Generates control signals for instruction execution.
4. Interrupt Control:
■ Handles external interrupts.
5. Instruction Decoder:
■ Decodes and executes instructions.
6. Address and Data Bus:
■ Address Bus: Specifies memory locations.
■ Data Bus: Transfers data between components.
3. Define ALP Using 8085 to Check if a Number at 8080H is Even or Odd [5] [2019]
EVEN: MVI A, 00H ; Load 00H (Even) into accumulator STA 8081H ; Store result in 8081H
HLT ; Halt program
---
#### 4. **Define Instruction Set and Classify Instructions in 8085 with Examples** [2+8]
[2019]
- **Instruction Set**:
- **Classification**:
2. **Arithmetic Instructions**:
3. **Logical Instructions**:
4. **Branching Instructions**:
5. **Control Instructions**:
---
#### 5. **Write a Program to Add Two Tables Starting at 3000H and 3020H** [7] [2020]
- **Problem**: Add two tables of 20 bytes and store the sum and carry at 3040H and 3060H
respectively.
- **Program**:
LXI H, 3000H ; Point to the first table LXI D, 3020H ; Point to the second table LXI B, 3040H
; Point to store sum MVI C, 14H ; Counter for 20 bytes LOOP: MOV A, M ; Load value from
first table INX H ; Increment pointer ADD M ; Add value from second table INX D ; Increment
second pointer MOV M, A ; Store sum in memory INX B ; Increment sum pointer DCR C ;
Decrement counter JNZ LOOP ; Repeat until all bytes are added HLT ; End program
---
#### 6. **Explain the Use of Flags and Different Flags of 8085 with Example** [1+4] [2021]
- **Use of Flags**:
- **Flags**:
- **Example**:
---
#### 7. **Program to Sort 10 Bytes of Data in Ascending Order** [7] [2021 Batch]
- **Program**:
LXI H, 7050H ; Point to the start of the data MVI C, 0AH ; Number of elements SORT: MOV
D, M ; Load the first element INX H ; Point to the next element CMP M ; Compare with the
next element JC SKIP ; Skip if already in order XCHG ; Exchange if out of order SKIP: DCX
H ; Point back to the previous element DCR C ; Decrement counter JNZ SORT ; Repeat for
remaining elements HLT ; Halt program
Linkedin
Facebook
Instagram
Telegram
2. What is Cache Memory? Explain the Elements of Cache Design [5] [2019]
● Definition: Hard disks are secondary storage devices that store data magnetically on
spinning platters.
● Structure:
○ Platters: Circular disks coated with magnetic material.
○ Spindle: Rotates the platters.
○ Read/Write Head: Reads or writes data.
○ Actuator Arm: Moves the head across the platter surface.
○ Tracks, Sectors, and Cylinders: Logical divisions of the platter for data
organization.
● Definition: A common bus system allows multiple components (CPU, memory, I/O
devices) to share a single data communication path.
● Requirements:
○ Efficiency: Reduces the number of connections needed.
○ Control Signals: Coordinates access to the bus (e.g., Read/Write, Select).
○ Data and Address Lines: Separate pathways for data transfer and memory
addressing.
Diagram:
CPU ↔ Bus ↔ Memory
↔ Bus ↔ I/O Devices
Linkedin
Facebook
Instagram
Telegram
● Accumulator: A special register in the CPU that stores intermediate arithmetic and
logical results.
● Design:
○ Input: Data from memory or ALU.
○ Output: Data sent to ALU or memory.
○ Control Signals:
■ Load: Load data into the accumulator.
■ Clear: Reset the accumulator.
■ Enable: Output data from the accumulator.
● Control Logic:
○ Uses flip-flops and logic gates to manage operations (e.g., ADD, SUB, AND,
OR).
● Example:
○ ADD operation: Accumulator = Accumulator + Operand.
Symbolic Microprogram:
T1: MAR ← PC // Load memory address from PC
T2: MDR ← Memory[MAR] // Fetch instruction
T3: IR ← MDR // Load instruction into instruction register
T4: PC ← PC + 1 // Increment PC
● Microprogram Sequencer:
1. Generates the address of the next microinstruction.
2. Works based on current microinstruction and status flags.
● Components:
1. Address Selection Logic: Determines the next address (e.g., increment,
branch).
2. Branch Logic: Handles conditional branches.
3. Control Memory: Stores microinstructions.
Diagram:
Current Address → Sequencer → Control Memory → Control Data Register → Control
Signals
● Symbolic Microinstruction:
○ A human-readable representation of a microinstruction.
○ Example: ADD A, B means "add contents of A and B and store in A."
● Microinstruction Format:
○ Fields:
■ Opcode Field: Specifies operation.
■ Source Field: Specifies source register.
■ Destination Field: Specifies target register.
■ Address Field: Indicates the next microinstruction.
6. Steps of Address Sequencing and Address Selection for Control Memory [5+5]
[2021]
Diagram:
Sequencer → MUX → Control Memory
○
7. Control Unit’s Role in Determining Instruction Type [5] [2021]
● Steps:
1. Fetch the instruction.
2. Decode the opcode to determine the type (arithmetic, logical, branch).
3. Generate control signals accordingly.
● Structure:
○ Input: Instruction register, status flags.
○ Output: Control signals for various CPU components.
○ Components:
■ Decoder: Decodes instructions.
■ Sequencer: Determines execution sequence.
■ Control Logic: Generates appropriate signals.
● Requirements:
○ Efficient instruction execution.
○ Flexibility for complex instructions.
Linkedin
Facebook
Instagram
Telegram
1. Define Control Word. Explain the Procedure for Generating Control Word for
Specific Operation [5] [2018]
● Control Word:
1. A binary encoded signal used to control various operations in the CPU, such
as data transfer and arithmetic operations.
2. Specifies micro-operations for components like ALU, memory, and I/O.
● Procedure:
1. Decode the instruction to identify the operation.
2. Determine the required micro-operations.
3. Generate binary codes for each operation (e.g., read, write, ALU operation).
4. Combine these codes into a single control word.
2. Explain Different Data Transfer and Manipulation Instructions with Examples [10]
[2018]
● Instruction Mapping:
1. Translating an instruction's opcode into a microinstruction address in control
memory.
● Conversion Steps:
1. Decode the opcode from the instruction register.
2. Use the decoded opcode as an address or index for control memory.
3. Fetch the microinstructions from the corresponding address.
● Stack:
○ A Last-In-First-Out (LIFO) data structure used for temporary storage during
program execution.
● Stack Organization:
○ Structure:
■ Operates via a Stack Pointer (SP) register pointing to the top of the
stack.
■ Data is pushed onto or popped from the stack.
○ Operations:
■ Push: Add data to the stack.
■ Pop: Remove data from the stack.
Example:
PUSH B → Store contents of register B on the stack.
POP A → Retrieve top stack value into register A.
7. Differences Between Branch Instruction, Call Subroutine, and Program Interrupt [5]
[2021]
Feature Branch Instruction Call Subroutine Program Interrupt
● Word Count:
○ The number of words (fixed-sized data units) in a block of memory or during a
transfer operation.
○ Example: If word size = 16 bits and transfer size = 32 bits, word count = 2.
Linkedin
Facebook
Instagram
Telegram
● Instruction Pipeline:
○ While one instruction is in the decode stage, another can be fetched, and
another can be executed, reducing idle time.
● Arithmetic Pipeline:
● Parallel Processing:
1. Increased throughput.
2. Reduced execution time.
3. Efficient resource usage.
● Flynn's Classification:
● Pipeline Conflict:
1. Occurs when two or more instructions in a pipeline interfere with each other,
causing delays.
● Types of Conflicts:
1. Data Dependency:
● Four-Segment Pipeline:
○ The same as explained earlier under Instruction Pipeline.
Diagram:
Time → | FI | DI | EI | WB |
| FI | DI | EI | WB |
| FI | DI | EI | WB |
○
○ Each stage works on different instructions simultaneously.
● Pipelining Hazards:
1. Conditions that prevent the next instruction in the pipeline from executing in
the next cycle.
● Types:
1. Structural Hazard: Resource conflict (e.g., two instructions need the same
hardware).
2. Data Hazard: Dependency between instructions.
3. Control Hazard: Branch instructions altering the control flow.
● Vector Processing:
○ A technique to perform operations on entire arrays or vectors of data in a
single instruction.
○ Used in applications like scientific computing, AI, and graphics processing.
● Features:
○ Operates on multiple data points simultaneously.
○ Uses vector registers and pipelines for efficiency.
Instagram
Telegram