Microprocessor Lab Viva Questions
Microprocessor Lab Viva Questions
1. What is a Microprocessor?
A microprocessor is a central processing unit (CPU) on a single integrated
circuit (IC) that performs arithmetic and logic operations, controls other
components, and executes instructions from programs.
2. What is Instruction Set?
An instruction set is a collection of instructions that a microprocessor can
execute. It defines the operations, data types, registers, addressing modes,
and the format of the instructions.
3. What is Logical Address, Physical Address, Base Address, and Linear Address?
Logical Address: The address generated by the CPU during a program
execution.
Physical Address: The actual address in the memory unit.
Base Address: The starting address of a segment in memory.
Linear Address: The address generated after the segmentation process,
which is used to access memory.
4. Explain various flags used in 80386?
Flags in 80386 include:
Zero Flag (ZF): Set if the result of an operation is zero.
Carry Flag (CF): Set if there is a carry out from the most significant
bit.
Sign Flag (SF): Set if the result is negative.
Overflow Flag (OF): Set if there is an overflow in signed arithmetic
operations.
Parity Flag (PF): Set if the number of set bits in the result is even.
5. What is Program Counter?
The Program Counter (PC) is a register that contains the address of the next
instruction to be executed in a program.
6. Explain types of buses used in 80386 MP.
The 80386 microprocessor uses:
Data Bus: Transfers data between the CPU and other components.
Address Bus: Carries the address of the memory location to be
accessed.
Control Bus: Carries control signals to manage the operations of the
CPU and other components.
7. What is meant by Maskable interrupts?
Maskable interrupts are interrupts that can be enabled or disabled by the
CPU. They can be ignored if the CPU is busy with a higher priority task.
8. What is Non-Maskable interrupts?
Non-maskable interrupts are high-priority interrupts that cannot be
disabled or ignored by the CPU. They are used for critical events that
require immediate attention.
9. What are the various types of registers in 80386?
Types of registers include:
Code Segment Register (CS): Points to the segment containing the
current program code.
Data Segment Register (DS): Points to the segment containing data.
Stack Segment Register (SS): Points to the segment containing the
stack.
Extra Segment Register (ES): Used for additional data storage.
10. What is an Opcode?
An Opcode (Operation Code) is a part of an instruction that specifies the
operation to be performed.
11. What is an Operand?
An Operand is a value or address that an instruction operates on.
12. Explain the difference between a JMP and CALL instruction?
JMP: Unconditional jump to a specified address, does not save the return
address.
CALL: Jumps to a specified address and saves the return address on the
stack for later use.
13. What is an Instruction?
An instruction is a binary coded operation that the CPU can execute.
14. What is Microcontroller and Microcomputer?
Microcontroller: A compact integrated circuit designed to govern a specific
operation in an embedded system.
Microcomputer: A small computer that contains a microprocessor, memory,
and input/output peripherals.
15. What is Assembler?
An assembler is a program that converts assembly language code into
machine code.
16. What is the use of HLDA?
HLDA (Hold Acknowledge) is a signal used to indicate that the CPU has
relinquished control of the bus.
17. Explain about "LEA"?
LEA (Load Effective Address) is an instruction used to load the address of a
variable into a register.
18. Difference between "Shift" and "Rotate".
Shift: Moves bits left or right, filling the vacated bit with zero.
Rotate: Moves bits left or right, wrapping the bits around to the other end.
19. Difference between JMP and JNC?
JMP: Unconditional jump to a specified address.
JNC: Jump if no carry flag is set, conditional jump based on the carry flag.
20. What is Software and Hardware?
Software: Programs and applications that run on a computer.
Hardware: The physical components of a computer system.
21. What is assembly language?
Assembly language is a low-level programming language that uses symbolic
instructions to represent machine code.
22. What are machine language and assembly language programs?
Machine Language: Binary code that the CPU can directly execute.
Assembly Language Programs: Human-readable code that is translated into
machine language by an assembler.
23. What is the drawback in machine language and assembly language
programs?
Drawbacks include:
Complexity in programming.
Lack of portability across different hardware.
Difficulty in debugging and maintenance.
24. Define bit, byte, word, doubleword, and quadword.
Bit: The smallest unit of data, representing a binary value (0 or 1).
Byte: A group of 8 bits.
Word: Typically 16 bits (varies by architecture).
Doubleword: 32 bits.
Quadword: 64 bits.
25. What is macro in ALP? Write syntax for macro.
A macro is a sequence of instructions that can be defined and reused in
assembly language programs.
Syntax:
RunCopy code
1MACRO_NAME MACRO
2 ; instructions
3ENDM
26. How to convert hexadecimal number into BCD number and BCD into
hexadecimal number?
Hexadecimal to BCD: Convert each hex digit to its 4-bit binary equivalent,
then group into BCD.
BCD to Hexadecimal: Convert each BCD digit to its hexadecimal equivalent.
27. What is overlapped and non-overlapped block transfer?
Overlapped Block Transfer: Data is transferred in overlapping segments,
allowing for simultaneous operations.
Non-Overlapped Block Transfer: Data is transferred in distinct segments
without overlap.
28. Explain successive addition and Add and shift method to perform
multiplication of two 8-bit hexadecimal numbers.
Successive Addition: Repeatedly add the multiplicand based on the
multiplier's bits.
Add and Shift: Shift the multiplicand left and add it to the result based on
the multiplier's bits.
29. What is NASM, MASM, TASM, and FASM?
NASM: Netwide Assembler, an assembler for x86 architecture.
MASM: Microsoft Macro Assembler, used for Windows applications.
TASM: Turbo Assembler, a fast assembler for DOS and Windows.
FASM: Flat Assembler, a fast assembler for x86 architecture.
30. Which software and operating system do you have used to perform your MP
practicals?
Commonly used software includes NASM, MASM, and TASM on operating
systems like Windows or Linux.
31. Write the commands to compile, link and run the ALP by using NASM
software.
Compile: nasm -f elf32 program.asm
Link: ld -m elf_i386 -s -o program program.o
Run: ./program
32. Explain the structure of ALP (Explain sections used in ALP).
ALP typically consists of:
Data Section: For declaring initialized and uninitialized data.
Text Section: For the code (instructions).
BSS Section: For uninitialized data.
33. Explain structure and use of read, write and exit system call used in ALP.
Read: Reads data from a file descriptor.
Write: Writes data to a file descriptor.
Exit: Terminates the program.
34. Explain non-overlapped block transfer without string specific instructions.
Non-overlapped block transfer can be performed using loops to copy data
byte by byte or word by word from source to destination.
35. Explain overlapped block transfer with string specific instructions.
Overlapped block transfer can be performed using string instructions
like MOVS or LODS to efficiently transfer data.
36. Explain use of the following instructions:
i) BT: Bit Test, checks a specific bit in a register.
ii) ROL & ROR: Rotate Left and Rotate Right, shifts bits around.
iii) CALL: Calls a procedure and saves the return address.
iv) JMP: Jumps to a specified address.
v) RET & IRET: Returns from a procedure and interrupts respectively.
vi) JE/JZ: Jump if Equal/Jump if Zero.
vii) JNE/JNZ: Jump if Not Equal/Jump if Not Zero.
37. How to create a loop in ALP?
A loop can be created using jump instructions to repeat a block of code until
a condition is met.
38. What are the applications of ALP?
Applications include system programming, embedded systems, device
drivers, and performance-critical applications.
Unit 1
1. What are the features of 80386 Microprocessor?
32-bit architecture.
Supports virtual memory and paging.
Enhanced multitasking capabilities.
Integrated memory management unit (MMU).
Supports protected mode and real mode.
2. Which are the components of 80386 Microprocessor? Explain the function of
each component.
ALU (Arithmetic Logic Unit): Performs arithmetic and logical operations.
Registers: Store data temporarily for processing.
Control Unit: Directs the operation of the processor and coordinates
activities.
Bus Interface Unit: Manages data transfer between the CPU and other
components.
3. Explain operating modes of 80386 Microprocessor.
Real Mode: Direct access to memory and hardware, compatible with 8086.
Protected Mode: Supports multitasking and memory protection.
Virtual Mode: Allows running multiple real mode applications
simultaneously.
4. Explain Addressing modes of 80386 Microprocessor with one example.
Immediate Addressing: Operand is specified in the instruction (e.g., MOV
AX, 5).
Direct Addressing: Operand is in memory at a specified address (e.g., MOV
AX, [1234h]).
Indirect Addressing: Operand address is held in a register (e.g., MOV AX,
[BX]).
5. Which are the data types used in 80386 Microprocessor?
Byte: 8 bits.
Word: 16 bits.
Doubleword: 32 bits.
Quadword: 64 bits.
6. Explain the following instruction set:
i) Data Movement Instruction: Moves data between registers and memory.
ii) Binary Arithmetic Instruction: Performs arithmetic operations like
addition and subtraction.
iii) Decimal Arithmetic Instruction: Handles decimal numbers for arithmetic
operations.
iv) Logical Instruction: Performs logical operations like AND, OR, NOT.
v) Control Transfer Instructions: Directs the flow of execution (e.g., jumps,
calls).
vi) String and Character Transfer Instructions: Moves strings or characters
in memory.
vii) Flag Control Instructions: Manipulates the status flags.
viii) Coprocessor Instructions: Interacts with coprocessors for advanced
calculations.
Unit 2
1. Explain functional pin diagram of 80386 microprocessor.
The functional pin diagram includes:
Address Pins: Carry the address of the memory location.
Data Pins: Transfer data to and from memory.
Control Pins: Manage read/write operations and interrupt signals.
Unit 3
1. Explain Address Translation Mechanism with suitable diagram.
The address translation mechanism converts logical addresses to physical
addresses using segmentation and paging. A diagram would typically show
the segmentation table and page table.
2. Explain Segment Translation Process with suitable diagram.
The segment translation process involves using segment descriptors to map
logical addresses to physical addresses. A diagram would illustrate the
segment selector and descriptor table.
3. What is Global Descriptor Table, Local Descriptor Table, Interrupt Descriptor
Table?
Global Descriptor Table (GDT): Contains segment descriptors for all
segments in the system.
Local Descriptor Table (LDT): Contains segment descriptors for a specific
task.
Interrupt Descriptor Table (IDT): Contains descriptors for handling
interrupts.
4. Explain use of Global Descriptor Table Register (GDTR), Local Descriptor Table
Register (LDTR), and Interrupt Descriptor Table Register (IDTR).
GDTR: Points to the base address and limit of the GDT.
LDTR: Points to the base address and limit of the LDT.
IDTR: Points to the base address and limit of the IDT.
5. Draw and Explain general format of Descriptor and Selector.
Descriptor Format: Contains base address, limit, type, and privilege level.
Selector Format: Contains index, table indicator, and privilege level.
6. Explain Page Translation Process with suitable diagram.
The page translation process converts logical addresses to physical
addresses using page tables. A diagram would show the page table and the
mapping of pages.
7. Explain types of segment descriptor (System and Non-system).
System Descriptor: Used for system-level segments like GDT and LDT.
Non-system Descriptor: Used for application-level segments.
Unit 4
1. Explain need for protection.
Protection is needed to prevent unauthorized access to memory and
resources, ensuring system stability and security.
2. Explain Segment level protection.
Segment level protection restricts access to segments based on privilege
levels, ensuring that only authorized tasks can access certain segments.
3. What is type checking and Limit checking?
Type Checking: Ensures that data types are compatible with operations.
Limit Checking: Ensures that memory accesses do not exceed defined
limits.
4. Explain protection levels in 80386.
The 80386 supports four protection levels (0-3), with level 0 being the
highest privilege (kernel mode) and level 3 being the lowest (user mode).
5. Explain DPL, CPL, RPL, EPL.
DPL (Descriptor Privilege Level): The privilege level of a segment descriptor.
CPL (Current Privilege Level): The privilege level of the currently executing
code.
RPL (Requested Privilege Level): The privilege level requested by a segment
selector.
EPL (Effective Privilege Level): The effective privilege level determined by
the lowest DPL and CPL.
6. Explain structure of Call Gate.
A Call Gate is a descriptor that allows a program to call a procedure in a
different privilege level, containing the segment selector and offset.
7. Explain Page level Protection.
Page level protection restricts access to memory pages, allowing for fine-
grained control over memory access.
Unit 5
1. What is multitasking?
Multitasking is the ability of an operating system to execute multiple tasks
or processes simultaneously.
2. Explain structure of Task State Segment, Task State Segment Descriptor, Task
Register.
Task State Segment (TSS): Contains information about a task, including
stack pointers and I/O permissions.
Task State Segment Descriptor: Describes the TSS in the GDT or LDT.
Task Register: Holds the selector for the currently active TSS.
3. What are the features of virtual mode in 80386?
Virtual mode allows running multiple real mode applications, provides
memory isolation, and supports virtual memory.
4. Explain Entering and Leaving 8086 virtual mode.
Entering: The 80386 can enter virtual mode by setting the PE (Protection
Enable) bit in the CR0 register.
Leaving: The processor can exit virtual mode by clearing the PE bit.
5. Explain difference between Real, Protected, and Virtual mode.
Real Mode: Direct access to memory, no protection.
Protected Mode: Memory protection and multitasking support.
Virtual Mode: Allows multiple real mode applications to run simultaneously
with isolation.
Unit 6
1. What is Interrupt and Exception? Explain difference between them.
Interrupt: A signal that temporarily halts the CPU to allow a different task to
be processed.
Exception: An unexpected event that occurs during program execution,
often due to errors.
Difference: Interrupts are external signals, while exceptions are internal
events.
2. Explain software and hardware interrupt.
Software Interrupt: Generated by a program (e.g., system calls).
Hardware Interrupt: Generated by hardware devices (e.g., keyboard,
mouse).
3. Explain maskable and non-maskable interrupt.
Maskable Interrupt: Can be ignored or disabled by the CPU.
Non-Maskable Interrupt: Cannot be ignored, used for critical events.
4. What is microcontroller?
A microcontroller is a compact integrated circuit designed to govern a
specific operation in an embedded system.
5. Explain architecture of Microcontroller.
A microcontroller typically includes a CPU, memory (RAM and ROM), I/O
ports, and peripherals.
6. Difference between microprocessor and microcontroller.
Microprocessor: General-purpose CPU used in computers.
Microcontroller: Designed for specific control applications, includes
integrated peripherals.
7. What are the characteristics and applications of microcontroller?
Characteristics: Low power consumption, integrated peripherals, real-time
processing.
Applications: Embedded systems, automotive controls, home appliances,
robotics.