Microprocessors and Microcontrollers MCQ Quiz - Objective Question with Answer for Microprocessors and Microcontrollers - Download Free PDF
Last updated on May 30, 2025
Latest Microprocessors and Microcontrollers MCQ Objective Questions
Microprocessors and Microcontrollers Question 1:
The Port ______ in the 8051 microcontroller has no dual functions.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 1 Detailed Solution
Detailed Solution: Port 1 in the 8051 Microcontroller
The 8051 microcontroller, a popular choice in embedded systems, has several ports, each with its own unique functionalities. Understanding the capabilities and limitations of these ports is critical for designing efficient and reliable systems. In this detailed analysis, we will delve into the features of the ports in the 8051 microcontroller, particularly focusing on Port 1, and explain why it is the correct answer to the question regarding dual functions.
Introduction to 8051 Microcontroller Ports
The 8051 microcontroller consists of four parallel I/O ports: Port 0, Port 1, Port 2, and Port 3. Each of these ports can be used for various input and output operations, and some of them have dual functions.
- Port 0: This is a dual-purpose port. When used for external memory interfacing, it acts as a multiplexed address and data bus. In other applications, it can be used as a general-purpose I/O port.
- Port 1: This port is unique in the sense that it does not have any dual functions. It is exclusively used for general-purpose I/O operations, which makes it simple and straightforward to use.
- Port 2: Similar to Port 0, Port 2 also serves dual purposes. While it can be used for general I/O operations, it also functions as the high-order address bus in external memory interfacing.
- Port 3: This is a highly versatile port with multiple dual functions. In addition to being a general-purpose I/O port, it can handle several control signals like interrupts, serial communication signals, timer inputs, and read/write control signals for external memory.
Microprocessors and Microcontrollers Question 2:
Which port of the 8051 microcontroller functions as a bidirectional I/O and simultaneously acts as an address/data bus for external memory access?
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 2 Detailed Solution
Explanation:
8051 Microcontroller Port Functions
The 8051 microcontroller is a popular microcontroller used in embedded systems due to its versatility and wide range of applications. It consists of four parallel I/O ports (Port 0, Port 1, Port 2, and Port 3), each of which can be used for various functions. Among these ports, Port 0 has a unique characteristic that allows it to function as both a bidirectional I/O port and an address/data bus for external memory access.
Port 0: Port 0 of the 8051 microcontroller is a dual-purpose port. It can be used as a general-purpose bidirectional I/O port, and it also serves as the multiplexed address and data bus when the microcontroller accesses external memory. When used as an address/data bus, Port 0 provides the lower 8 bits of the address (A0-A7) during the first part of the machine cycle and then switches to carry the data byte (D0-D7) during the second part of the machine cycle.
Detailed Explanation:
When interfacing the 8051 microcontroller with external memory, the microcontroller needs to provide the address and data to the memory chip. The 8051 uses Port 0 to achieve this by multiplexing the lower 8 bits of the address and the data. This means that the same physical pins on the microcontroller are used to carry both address and data information at different times.
During the first half of the machine cycle, Port 0 outputs the lower 8 bits of the address (A0-A7). This is achieved by enabling the Address Latch Enable (ALE) signal, which latches the address into an external latch (e.g., 74HC573). Once the address is latched, Port 0 switches to carry the data byte (D0-D7) during the second half of the machine cycle. This multiplexing allows the 8051 to use fewer pins for addressing and data transfer, making the microcontroller more efficient in terms of pin usage.
Here is a step-by-step breakdown of how Port 0 functions during external memory access:
- Address Phase: During the first half of the machine cycle, Port 0 outputs the lower 8 bits of the address (A0-A7). The ALE signal is activated, which latches the address into an external latch. This allows the address to be held stable while Port 0 switches to data mode.
- Data Phase: During the second half of the machine cycle, Port 0 switches to carry the data byte (D0-D7). The Read (RD) or Write (WR) signal is activated, indicating whether the operation is a read or write. The external memory chip uses the latched address and the data on Port 0 to perform the required operation.
This dual functionality of Port 0 makes it essential for interfacing the 8051 with external memory, enabling efficient address and data transfer using the same set of pins.
Analysis of Other Options:
Option 1: Port 1
Port 1 of the 8051 microcontroller is a general-purpose bidirectional I/O port. It consists of 8 pins (P1.0 to P1.7) that can be used for input or output operations. However, Port 1 does not have the capability to function as an address/data bus for external memory access. It is solely used for I/O operations and does not participate in memory interfacing.
Option 2: Port 3
Port 3 is another general-purpose I/O port with additional functionality. It has 8 pins (P3.0 to P3.7), and each pin can be used for specific alternate functions such as serial communication, external interrupts, timer inputs, and control signals for external memory. However, Port 3 does not serve as an address/data bus for external memory access. Its primary role is to handle I/O operations and provide control signals for various peripherals.
Option 4: Port 4
Port 4 is not a standard port in the original 8051 microcontroller architecture. Some extended versions or derivatives of the 8051 may include additional ports, such as Port 4, but in the context of the original 8051, Port 4 does not exist. Therefore, it cannot be considered for the functionality of an address/data bus.
Based on the detailed explanation and analysis of the options, it is clear that Port 0 is the correct choice for the port that functions as a bidirectional I/O and simultaneously acts as an address/data bus for external memory access in the 8051 microcontroller.
Microprocessors and Microcontrollers Question 3:
What is the main role of Port 2 in the 8051 microcontroller during external memory access?
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 3 Detailed Solution
Explanation:
Main Role of Port 2 in the 8051 Microcontroller During External Memory Access
The 8051 microcontroller is a popular 8-bit microcontroller that was developed by Intel in 1980 for use in embedded systems. One of its key features is the ability to interface with external memory. To understand the main role of Port 2 during external memory access, it is important to have a grasp of the microcontroller's architecture and its memory interfacing capabilities.
During external memory access, the 8051 microcontroller needs to address both program (code) and data memory that are located outside the microcontroller. The addressing mechanism involves the use of a 16-bit address bus to communicate with the external memory. This 16-bit address bus is divided into two parts: the low-order address byte (A0-A7) and the high-order address byte (A8-A15). The low-order address byte is provided by Port 0, while the high-order address byte is provided by Port 2.
Port 2 is an 8-bit bi-directional I/O port, and its role during external memory access is to provide the high-order address byte (A8-A15). This allows the microcontroller to access a larger memory space by combining the high-order address byte from Port 2 and the low-order address byte from Port 0.
Let's delve deeper into the specifics of how Port 2 functions in the context of external memory access:
1. Address Latching: When accessing external memory, the 8051 microcontroller uses a multiplexed address/data bus for the lower 8 bits (Port 0). This means that the lower 8 bits of the address and the data share the same physical lines. To separate the address from the data, an external latch (often a 74LS373 or similar) is used. The Address Latch Enable (ALE) signal is generated by the microcontroller to control this latch. During the first part of the memory access cycle, the ALE signal goes high, and the low-order address byte is placed on Port 0. The latch captures this address byte when ALE is high.
2. High-Order Address Byte: While the ALE signal is high, the high-order address byte is placed on Port 2. Since Port 2 is dedicated to providing the high-order address byte, it does not need to be latched. The high-order address byte remains stable throughout the memory access cycle, ensuring that the correct memory location is accessed.
3. Memory Access: After the low-order address byte is latched and the high-order address byte is provided by Port 2, the microcontroller can complete the memory access by reading from or writing to the external memory. The data is then placed on or read from Port 0 during the appropriate phase of the memory access cycle.
4. Memory Space Expansion: By using Port 2 to provide the high-order address byte, the 8051 microcontroller can address up to 64KB of external memory (2^16 = 65536 bytes). This is essential for applications that require more memory than what is available internally on the microcontroller.
Example Scenario:
Consider a scenario where the 8051 microcontroller needs to access an external memory location with the address 0x1234. The high-order address byte is 0x12, and the low-order address byte is 0x34. During the memory access cycle, the following steps occur:
- The ALE signal goes high, and the low-order address byte (0x34) is placed on Port 0.
- The external latch captures the low-order address byte when ALE is high.
- Simultaneously, the high-order address byte (0x12) is placed on Port 2.
- The microcontroller then completes the memory access by reading from or writing to the external memory at address 0x1234.
In summary, the main role of Port 2 in the 8051 microcontroller during external memory access is to provide the high-order address byte (A8-A15). This is crucial for accessing a larger memory space and ensures that the correct memory location is accessed during read and write operations.
Microprocessors and Microcontrollers Question 4:
The 8051 microcontroller has _____ I/O pins.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 4 Detailed Solution
The 8051 microcontroller has:
-
4 parallel I/O ports: Port 0, Port 1, Port 2, and Port 3
-
Each port has 8 pins
So, total I/O pins = 4 x 8 = 32
🔍 Port Details:
Port | Function | No. of Pins |
---|---|---|
P0 | Multiplexed I/O/Address | 8 |
P1 | General Purpose I/O | 8 |
P2 | I/O/High address byte | 8 |
P3 | I/O/Special functions | 8 |
Microprocessors and Microcontrollers Question 5:
The function of pin 18 and 19 (XTAL1 and XTAL2) in 8051 Microcontroller is _______.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 5 Detailed Solution
Explanation:
The question concerns the function of pins 18 and 19, labeled XTAL1 and XTAL2, in the 8051 Microcontroller. The correct option is to identify that these pins are used for oscillator connection for clock generation.
XTAL1 and XTAL2 in 8051 Microcontroller:
The 8051 microcontroller requires a clock signal to synchronize its operations. This clock signal is generated by an external crystal or resonator connected to the XTAL1 and XTAL2 pins. The crystal oscillator typically provides a stable and precise clock signal by vibrating at a specific frequency when an electrical current is applied. This frequency is then used to drive the internal clock circuitry of the microcontroller.
The external crystal (or ceramic resonator) is connected across XTAL1 and XTAL2. The microcontroller's internal oscillator circuit uses the crystal to generate a stable clock signal. The frequency of this clock signal determines the execution speed of instructions and overall timing of the microcontroller's operations.
The typical connection involves a parallel-resonant crystal connected between XTAL1 and XTAL2, with two capacitors connected from each pin to ground. These capacitors help in stabilizing the oscillator circuit.
Top Microprocessors and Microcontrollers MCQ Objective Questions
The Size of internal RAM of 8051 Microcontroller is?
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 6 Detailed Solution
Download Solution PDFArchitecture of 8051 Microcontroller
- It is an 8-bit microcontroller.
- It is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, and 2 16-bit timers.
- It consists of four parallel 8-bit ports, which are programmable and addressable as per the requirement. An on-chip crystal oscillator is integrated into the microcontroller having a crystal frequency of 12 MHz.
- The system bus connects all the support devices to the CPU.
- The system bus consists of an 8-bit data bus, a 16-bit address bus, and bus control signals.
- All devices like program memory, ports, data memory, serial interface, interrupt control, timers, and the CPU are interfaced together through the system bus.
In 8051, Pin number 30 is used:
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 7 Detailed Solution
Download Solution PDF8051 microcontroller is a 40-Pin DIP (dual in-line package).
- PIN 30 is called ALE (address latch enable). It is used to control the demultiplexing of address and data bus.
- PIN 31 is called external Access Enable (EAE) Pin and used for external program memory access.
- PIN 29 is called program store enable (PSEN) Pin and is used to read external program memory.
- PIN 18 and 19 are used to control clock pulse generated by a quartz crystal oscillator.
Important Points:
PIN Diagram of 8051 Microcontroller.
NOTE: PORT 0 to 3, all bidirectional input / output pins.
8051 can access up to ______ of program memory and ______ of external data memory.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 8 Detailed Solution
Download Solution PDFA maximum of 64 KB of Program Memory (ROM) and Data Memory (RAM) each can be interface with the 8051 Microcontroller.
Specification of 8051:
- 4 KB bytes on-chip program memory (ROM)
- 128 bytes on-chip data memory (RAM)
- 4 register banks
- 128 user-defined software flags
- 8-bit bidirectional data bus
- 16-bit unidirectional address bus
- 32 general-purpose registers each of 8-bit
- 16-bit Timers (usually 2, but may have more or less)
- Three internal and two external Interrupts
- Four 8-bit ports,(short model have two 8-bit ports)
- 16-bit program counter and data pointer
The 8051 can handle ______ interrupt sources.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 9 Detailed Solution
Download Solution PDFExplanation:
An interrupt is an event that occurs randomly in the continuation of something depending upon call priority, you decide whether to neglect or attend it.
8051 architecture handles 5 interrupt sources, out of which two are internal (Timer interrupts), two are external and one is a serial interrupt. Each of their interrupts has its vector address.
The highest interrupt priority upon reset in 8051 is external interrupt 0.
Priority |
Interrupt source |
Interrupt Bit / flag |
1 |
External Interrupt 0 |
INT 0 |
2 |
Timer Interrupt 0 |
TF 0 |
3 |
External Interrupt 1 |
INT 1 |
4 |
Timer Interrupt 1 |
TF 1 |
5 |
Serial Interrupt |
TI / RI |
Hence option (4) is the correct answer.
As per 8051 interrupt priority, the lowest priority interrupts are not served until the microcontroller is finished with higher priority interrupts.
Which of the following are the two 16 bit SFRs of Microcontroller 8051?
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 10 Detailed Solution
Download Solution PDFMicrocontroller 8051:
- Microcontrollers are embedded inside devices to control the action and feature of a product or equipment.
- So they can also be referred to as embedded controllers. They run one specific program and are dedicated to a single task.
- They are low power devices with dedicated input devices and small LED or LCD display outputs.
- Microcontroller 8051 is designed by Intel in 1981.
- It is an 8-bit microcontroller. It is built with 40 pins DIP (Dual inline package), 4 KB of ROM storage and 128 bytes of RAM storage, two 16-bit times.
- It consists of four parallel 8-bit parts, which are programmable as well as addressable as per the requirement.
Features of 8051 Microcontroller:
- 4 KB on-chip program memory (ROM)
- 128 bytes on-chip data memory (RAM)
- Four register lanks
- 8-bit bidirectional data bus
- 16-bit unidirectional address bus
- 32 general purpose registers each of 8-bit
- 16 bit timers
Applications of microcontroller 8051:
- Automobiles
- Aeronautics
- Space
- Robotics
- Electronics
- Defence application
- Mobile communication
- Rail transport
- Industrial processing
- Medical application
SFR’s (special function registers):
- There are 21 SFR’s (special function registers) in microcontroller 8051. The SFR is the upper area of addressable memory, from address OX80 to OXff.
- These SFR’s contain all peripherally related register like P0, P1, P2, P3, timers or counters, serial part and interrupt related registers.
- DPTR – Data pointer is the 8051’s only user-accessible 16 bit (2 - byte) register. DPTR is meant for pointing to data. It is used by the 8051 to access external memory using the address indicated by DPTR. It is used to stone 2-byte value.
- 16-bit data pointer is physically the combination of DPL (Data Pointer Low) and DPH (Data Pointer High) SFRs.
- The data pointer can be used as a single bit (16-bit) register (as DPTR) or two 8-bit registers as DPL and DPH.
PSW (Program status word register)
- It is an 8-bit register.
- It is also referred to flag register.
- It contains status bits that reflect the current CPU state.
- Although PSW register is 8-bit wide, only 6-bits of it are used by the 8051 microcontroller. The two unused bit are user-definable flags.
Stock pointer (SP):
- The register used to access the stack is known as stock pointer register.
- It is 8-bits wide and can take value of 00 to FFH.
- When 8051 is initialized, the SP register contains the value of 07H which means the RAM location 08 is the first location used for the stock
- It tells the location focus where the nth value is to be removed from the stock.
- When a value is pushed onto the stack, the value of SP is incremented and then the value is stored at the resulting memory location.
- When a value is popped off the stock, the value is returned from the memory location indicated by SP, and then the value of SP is decremented.
PC (Program counter):
- It is a two byte (16-bit) address which tells the 8051 where the next instruction to execute can be found in the memory.
- PC starts at 0000H when 8051 initializes and is incremented every time after an instruction is executed.
- PC is not always incremented by 1 since same instructions may require 2 or 3 bytes, in such cases, PC will be incremented by 2 or 3.
- Branch, Jump and Interrupt operations load the PC with an address other than the next sequential location.
Note:
Registers |
Bits |
DPTR |
16 bits |
PC |
16 bits |
SP |
8 bits |
PSW |
8 bits |
Name of the register which stores the address of the next instruction to be executed in 8085 in microprocessor
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 11 Detailed Solution
Download Solution PDFProgram counter (PC):
- The program counter acts as a pointer to the next instruction to be executed and always contains the 16-bit address of the memory location of the next instruction
- It is a 16-bit register as 8085 has 16 address lines
- The program counter is updated by the processor and points to the next instruction after the processor has fetched the complete instruction.
Stack Pointer:
- Stack Pointer is also a special purpose register that is used to point the location of the top of the stack.
- Since location is specified using 16 bits, the stack pointer is a 16-bit register.
Accumulator: An accumulator is a register in which intermediate, arithmetic and logic results are stored.
8051 has _______ special function registers.
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 12 Detailed Solution
Download Solution PDFExplanation:
Microcontroller 8051:
- Microcontrollers are embedded inside devices to control the action and feature of a product or equipment.
- So they can also be referred to as embedded controllers. They run one specific program and are dedicated to a single task.
- They are low power devices with dedicated input devices and small LED or LCD display outputs.
- Microcontroller 8051 is designed by Intel in 1981.
- It is an 8-bit microcontroller. It is built with 40 pins DIP (Dual inline package), 4 KB of ROM storage and 128 bytes of RAM storage, two 16-bit times.
- It consists of four parallel 8-bit parts, which are programmable as well as addressable as per the requirement.
FR’s (special function registers):
- There are 21 SFR’s (special function registers) in microcontroller 8051. The SFR is the upper area of addressable memory, from address OX80 to OXff.
- These SFR’s contain all peripherally related register like P0, P1, P2, P3, timers or counters, serial part and interrupt related registers. Hence option (1) is the correct answer.
How many 16 bit registers are there in 8051?
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 13 Detailed Solution
Download Solution PDF- 8051 microcontroller consists of four register banks, such as Bank 0, Bank 1, Bank 2, Bank 3 which are selected by the PSW (Program Status Word) register.
- 8051 has 32 general-purpose registers and the size of each register is 8-bit.
- It has two 16-bit registers and they are the data pointer (DTPR) and the program counter (PC).
- Internal RAM (data memory) - 128 bytes
- Internal memory (code memory) - 4 kB
- Timer/counter - 2
- No. of interrupt - 5
- I/O pins - 32
- Serial port - 1
The Block Diagram of an 8051 microcontroller is as shown:
In an 8051 microcontroller:
The function of ALE signal in 8051 microcontroller is
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 14 Detailed Solution
Download Solution PDFALE:
The Pin 30 of 8051 microcontroller is used for ALE that is Address Latch Enable.
- It is an active-high input control signal.
- ALE signal is used for demultiplexing the multiplexed Address/Data bus of Port 0 during external memory interfacing.
- In each machine cycle, there are 2 ALE pulses
- ALE is also used to check whether the device is working or not.
Which of the following is a Non-volatile Memory
Answer (Detailed Solution Below)
Microprocessors and Microcontrollers Question 15 Detailed Solution
Download Solution PDFNon-volatile memory is the type of computer memory that can hold the saved data even if the power is off.
Few examples of non-volatile memory are EEPROM (Electrically Erasable Programmable Read-Only Memory), ROM, hard disk, floppy disk, etc.
Of the given option only EEPROM is a non-volatile memory the rest are volatile memories.
- SRAM (static RAM) is random access memory (RAM) that retains data bits in its memory as long as power is being supplied.
- Inside a dynamic RAM chip, each memory cell holds one bit of information and is made up of two parts: a transistor and a capacitor.
- As DRAM has a capacitor, it continuously leaks current. Therefore it requires frequent refresh which consumes power.
- The volatile memories are those which hold data only for a shorter period of time.
- Cache and main memory hold it till the power is on and do not retain it afterward. So those are volatile memories.