Untitled Document
Untitled Document
A microprocessor is a central processing unit (CPU) that integrates all the functions of a
computer's core processing unit on a single integrated circuit (IC). It performs arithmetic, logic,
control, and input/output operations based on instructions received from programs.
Microprocessor:
It does not include memory or peripheral devices on the chip, so external components like RAM,
ROM, and I/O devices are required for operation.
Used in applications where high-speed processing and flexibility are needed, such as
computers, laptops, etc.
Microcontroller:
It contains a CPU, memory (RAM, ROM), and peripherals (timers, ADC, I/O ports) all on a single
chip.
Typically used in applications like embedded systems, robotics, appliances, etc., where specific,
task-oriented control is required.
The Von Neumann architecture is a computer architecture model that describes a system where
the CPU, memory, and input/output devices are connected through a single data bus. The key
characteristics are:
A single shared memory space for both data and program instructions.
The program and data are stored in the same memory, which can lead to a bottleneck because
the CPU has to share the same bus for both instruction fetching and data processing.
8086:
Used in more powerful systems, offering better performance for complex tasks.
8088:
Used in lower-cost systems due to its smaller data bus, though it had less performance than the
8086.
The main difference is in the width of the data bus: the 8086 has a 16-bit data bus, while the
8088 has an 8-bit data bus, which affects data transfer speed.
2. Explain the demultiplexing the address/data multiplexed bus with the help of proper
diagrams. Why the lower byte address bus (A0-A7) and data bus (D0-D7) are
multiplexed?
In microprocessors like the 8086, the address and data lines are multiplexed to reduce the
number of physical connections, which is necessary for systems with limited pins. The lower
byte address bus (A0-A7) and the data bus (D0-D7) are shared and transmitted sequentially.
Why Multiplexing Happens:
Pin Limitation: Fewer pins reduce the size and cost of the chip and the system.
Demultiplexing Process:
To separate address and data after they share the same lines, an Address Latch Enable (ALE)
signal is used:
1. ALE (Active): The microprocessor places the address on the lower byte address lines (A0-A7)
in the first clock cycle, and the ALE signal latches it.
2. ALE (Inactive): In the next cycle, the data is sent on the same lines (D0-D7), now that the
address has been latched and stored.
Diagram Overview:
This allows the microprocessor to efficiently use the same bus for both address and data while
keeping them logically separate with the help of the ALE signal.
3. Direct: Operand is located at a specified memory address (e.g., MOV AX, [1234H]).
4. Indirect: Operand's memory address is specified by a register (e.g., MOV AX, [BX]).
6. Based: Operand's address is calculated by adding a base register and displacement (e.g.,
MOV AX, [BX+1000H]).
7. Based Indexed: Operand's address is calculated by adding base and index registers with a
displacement (e.g., MOV AX, [BX+SI+1000H]).
Key Differences:
8085 has 5 addressing modes, while 8086 supports 6 primary modes with advanced modes like
Indexed and Based Indexed.
8086 allows more flexible and complex memory addressing with segment-based and indexed
modes.
4.Draw and explain the software and hardware model of 8085 microprocessor.
5.Draw and explain the flag structure of 8085 and 8086 microprocessor.
6.Write a program to generate a 1msec, 100 µsec and 10 msec time delay considers the
operating frequency of 8085 is 2MHz and 3MHz. (From notebook)
7.Differentiate between memory mapped I/O and peripheral mapped I/O or I/O mapped
I/O. Design a sevensegment common cathode LED output port with the device address
FFH and 8bit input port containing 8 number of switches with the device address FAH.
Write program to access the switches and display its value to LED.
1. Addressing:
Memory Mapped I/O: I/O devices use the same address space as memory.
Peripheral Mapped I/O: I/O devices use a separate address space from memory.
2. Address Range:
Memory Mapped I/O: Shares address space with memory (16-bit or 32-bit).
Peripheral Mapped I/O: Uses a separate I/O address space, typically 8-bit.
3. Instruction Set:
Memory Mapped I/O: Accessed using regular instructions like MOV, ADD.
Peripheral Mapped I/O: Accessed using special I/O instructions like IN, OUT.
4. Control Signals:
Memory Mapped I/O: No special control signals for I/O; same as memory.
Peripheral Mapped I/O: Special control signals like IO/M are used.
5. System Complexity:
Memory Mapped I/O: Simplifies the system as the same instructions handle both memory and
I/O.
Peripheral Mapped I/O: Requires special instructions and separate control signals for I/O.
6. Speed:
Memory Mapped I/O: Faster access to I/O as it uses the memory bus.
Peripheral Mapped I/O: Slower access due to the use of separate I/O instructions.
7. Hardware Implementation:
Peripheral Mapped I/O: Requires more control lines for distinguishing between I/O and memory.
8.Explain the instruction of 8085 that uses auxiliary carry flag. Explain the function of
memory point registrar SP and PC. Explain the control and status signal of 8085
microprocessor.
The Auxiliary Carry Flag (AC) in the 8085 microprocessor is used primarily for BCD
(Binary-Coded Decimal) arithmetic operations. It is set or cleared when a carry occurs between
the lower nibble (4 bits) of an operand during an arithmetic operation, which is essential for BCD
corrections.
1. ADD: When adding two numbers, if the carry occurs from bit 3 to bit 4, the AC flag is set.
2. ADC (Add with Carry): Similar to ADD, but the AC flag is set if the carry occurs between the
lower nibble.
3. SUB: The AC flag is set when borrowing occurs from bit 4 during subtraction.
4. SBB (Subtract with Borrow): The AC flag is set when borrowing occurs between the lower
nibbles during the subtraction.
5. INR (Increment Register) and DCR (Decrement Register): These instructions set or clear the
AC flag when the result causes a carry or borrow between the nibbles.
These instructions make use of the Auxiliary Carry flag when performing arithmetic operations,
especially when correcting BCD results.
The Program Counter (PC) holds the address of the next instruction to be fetched for execution.
Function: It is automatically incremented after each instruction fetch, so it always points to the
memory location of the next instruction. It is used to track the flow of execution in the program.
Example: When an instruction is fetched, the value in the PC is used to locate the instruction in
memory. After fetching, the PC is incremented to point to the next instruction.
The Stack Pointer (SP) is a 16-bit register that holds the address of the last location used in the
stack.
Function: The SP is used to manage the stack, which is a region of memory used for temporary
storage during subroutine calls, interrupts, and context saving/restoring. It is automatically
adjusted when data is pushed to or popped from the stack.
Example: When a subroutine call is made using CALL instruction, the address of the next
instruction is pushed onto the stack. The SP is then decremented to point to the new location.
When returning from the subroutine, the RET instruction pops the return address from the stack
and the SP is incremented accordingly.
Control Signals:
RD (Read): This signal indicates that the microprocessor is performing a memory or I/O read
operation. It is active (low) when the microprocessor is reading data from memory or an I/O port.
WR (Write): This signal indicates that the microprocessor is performing a memory or I/O write
operation. It is active (low) when the microprocessor is writing data to memory or an I/O port.
ALE (Address Latch Enable): This signal is used to latch the address in a demultiplexed
address/data bus.
IO/M: This signal determines whether the operation is related to memory or I/O. It is used to
differentiate between memory-mapped I/O and peripheral-mapped I/O.
S1, S0: These are status signals used to indicate the type of operation currently being
performed, like fetch, memory read, or I/O read.
Status Signals:
BUSY: This signal indicates that the 8085 microprocessor is busy processing a request, such as
an interrupt.
INTA (Interrupt Acknowledge): This signal is used to acknowledge the interrupt request,
confirming that the microprocessor has received an interrupt.
SYNC: This signal is used to synchronize the timing of the microprocessor's operations with
external devices.
These signals provide the microprocessor the ability to manage and control the operations of
the external peripherals and memory, ensuring the correct sequence of operations for the
program being executed.
9. Draw the timing diagram for the instruction MVI A, 09, MOVA,M, INR M, ADD B, SUB B
LHLD, IN, OUT, ORA M stored in memory location 9000 (notebook)
10.Explain the function of HOLD, HLDA, READY, RESET, S0, S1, ALE, CLK IN, CLK OUT.
1. HOLD: Requests control of the system bus from the microprocessor.
3. READY: Synchronizes the microprocessor with slower external devices, ensuring they are
ready for data transfer.
4. RESET: Initializes the microprocessor, setting registers to predefined values and restarting
program execution.
5. S0 and S1: Indicate the current operation of the microprocessor (e.g., fetch, memory
read/write).
7. CLK IN: Provides the clock input to drive the microprocessor’s operation.
11.Explain the function of ADD, SBI, LHLD, XCHG, CMP, LDAX, CALL, RST 0, LDA, INXH,
INR M, IN , OUT, DAA, STAX, XRAM instruction.
2. SBI: Subtracts an immediate value and the carry/borrow from the accumulator.
3. LHLD: Loads a 16-bit value from a memory address into registers H and L.
5. CMP: Compares the accumulator with a specified register or memory location (sets flags).
6. LDAX: Loads the accumulator with the 16-bit value from the memory location pointed by BC
or DE.
12. IN: Reads an 8-bit value from an input port into the accumulator.
15. STAX: Stores the contents of the accumulator to the memory location pointed by BC or DE.
12.What is interrupt? What are the interrupt pins of 8085 microprocessor? What is meant
by priority interrupts? Explain different types of interrupts. Write a program to enable all
interrupt except RST 5,5. Write a program to enable RST 7.5, RST 6.5 and disable RST 5.5.
Write a program to clear /set all flag of 8085 microprocessor.How does an 8085
microprocessor respond to INTR interrupt signal?
An interrupt is a mechanism that allows external devices or internal events to temporarily halt
the normal execution of the program and transfer control to a special function or subroutine
(interrupt service routine, ISR). Once the interrupt is serviced, the microprocessor returns to the
main program.
2. INTA (Interrupt Acknowledge): Acknowledges the interrupt request from external devices.
6. TRAP: A non-maskable interrupt with the highest priority, with a fixed address of 0024.
3. Priority Interrupts:
Priority interrupts refer to the order in which the microprocessor handles multiple interrupt
requests. The 8085 microprocessor processes interrupts in a predefined priority order, with
higher-priority interrupts being serviced first.
4. Types of Interrupts:
1. Maskable Interrupts: These can be disabled or masked using software or hardware. They
include:
RST 7.5
RST 6.5
RST 5.5
INTR
2. Non-Maskable Interrupts: These cannot be masked or disabled. The highest priority interrupt
is:
TRAP
MVI A, 0F7H ; Load A with 0F7H to enable interrupts except RST 5.5
SIM ; Set Interrupt Mask Register
MVI A, 0C7H ; Load A with C7H to enable RST 7.5, RST 6.5, and disable RST 5.5
SIM ; Set Interrupt Mask Register
Alternatively, you can use a combination of CMC (Complement Carry) and other instructions to
clear or set flags manually.
---
The INTR (Interrupt Request) pin is a maskable interrupt. When the 8085 microprocessor
receives an INTR signal, it checks if interrupts are enabled and whether the interrupt is
unmasked.
If the interrupt is enabled and unmasked, the 8085 performs the following:
2. It saves the Program Counter (PC) and relevant flags onto the stack.
3. The control is transferred to the interrupt service routine (ISR) for INTR, starting from the
address 0024H.
4. After servicing the interrupt, the microprocessor returns to the program execution from the
point where it was interrupted.
13.Interface the 2KB EPROM, 2 KB RAM and 1KB EPROM memory devices in 8085
microprocessorin absolute decoding method.
Interfacing 2KB EPROM, 2KB RAM, and 1KB EPROM with 8085 (Absolute Decoding)
1. Memory Mapping
2. Address Decoding
3. Control Signals
Chip Enable (CE) for each device is controlled by the decoded address using AND gates.
MEMR and MEMW control read/write operations.
4. Connections
This setup uses absolute decoding with address lines A11-A15 to uniquely select each memory
device.
14.What is stack and subroutine? CALL and RET are the only instructions of 8085 that
uses subroutine. Comment on this statement. PUSH and POP are the only instructions of
8085 that uses Stack. Comment on this statement. Write a program to exchange the
contents of DE register pair with the HL register pair using OUSH and POP instruction..
Stack: A stack is a special area in memory that follows the Last In, First Out (LIFO) principle. It
is used for storing temporary data, such as return addresses and local variables during function
calls and interrupts.
Subroutine: A subroutine is a set of instructions that performs a specific task and can be called
from various parts of a program. It is a form of modular programming that allows code reuse and
better organization.
2. CALL and RET are the only instructions of 8085 that use subroutines. Comment on this
statement.
CALL: This instruction is used to call a subroutine. It saves the return address (address of the
instruction after CALL) onto the stack and transfers control to the subroutine.
RET: This instruction is used to return from a subroutine. It retrieves the return address from the
stack and continues execution from that point.
Although CALL and RET are primarily associated with subroutine calls, they are not the only
instructions related to subroutines. Other instructions like JMP (unconditional jump) can also be
used to transfer control to a subroutine, but CALL and RET are specifically designed for calling
and returning from subroutines.
3. PUSH and POP are the only instructions of 8085 that use Stack. Comment on this statement.
PUSH: The PUSH instruction is used to store the contents of a register pair (like BC, DE, HL)
onto the stack. It decrements the stack pointer (SP) and stores the data in memory.
POP: The POP instruction is used to retrieve data from the stack. It increments the stack pointer
(SP) and loads the data into the specified register pair.
While PUSH and POP are the primary instructions used to interact with the stack in 8085, the
stack is also affected by CALL (which pushes the return address onto the stack) and RET
(which pops the return address from the stack). Thus, CALL and RET also indirectly use the
stack.
4. Program to Exchange the Contents of DE Register Pair with the HL Register Pair Using
PUSH and POP Instructions:
15.Explain the process of segmentation of memory in 8086 microprocessor. What are its
advantages? Explain how to calculate 20 bit physical address. How pipelining achieved
in 8086 microprocessor.
In 8086, memory is divided into logical segments: Code Segment (CS), Data Segment (DS),
Stack Segment (SS), and Extra Segment (ES). Each segment can hold a maximum of 64KB,
and the processor uses a 16-bit segment base address and a 16-bit offset address to access
memory.
2. Advantages of Segmentation
Improved Organization: Segments code, data, and stack separately for better program
structure.
Example:
Pipelining in 8086 involves overlapping instruction fetch, decode, and execution phases to
improve throughput. The 8086 uses a 6-stage pipeline:
16.Draw the architecture of 8086 microprocessor and discuss in brief the BIU and EU of
8086 microprocessor. What is data and address size in 8086? How its physical address is
calculated? Explain the function of Queue register, AX, BX, CX and DX register. Write
down the differences between 8086 microprocessor and 80286 microprocessor.
The BIU is responsible for the communication with memory and I/O devices.
It fetches instructions from memory, manages the instruction queue, and passes the instructions
to the EU for execution.
The BIU includes the Segment Registers, Instruction Queue, and Address Generation Unit
(AGU).
2. Execution Unit (EU):
It includes the ALU (Arithmetic and Logic Unit), general-purpose registers, and control logic.
The EU performs computations, manipulations of data, and handles control instructions (like
jump, call, etc.).
Data Size: 16-bit (It can handle 16-bit data at a time in a single operation).
Address Size: 20-bit (This gives the microprocessor the ability to address 1MB of memory).
The physical address in 8086 is calculated by combining the 16-bit segment address and the
16-bit offset address. The formula for physical address calculation is:
For example, if the segment address is 0x1000 and the offset address is 0x2000, the physical
address is:
Queue Register:
The queue register in the 8086 stores up to 6 bytes of pre-fetched instructions. It allows the
processor to fetch the next instruction while executing the current one, improving performance
(pipelining).
AX Register (Accumulator):
The AX register is a 16-bit register used for arithmetic, logic, and data transfer operations. It is
also used in many instructions as the default register for I/O operations.
BX Register (Base):
The BX register is typically used as a pointer or index to data. It can hold a 16-bit base address
used for accessing memory.
CX Register (Count):
The CX register is primarily used for loop counting and controlling the number of iterations in a
loop. It is used in the rep prefix for repeated string operations.
DX Register (Data):
The DX register is used in I/O operations, especially for port-mapped I/O. It is also used in the
mul and div instructions for 32-bit multiplication and division.
1. Address Bus:
2. Data Bus:
8086: 16-bit
80286: 16-bit
3. Operating Mode:
5. Clock Speed:
6. Multiprogramming:
7. Instructions:
8086: Simple instruction set with basic I/O, arithmetic, and control instructions
8. Compatibility:
17.(ignored)
18.Draw and explain the 8254/8253 block diagram and its different modes of operation.
8254/8253 Programmable Interval Timer (PIT) Block Diagram and Modes of Operation
The 8254/8253 is a programmable timer used to generate precise time delays, frequency
generation, and event counting. It consists of the following blocks:
This register controls the mode of operation and sets the parameters for the timer channels.
Counter 0, 1, and 2: These are the three independent timer/counter channels in the 8254. Each
channel consists of a 16-bit binary counter.
Each counter has a data latch to hold the value of the counter.
The clock input provides the time base for the counters.
The gate input is used to enable or disable the counting operation. It allows the user to stop or
start counting based on an external signal.
4. Output Pins:
The output pin (OUT) generates an output pulse when the counter reaches zero.
5. Read/Write Buffers:
These are used to read the data from the counter or to load data into the counter.
This register stores the status of the output and the operation of the timer.
Modes of Operation:
The 8254/8253 timer operates in several modes. Each mode is configured via the Control
Register.
The timer counts down from the initial value until it reaches zero, at which point an interrupt is
generated, and the counter is reloaded with the initial value.
The timer counts down from the initial value and generates a pulse at the output when it
reaches zero.
After the pulse, the counter is reloaded, and the process repeats.
The timer counts down from the initial value and generates periodic output pulses at a specific
frequency. The counter is reloaded with the initial value after each cycle.
Suitable for generating a clock signal or periodic interrupts.
The timer generates a square wave signal at the output with the frequency determined by the
initial value.
A pulse is generated after a software trigger, and the counter is then reloaded with the initial
value.
Similar to Mode 4, but a hardware trigger (external signal) causes the strobe to occur.
Conclusion:
The 8254/8253 is a versatile timer used in various applications such as generating precise time
delays, frequency generation, event counting, and pulse-width modulation. It can be configured
to operate in different modes based on the specific application needs, making it widely used in
microprocessor-based systems.
19.(ignored)
20.Six 8-bit data is stored from memory location C070H. Transfer the entire block of data
to new memory locations starting from C050H.
21.Write a program to subtract a BCD number stored in memory location 9000H from
another BCD number stored in 9100H. Store the difference in 8500H and the borrow in
8501H.
22.Write a single instruction to clear the lower four bits of the accumulator in 8085
microprocessor.
23.Draw and Explain the function of pin diagram of 8051 microcontroller.
The 8051 microcontroller has 40 pins, divided into specific functional categories:
Key Pins:
1. Ports (P0-P3):
P0 (Pins 32-39): 8-bit bidirectional I/O port (also used as AD0-AD7 for address/data multiplexing
in external memory).
P2 (Pins 21-28): 8-bit I/O port (also used as higher address bits A8-A15 for external memory).
P3 (Pins 10-17): Special-purpose I/O port with additional functions (e.g., serial communication,
interrupts).
2. Power Supply:
3. Oscillator:
XTAL1, XTAL2 (Pins 18, 19): Connect external crystal oscillator for clock generation.
4. Reset:
5. Control Pins:
6. Serial Communication:
TXD, RXD (Pins 11, 10): Transmit and receive data lines for UART.
Function:
24.Draw the block diagram of 8051 microcontoller. Explain the Program Status Word of
8051 microcontroller.
The Program Status Word (PSW) in the 8051 microcontroller is an 8-bit register that reflects the
current status of the processor. Its bits are:
1. CY (Carry, Bit 7): Set if there's a carry out from the most significant bit during addition or a
borrow during subtraction.
2. AC (Auxiliary Carry, Bit 6): Set if there's a carry from the lower nibble (4 bits) during arithmetic
operations.
4. RS1, RS0 (Bits 4 and 3): Register Bank Select bits to choose one of the four register banks.
5. OV (Overflow, Bit 2): Set if the result of a signed arithmetic operation exceeds the value that
can be represented.
7. P (Parity, Bit 0): Set if the number of 1s in the accumulator is odd (odd parity).
The PSW plays a critical role in controlling program flow and managing arithmetic operations.
25.Write down the differences between 8086 and 80286 microprocessor. Draw the
architecture of ARM Processor and explain why it is a RISC Processor.
Here are the key differences between the 8086 and 80286 microprocessors:
1. Introduction:
3. Addressing Capability:
4. Operating Modes:
5. Instruction Set:
80286: Includes additional instructions for better performance in multitasking and system
control.
6. Memory Management:
7. Protection:
9. Performance:
10. Applications:
A processor is a RISC (Reduced Instruction Set Computer) if it uses a small, simple set of
instructions, each of which typically executes in one clock cycle. It focuses on speed, efficiency,
and easy pipelining, using a load/store architecture to move data between registers and
memory.