Microprocessor and Interfacing
Syllabus
UNIT – II
ASSEMBLY LANGUAGE PROGRAMMING OF 8086: 1. Instruction formats, addressing modes, instruction set, assembler directives, macros, 2. Simple programs involving logical, branch and call instructions, 3. Sorting, 4. evaluating arithmetic expressions, string manipulations.
PERIPHERAL INTERFACING WITH 8086 MICROPROCESSOR: 1. 8255 PPI, 2. Keyboard, display controllers, Stepper motor, A/D & D/A Converter Interfacing with 8086 microprocessor. 3. Static and Dynamic memories, 4. Vector interrupt table, 5. Interrupt service routine, 6. Introduction to DOS & BIOS interrupts, 7. Programmable Interrupt Controller 8259, 8. DMA controller 8257, 9. Interfacing with 8086 microprocessor.
What is a Microprocessor ?
8-bit Processor – 8085 , Z80 , 6800
16-bit Processor – 8086 , 68000 , Z8000
32-bit Processor – 80386 , 80486
8086 Microprocessor
The 8086 microprocessor is divided into two main units:
Bus Interface Unit (BIU):
- Handles communication with memory and I/O devices.
- Performs operations like fetching instructions, reading/writing data, and calculating physical addresses.
- Contains the Instruction Queue, Segment Registers, and Address Generation Logic.
Execution Unit (EU):
- Executes instructions fetched by the BIU.
- Contains the Arithmetic and Logic Unit (ALU), General Purpose Registers, and Control Flags.
The 8086 microprocessor, introduced by Intel in 1978, is a 16-bit processor with a robust architecture that laid the foundation for modern microprocessor designs. Its architecture is capable of multitasking, memory management, and efficient peripheral interfacing. The processor operates with a 16-bit data bus and a 20-bit address bus, allowing it to address up to 1 MB of memory. The internal architecture is divided into two primary units: the Bus Interface Unit (BIU) and the Execution Unit (EU).
Functional Diagram
The functional diagram of the 8086 microprocessor illustrates its key components and their interactions. The BIU is responsible for generating physical addresses, fetching instructions, and interfacing with the external memory and I/O devices. It includes the segment registers, instruction pointer (IP), and an address generation mechanism. On the other hand, the EU decodes and executes instructions fetched by the BIU. It includes the general-purpose registers, arithmetic logic unit (ALU), flag register, and control circuitry.
Bus Interface Unit (BIU): This unit handles the processor's communication with memory and peripherals. It manages instruction fetching, operand fetching, and address calculation. The BIU also supports instruction queuing for efficient execution.
Execution Unit (EU): The EU takes instructions from the instruction queue, decodes them, and executes them. It performs arithmetic, logic, and control operations using the ALU and control circuitry.
Register Organization
The 8086 microprocessor has 14 registers, each 16 bits wide. These are categorized as follows:
General-Purpose Registers: AX, BX, CX, and DX. Each register can be divided into two 8-bit registers (e.g., AH and AL for AX). These are used for arithmetic operations, data storage, and data transfer.
Segment Registers: The CS (Code Segment), DS (Data Segment), SS (Stack Segment), and ES (Extra Segment) registers define the memory segments used for code, data, stack, and additional data storage, respectively.
Pointer and Index Registers: The SP (Stack Pointer), BP (Base Pointer), SI (Source Index), and DI (Destination Index) are used for addressing memory and stack operations.
Instruction Pointer (IP): This register holds the address of the next instruction to be executed.
Flag Register: It indicates the state of the processor and results of operations, with flags such as Zero Flag, Carry Flag, Sign Flag, and Overflow Flag.
Memory Segmentation
The memory segmentation feature of the 8086 allows its 1 MB addressable memory to be divided into segments of 64 KB each. This segmentation facilitates modular programming, simplifies memory management, and allows efficient data access. Four segments are defined:
Code Segment (CS): Stores executable instructions.
Data Segment (DS): Contains program data.
Stack Segment (SS): Used for stack operations like push and pop.
Extra Segment (ES): Provides additional storage for data.
Memory Addresses
Physical memory addresses are calculated by combining a segment base address with an offset.
This addressing mechanism enables access to a large memory space using a 16-bit segment and a 16-bit offset.
Physical Memory Organization
The 8086 organizes memory into overlapping segments, allowing efficient program execution and data handling. Each segment can store up to 64 KB of data or code. The overlapping nature of segments ensures that memory is utilized optimally.
Signal Descriptions of 8086
The 8086 microprocessor has various signals categorized into common function signals, minimum mode signals, and maximum mode signals. These signals control the processor’s operations and interactions with external devices.
Common Function Signals: These include:
AD0-AD15: Multiplexed address and data bus.
- A16-A19/S3-S6: Address/status lines.
- RD: Read control signal.
- WR: Write control signal.
- ALE: Address Latch Enable.
- INTR/INTA: Interrupt request and acknowledge signals.
- Minimum and Maximum Mode Signals
The 8086 can operate in two modes:
Minimum Mode: Used in single-processor systems. Signals include HOLD, HLDA, and RDY for bus control.
Maximum Mode: Used in multiprocessor systems. Signals include S2, S1, S0 (status lines), LOCK (bus lock signal), and RQ/GT1, RQ/GT0 (bus request/grant).
Read and Write Cycles
The read and write cycles describe the sequence of operations the processor performs to read from or write to memory and I/O devices. Each cycle involves address generation, data transfer, and signal activation. Key steps in a read cycle include:
Address placement on the bus.
Activation of the RD signal.
Data transfer from memory to the processor.
In a write cycle, data flows from the processor to memory or an I/O device, accompanied by the WR signal.
Timing Diagrams
Timing diagrams represent the chronological order of signal changes during read/write cycles. They provide a visual depiction of the relationship between address, data, and control signals. For example, the diagram for a read cycle shows:
Address and data buses transitioning to valid states.
Activation and deactivation of ALE, RD, and other control signals.
Timing of data availability on the data bus.
Interrupt Structure
The interrupt system of the 8086 enhances its ability to handle asynchronous events. It supports 256 software and hardware interrupts, which are managed through an Interrupt Vector Table (IVT). Key features include:
Interrupt Types: Hardware interrupts (e.g., INTR, NMI) and software interrupts (e.g., INT instructions).
Priority Levels: Non-maskable interrupts (NMI) have the highest priority.
Interrupt Service Routine (ISR): A special routine executed when an interrupt occurs.
The interrupt structure ensures that the processor can respond to critical events promptly while maintaining efficient execution of the main program.
Comments
Post a Comment