Microprocessor Basics
1.
Which of the following is NOT a component of a microprocessor?
a) ALU
b) Control Unit
c) Memory Unit
d) Registers
Answer: c) Memory Unit
Explanation: A microprocessor contains the Arithmetic Logic Unit (ALU), Control Unit, and Registers. The memory unit is external and
interfaces with the microprocessor.
2.
What does the clock speed of a microprocessor indicate?
a) The number of instructions executed per second
b) The number of cycles executed per second
c) The size of the instruction set
d) The number of I/O operations
Answer: b) The number of cycles executed per second
Explanation: Clock speed is measured in Hertz and represents how many cycles the microprocessor can execute in one second.
3.
Which microprocessor is called an 8-bit microprocessor?
a) 8085
b) 8086
c) 8051
d) 8087
Answer: a) 8085
Explanation: The 8085 microprocessor is an 8-bit processor because it can process 8 bits of data simultaneously.
4.
Which of the following microprocessors is a 16-bit processor?
a) 8085
b) 8086
c) 8051
d) Z80
Answer: b) 8086
Explanation: The 8086 microprocessor is a 16-bit processor because its data bus is 16 bits wide.
5.
What is the main function of the accumulator in a microprocessor?
a) Perform arithmetic operations
b) Store instructions
c) Act as an input/output interface
d) Control program execution
Answer: a) Perform arithmetic operations
Explanation: The accumulator is a register used for arithmetic and logic operations in the ALU.
6.
Which addressing mode uses the value directly specified in the instruction?
a) Immediate Addressing Mode
b) Register Addressing Mode
c) Direct Addressing Mode
d) Indirect Addressing Mode
Answer: a) Immediate Addressing Mode
Explanation: In immediate addressing mode, the operand (data) is directly provided in the instruction.
7.
Which signal in a microprocessor is used to reset all operations?
a) Interrupt
b) Clock
c) Reset
d) Wait
Answer: c) Reset
Explanation: The reset signal initializes the microprocessor by clearing registers and restarting operations.
8.
What is the maximum memory size that can be addressed by a 16-bit microprocessor?
a) 16 KB
b) 32 KB
c) 64 KB
d) 128 KB
Answer: c) 64 KB
Explanation: A 16-bit microprocessor can address 2^16 memory locations. Each location corresponds to 1 byte, so the total is 64 KB.
9.
Which type of bus is used to transfer data in and out of the microprocessor?
a) Address Bus
b) Data Bus
c) Control Bus
d) Serial Bus
Answer: b) Data Bus
Explanation: The data bus is responsible for transferring data between the processor and other components.
10.
What is the function of the instruction register?
a) To fetch instructions from memory
b) To decode the fetched instruction
c) To execute the instruction
d) To store the results of execution
Answer: b) To decode the fetched instruction
Explanation: The instruction register holds the current instruction to be executed and sends it for decoding.
Microcontroller Basics
11.
What is the primary difference between a microprocessor and a microcontroller?
a) Microcontrollers do not have a CPU
b) Microcontrollers have on-chip peripherals
c) Microprocessors consume less power than microcontrollers
d) Microprocessors are used in embedded systems
Answer: b) Microcontrollers have on-chip peripherals
Explanation: Unlike microprocessors, microcontrollers have integrated peripherals like timers, ADCs, and I/O ports.
12.
Which of the following microcontrollers is widely used?
a) 8051
b) 8085
c) 8086
d) ARM7
Answer: a) 8051
Explanation: The 8051 microcontroller is one of the most widely used microcontrollers in embedded systems.
13.
Which memory in a microcontroller is used for program storage?
a) RAM
b) ROM/Flash
c) Cache
d) EEPROM
Answer: b) ROM/Flash
Explanation: Program code is stored in ROM or Flash memory in microcontrollers to retain the program even when powered off.
14.
What is the typical clock frequency of an 8051 microcontroller?
a) 1 MHz
b) 11.0592 MHz
c) 100 MHz
d) 20 MHz
Answer: b) 11.0592 MHz
Explanation: The 8051 microcontroller commonly operates at 11.0592 MHz, which supports UART baud rate generation.
15.
Which pin of the 8051 microcontroller is used for reset?
a) Pin 1
b) Pin 9
c) Pin 18
d) Pin 40
Answer: b) Pin 9
Explanation: Pin 9 of the 8051 microcontroller is the reset pin, used to reset the microcontroller to its initial state.
16.
What is the purpose of timers in a microcontroller?
a) Generate clock signals
b) Measure time intervals
c) Control peripherals
d) Perform arithmetic operations
Answer: b) Measure time intervals
Explanation: Timers in a microcontroller are used to count or measure time intervals for various tasks.
17.
What is the function of the interrupt system in a microcontroller?
a) Execute the next instruction
b) Transfer control to a specific service routine
c) Stop the processor
d) Clear memory
Answer: b) Transfer control to a specific service routine
Explanation: Interrupts temporarily halt the normal program execution to execute a specific task.
18.
What does UART stand for in microcontroller communication?
a) Universal Asynchronous Receiver Transmitter
b) Unidirectional Asynchronous Receiver Transmitter
c) Universal Analog Receiver Transmitter
d) Universal Automatic Receiver Transmitter
Answer: a) Universal Asynchronous Receiver Transmitter
Explanation: UART is a serial communication protocol for transmitting and receiving data asynchronously.
19.
What is the purpose of the watchdog timer in a microcontroller?
a) Measure input voltages
b) Reset the system during malfunction
c) Control I/O operations
d) Enhance instruction execution speed
Answer: b) Reset the system during malfunction
Explanation: A watchdog timer ensures the system restarts in case of a software malfunction or program hang.
20.
Which is an 8-bit microcontroller?
a) 8051
b) 8086
c) ARM7
d) PIC32
Answer: a) 8051
Explanation: The 8051 is an 8-bit microcontroller because it processes 8-bit data at a time.
Advanced Microcontroller Concepts
21.
What is an ISR (Interrupt Service Routine)?
a) A program executed when an interrupt occurs
b) A type of timer in the microcontroller
c) A subroutine stored in the cache
d) A method to increase clock speed
Answer: a) A program executed when an interrupt occurs
Explanation: ISR is a special program that executes when an interrupt is triggered, allowing the microcontroller to respond to events.
22.
In a microcontroller, what is the purpose of GPIO pins?
a) General Peripheral Operations
b) General Program Output
c) General Purpose Input/Output
d) General Processing Instructions
Answer: c) General Purpose Input/Output
Explanation: GPIO pins are used to interface the microcontroller with external devices for input and output operations.
23.
Which type of ADC (Analog to Digital Converter) is typically used in microcontrollers?
a) Flash ADC
b) Delta-Sigma ADC
c) Successive Approximation ADC
d) Dual Slope ADC
Answer: c) Successive Approximation ADC
Explanation: Successive Approximation ADCs are widely used in microcontrollers because of their balance of speed, accuracy, and cost.
24.
What is PWM (Pulse Width Modulation) used for in microcontrollers?
a) Measuring temperature
b) Digital-to-analog conversion
c) Controlling the speed of motors
d) Enabling interrupts
Answer: c) Controlling the speed of motors
Explanation: PWM is used to generate variable power to control motor speed, dim LED brightness, and more.
25.
Which of the following is an advantage of using a microcontroller?
a) High cost
b) Large power consumption
c) Integration of peripherals
d) Complex programming
Answer: c) Integration of peripherals
Explanation: Microcontrollers integrate peripherals like timers, UARTs, and GPIOs, which makes them ideal for embedded systems.
26.
What is the bit size of an ARM Cortex-M3 microcontroller?
a) 8-bit
b) 16-bit
c) 32-bit
d) 64-bit
Answer: c) 32-bit
Explanation: The ARM Cortex-M3 is a 32-bit microcontroller that supports a 32-bit data bus and address bus.
27.
What is the purpose of the stack in a microcontroller?
a) Store global variables
b) Store return addresses and temporary data
c) Hold instructions
d) Store input/output data
Answer: b) Store return addresses and temporary data
Explanation: The stack is used for temporary storage, including return addresses, function parameters, and local variables during execution.
28.
Which of the following is NOT a serial communication protocol?
a) SPI
b) I2C
c) UART
d) DMA
Answer: d) DMA
Explanation: SPI, I2C, and UART are all serial communication protocols. DMA (Direct Memory Access) is used for memory operations, not
communication.
29.
What is the size of the Program Counter (PC) in an 8051 microcontroller?
a) 8-bit
b) 16-bit
c) 32-bit
d) 64-bit
Answer: b) 16-bit
Explanation: The Program Counter in the 8051 microcontroller is 16 bits, allowing it to address up to 64 KB of program memory.
30.
What is the difference between Harvard and Von Neumann architectures?
a) Harvard has separate memories for data and program, Von Neumann shares the same memory
b) Harvard shares memory, Von Neumann separates memory
c) Harvard is used in microprocessors only
d) Von Neumann is only for embedded systems
Answer: a) Harvard has separate memories for data and program, Von Neumann shares the same memory
Explanation: In Harvard architecture, data and instructions are stored in separate memory spaces, whereas Von Neumann architecture uses
a single memory.
Mixed Questions
31.
Which register in the 8051 microcontroller is used for storing the most significant bit of data?
a) DPTR
b) A (Accumulator)
c) B
d) PSW
Answer: d) PSW
Explanation: The PSW (Program Status Word) register contains flags like the carry bit, which stores the most significant bit of results.
32.
How many input/output ports are available in the 8051 microcontroller?
a) 2
b) 4
c) 6
d) 8
Answer: b) 4
Explanation: The 8051 microcontroller has 4 I/O ports (P0, P1, P2, P3), each with 8 pins.
33.
Which instruction is used to jump to a specific memory location in 8085?
a) CALL
b) JMP
c) RET
d) RST
Answer: b) JMP
Explanation: The JMP instruction in 8085 is used to transfer program execution to a specific memory address.
34.
In a microprocessor, what is the purpose of the DMA (Direct Memory Access) controller?
a) Transfer data without CPU intervention
b) Increase clock speed
c) Execute instructions faster
d) Decode instructions
Answer: a) Transfer data without CPU intervention
Explanation: DMA allows direct data transfer between memory and peripherals without using the CPU, improving system efficiency.
35.
What is the function of a cache in a microprocessor?
a) Store frequently used data and instructions
b) Act as primary memory
c) Execute arithmetic operations
d) Control input/output devices
Answer: a) Store frequently used data and instructions
Explanation: Cache memory stores frequently accessed data and instructions to reduce the latency of fetching from main memory.
36.
Which interrupt has the highest priority in an 8051 microcontroller?
a) Timer 0
b) Timer 1
c) External Interrupt 0
d) Serial Port Interrupt
Answer: c) External Interrupt 0
Explanation: In the 8051, External Interrupt 0 (INT0) has the highest priority among all interrupts.
37.
How does a microcontroller interface with an LCD? Name one common protocol.
a) UART
b) I2C
c) SPI
d) GPIO
Answer: d) GPIO
Explanation: Microcontrollers commonly interface with LCDs using GPIO pins to send data and control signals.
38.
What does the READY signal in a microprocessor indicate?
a) The microprocessor is ready for an interrupt
b) The memory or peripheral is ready for data transfer
c) The microprocessor is in halt mode
d) The program execution is complete
Answer: b) The memory or peripheral is ready for data transfer
Explanation: The READY signal ensures synchronization between the processor and slower peripherals or memory.
39.
Which of the following microcontrollers uses RISC architecture?
a) ARM
b) 8051
c) PIC16F84
d) Both a and c
Answer: d) Both a and c
Explanation: ARM and PIC microcontrollers use RISC (Reduced Instruction Set Computing) architecture for efficiency and speed.
40.
What is the function of the instruction cycle in a microprocessor?
a) Fetch, decode, and execute instructions
b) Measure clock speed
c) Store data in memory
d) Generate signals for interrupts
Answer: a) Fetch, decode, and execute instructions
Explanation: The instruction cycle is the sequence of operations (fetch, decode, execute) performed by the CPU for each instruction.
Microprocessor Fundamentals
41.
What is the purpose of the instruction pipeline in a microprocessor?
a) Increase the instruction set
b) Fetch multiple instructions simultaneously
c) Speed up instruction execution by overlapping operations
d) Store instructions temporarily
Answer: c) Speed up instruction execution by overlapping operations
Explanation: The instruction pipeline allows overlapping of instruction fetch, decode, and execute phases, improving performance.
42.
What is the primary role of a program counter in a microprocessor?
a) Execute arithmetic instructions
b) Store data
c) Point to the next instruction to be executed
d) Control I/O devices
Answer: c) Point to the next instruction to be executed
Explanation: The program counter (PC) holds the memory address of the next instruction to be fetched and executed.
43.
Which type of memory is non-volatile?
a) SRAM
b) DRAM
c) ROM
d) Cache
Answer: c) ROM
Explanation: ROM is non-volatile, meaning it retains data even when power is turned off.
44.
Which flag in a microprocessor indicates an arithmetic overflow?
a) Carry Flag
b) Zero Flag
c) Overflow Flag
d) Sign Flag
Answer: c) Overflow Flag
Explanation: The Overflow Flag (OF) is set when the result of an arithmetic operation exceeds the maximum value that can be
represented.
45.
What is the main function of the control bus?
a) Transfer data between components
b) Specify memory addresses
c) Synchronize and manage control signals
d) Provide clock signals
Answer: c) Synchronize and manage control signals
Explanation: The control bus carries control signals like read, write, and interrupt acknowledgments between the CPU and peripherals.
46.
What does the term "multi-core processor" refer to?
a) A processor with multiple instruction sets
b) A single CPU with multiple cores for parallel processing
c) A single core with increased clock speed
d) A processor with multiple buses
Answer: b) A single CPU with multiple cores for parallel processing
Explanation: Multi-core processors have multiple processing units (cores) on a single chip, enabling simultaneous execution of tasks.
47.
What does the term "fetch" refer to in a microprocessor's operation?
a) Loading data into the memory
b) Executing an instruction
c) Retrieving an instruction from memory
d) Performing arithmetic operations
Answer: c) Retrieving an instruction from memory
Explanation: The fetch phase retrieves the instruction from memory for execution.
48.
Which microprocessor was the first to be commercially available?
a) Intel 4004
b) Intel 8085
c) Zilog Z80
d) Motorola 6800
Answer: a) Intel 4004
Explanation: Intel's 4004 was the first commercially available microprocessor, released in 1971.
49.
What is the function of the address bus?
a) Specify the location of data in memory
b) Transfer data between the CPU and memory
c) Transfer control signals
d) Store temporary data
Answer: a) Specify the location of data in memory
Explanation: The address bus carries memory addresses from the CPU to locate specific data or instructions in memory.
50.
What does an interrupt signal in a microprocessor do?
a) Halts the program execution permanently
b) Allows the processor to ignore other instructions
c) Suspends the current process to handle a specific task
d) Increases clock speed
Answer: c) Suspends the current process to handle a specific task
Explanation: Interrupts temporarily halt the current program execution to perform a higher-priority task.
Microcontroller Applications
51.
What is the main purpose of using timers in microcontrollers?
a) Synchronize external devices
b) Control power supply
c) Generate precise time delays
d) Store data permanently
Answer: c) Generate precise time delays
Explanation: Timers are used to create accurate time delays, measure time intervals, or generate PWM signals.
52.
Which microcontroller is designed for low-power applications?
a) ARM Cortex-M0
b) 8051
c) 8086
d) PIC32
Answer: a) ARM Cortex-M0
Explanation: The ARM Cortex-M0 is designed for ultra-low power consumption, making it ideal for battery-operated devices.
53.
What is the resolution of an 8-bit ADC?
a) 1 part in 256
b) 1 part in 512
c) 1 part in 1024
d) 1 part in 2048
Answer: a) 1 part in 256
Explanation: The resolution of an 8-bit ADC is 28=2562^8 = 25628=256, meaning it can distinguish 256 different levels.
54.
Which instruction in the 8051 microcontroller is used to rotate bits to the left?
a) RLC
b) RRC
c) SWAP
d) MOV
Answer: a) RLC
Explanation: The RLC (Rotate Left through Carry) instruction rotates the bits of the accumulator to the left.
55.
What is the size of the data bus in an 8051 microcontroller?
a) 4 bits
b) 8 bits
c) 16 bits
d) 32 bits
Answer: b) 8 bits
Explanation: The 8051 microcontroller has an 8-bit data bus, meaning it can handle 8 bits of data at a time.
56.
What is the typical use of SPI (Serial Peripheral Interface) in microcontrollers?
a) Parallel data transfer
b) High-speed serial communication
c) Power supply control
d) Generate PWM signals
Answer: b) High-speed serial communication
Explanation: SPI is used for high-speed serial communication between microcontrollers and external devices like sensors or memory.
57.
Which microcontroller register is used to set the direction of GPIO pins?
a) Data register
b) Control register
c) Direction register
d) Timer register
Answer: c) Direction register
Explanation: The direction register sets the GPIO pin as input or output.
58.
What type of memory is used for runtime data storage in a microcontroller?
a) Flash
b) ROM
c) RAM
d) EEPROM
Answer: c) RAM
Explanation: RAM is volatile memory used for storing data and variables during program execution.
59.
What is the baud rate in UART communication?
a) The number of bytes transmitted per second
b) The number of bits transmitted per second
c) The number of parity bits transmitted
d) The number of clock cycles per second
Answer: b) The number of bits transmitted per second
Explanation: Baud rate refers to the number of bits transmitted per second in UART communication.
60.
What is the role of a crystal oscillator in a microcontroller?
a) Store data
b) Provide precise clock signals
c) Reset the microcontroller
d) Control GPIO pins
Answer: b) Provide precise clock signals
Explanation: Crystal oscillators generate accurate clock signals to synchronize the microcontroller's operations.