8085 Microprocessor Architecture and Interrupt System
Basic Microcomputer Architecture and Microprocessor Fundamentals
Microprocessor Definition:
A microprocessor is the central controlling unit of a microcomputer, fabricated on a single small integrated circuit (IC) chip.
It is capable of performing Arithmetic Logic Unit (ALU) operations and communicating with other devices connected to it.
It consists of three primary components:
Arithmetic Logic Unit (ALU): Performs all arithmetic and logical operations on data received from memory or input devices.
Register Array: A set of internal storage registers identified by letters such as , , , , , , and the Accumulator ().
Control Unit: Controls and coordinates the flow of data and instruction execution within the computer system.
Operational Sequence of a Microprocessor:
Instructions are stored sequentially in system memory.
The microprocessor operates by continuously repeating a three-step cycle:
Fetch: Retrieves the instruction code from the memory location.
Decode: Interprets the fetched binary instruction to determine the required operation.
Execute: Carries out the specified operation using internal registers and the ALU until a instruction is encountered.
Data processing workflow:
Registers store temporary data during processing.
The ALU performs computation functions.
Final computational results are transmitted in binary format to the output ports.
8085 System Bus Organization
Bus Definition:
A bus is a collection of physical communication lines (wires) used to transmit information bits between various components organized within a microprocessor system.
Types of System Buses:
Address Bus:
A collection of wires used to identify specific physical locations in main memory or peripheral devices.
Consists of individual lines designated as to .
Directionality: Strictly unidirectional, flowing exclusively from the microprocessor out to input/output (I/O) devices and memory.
Addressing Capability: A -bit address bus allows the system to address up to memory locations ().
Data Bus:
A collection of wires through which data is transmitted between different functional blocks of the computer system.
Consists of individual lines designated as to .
Directionality: Fully bidirectional, allowing two-way data transfer between the microprocessor, main memory, and peripheral devices.
Transfers -bit binary information in parallel.
Control Bus:
A group of dedicated lines carrying timing, control, and synchronization signals generated by the CPU to manage peripheral devices.
Primary control signal pins on the 8085 microprocessor:
Input Output/Memory ( )
Read control ( )
Write control ( )
Combining these three control signals allows the generation of four distinct system control signals:
Memory Read ( )
Memory Write ( )
Input Read ( )
Output Write ( )
Demultiplexing of the Address/Data Bus
Multiplexed Address/Data Bus ():
To reduce the total pin count on the physical IC package, the lower-order address bus () and the 8-bit data bus () are combined into dual-purpose multiplexed lines designated as to .
During the first clock period (T-state) of a machine cycle, these lines carry the lower-order 8-bit address ().
During subsequent clock periods of the machine cycle, these lines function as the bidirectional data bus ().
Demultiplexing Hardware and Circuitry:
To separate the lower-order address from data bits and prevent signal corruption, external demultiplexing hardware is required.
An external octal latch IC, specifically the 74LS373 Latch, is used to capture and hold the address.
Connection Setup:
The multiplexed bus lines connect directly to the data inputs of the 74LS373 latch.
The Address Latch Enable () output signal from the 8085 is connected to the Enable pin () of the 74LS373 latch.
The Output Control () pin of the latch is permanently connected to ground ().
Demultiplexing Operational Logic:
When is High (Logic 1): The latch becomes transparent. The lower-order address bits () pass through the latch and are stored/latched on its output pins.
When goes Low (Logic 0): The latch freezes its output, preserving the lower-order address bits () for the remainder of the cycle while freeing the lines to operate as the bidirectional data bus ().
Generation of Control Signals
Primary Control Signals Pin Functions:
:
A status signal identifying whether the current memory cycle is addressed to I/O devices or memory.
Logic 1 (High): Address on the bus refers to an Input/Output device.
Logic 0 (Low): Address on the bus refers to Main Memory.
:
Active-low signal controlling READ operations.
When logic 0, the selected memory location or I/O device is read by the MPU.
:
Active-low signal controlling WRITE operations.
When logic 0, data currently on the data bus is written into the selected memory or I/O location.
Decoder Hardware Setup (IC 74138):
A 3-to-8 line decoder (IC 74138) processes control signal logic.
Inputs to the decoder: , , and .
Outputs from the decoder produce distinct active-low control commands:
: Memory Read operation.
: Memory Write operation.
: Input Read operation.
: Output Write operation.
Control Pin Decoding Logic Table:
Data Bus Status / Operation Generated | |||
|---|---|---|---|
Halt | |||
Memory Read () | |||
Memory Write () | |||
Opcode Fetch | |||
No Operation | |||
I/O Read () | |||
I/O Write () | |||
Interrupt Acknowledge |
Internal Architecture of 8085 Microprocessor
General Specifications:
Built using N-channel Metal-Oxide-Semiconductor (NMOS) technology.
Data Bus Width: bits (processes bits of data in parallel).
Address Bus Width: bits (can address bytes or of memory space).
ALU Capacity: -bit execution unit.
Operating Parameters: Requires a single DC power supply () and operates with a standard clock cycle duration of .
Functional Internal Blocks:
Bus Architecture:
Address Bus: bits total, unidirectional.
Higher-Order Address Bus: Pins (unidirectional).
Lower-Order Address/Data Bus: Pins (multiplexed, bidirectional for data).
Arithmetic and Logic Unit (ALU):
Performs arithmetic operations: Addition, Subtraction, Increment, Decrement.
Performs logical operations: AND, OR, XOR, Complement, Compare, Rotate.
Timing and Control Unit:
Controls timing of all internal and external operations.
: Crystal input connections for internal clock generator.
: Output clock signal for external system synchronization.
: Address Latch Enable signal for demultiplexing .
: Active-low read and write control lines.
: Selects I/O or memory operations.
: Machine cycle status signals.
: Bus request and acknowledge signals for Direct Memory Access (DMA).
: Bus wait-state control pin for synchronizing slow memory or peripheral devices.
Serial Input/Output Control:
Manages single-bit serial data transmission via two dedicated pins:
: Serial Input Data line.
: Serial Output Data line.
Interrupt Control Block:
Manages hardware interrupt requests (, , , , ) and acknowledgement ().
Instruction Register and Decoder:
Holds the current instruction opcode fetched from memory and decodes it to execute required control operations.
8085 Register Organization
Classification of Internal Registers:
8-Bit Registers: Accumulator (), Flag Register, , , , , , .
16-Bit Registers: Program Counter (), Stack Pointer ().
16-Bit Register Pairs: , , (formed by pairing two 8-bit general-purpose registers).
Temporary Registers: and (used internally by MPU; non-accessible to the programmer).
Detailed Functionality of Registers:
Accumulator (Register A):
An -bit register closely linked with the ALU.
Holds one of the operands for arithmetic/logical operations and receives the final output result of the operation.
General-Purpose Registers ():
Six -bit registers used by programmers to hold temporary data during instruction execution.
Can be grouped into -bit register pairs (, , ) to store -bit data or addresses.
The register pair frequently functions as a memory pointer ().
Program Counter (PC):
A -bit register used to sequence program execution.
Contains the memory address of the next instruction byte to be fetched.
Automatically increments by 1 as each machine code byte is fetched from memory.
Stack Pointer (SP):
A -bit register that acts as a memory pointer targeting a specific read/write memory area called the stack.
Automatically decremented by 2 during stack operations and incremented by 2 during stack operations.
8085 Flag Register Details
Structure:
An -bit special-purpose status register containing active flag bits (flip-flops).
The remaining bit positions are unassigned (vacant) and reserved for potential future processors.
Flags are set (Logic 1) or reset (Logic 0) based on the outcome of arithmetic and logical operations performed in the ALU.
Bit Allocation and Specific Flag Descriptions:
Bit Position | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
|---|---|---|---|---|---|---|---|---|
Flag Symbol | X | X | X |
Sign Flag () [Bit 7]:
Reflects the value of the most significant bit (MSB / Bit 7) of the accumulator after an operation.
: Output result is negative.
: Output result is positive.
Zero Flag () [Bit 6]:
Indicates whether an operation generated a zero result.
: The result in the accumulator is zero (all 8 bits are logic 0).
: The result in the accumulator is non-zero.
Auxiliary Carry Flag () [Bit 4]:
Sets when a carry is generated by bit 3 () and passed to bit 4 () in arithmetic operations.
: Auxiliary carry generated from bit 3 to bit 4.
: No auxiliary carry generated.
Used internally for Binary Coded Decimal (BCD) operations.
Note: The flag is the only flag register bit in the 8085 that is not directly accessible to the programmer via instructions.
Parity Flag () [Bit 2]:
Tests the total number of logic 1s present in the accumulator.
: Even parity (accumulator contains an even number of 1 bits).
: Odd parity (accumulator contains an odd number of 1 bits).
Carry Flag () [Bit 0]:
Sets if an arithmetic operation generates a carry out of bit 7 (result exceeds 8 bits).
: Carry bit generated.
: No carry bit generated.
Detailed Pin Description of 8085 Microprocessor
Complete Pin Assignments (Pins 1 to 40):
Pins 1 & 2 ():
Crystal input connections.
An external crystal oscillator is connected across these pins to drive internal clock generation circuitry.
The input frequency is internally divided by 2. To operate the MPU at , a crystal must be connected.
Pin 3 ():
Active-high output signal.
Used to reset external system components and peripheral ICs.
Driven high continuously as long as the pin is held low.
Pin 4 ():
Serial Output Data pin.
Transmits a single bit from the 8th position (MSB / bit 7) of the accumulator out to a serial device.
Controlled by executing the Set Interrupt Mask () instruction.
Pin 5 ():
Serial Input Data pin.
Accepts a single serial data bit and loads it into the 8th position (MSB / bit 7) of the accumulator.
Sampled by executing the Read Interrupt Mask () instruction.
Pin 6 ():
Non-maskable hardware interrupt.
Holds the highest execution priority among all interrupts.
Cannot be disabled by software instructions.
Triggering mechanism: Both edge and level triggered (signal must transition low-to-high and then remain high for a required duration).
Used for critical system conditions like emergency shutoff and power failure detection.
Pin 7 ():
Maskable hardware interrupt with 2nd highest priority.
Triggering mechanism: Positive edge triggered only (internal flip-flop latches on the rising edge of the signal).
Internal flip-flop remains set until cleared by a signal or internal recognition.
Pin 8 ():
Maskable hardware interrupt with 3rd highest priority.
Triggering mechanism: Level triggered only (pin must be held high until recognized).
Enabled using the Enable Interrupts () instruction and disabled using Disable Interrupts ().
Pin 9 ():
Maskable hardware interrupt with 4th highest priority.
Triggering mechanism: Level triggered (must be held high for a specific time period).
Operates similarly to .
Pin 10 ():
Maskable hardware interrupt with the lowest priority.
Triggering mechanism: Level triggered.
General-purpose interrupt line; allows external hardware to vector the microprocessor to any subroutine location.
Pin 11 ():
Interrupt Acknowledge output signal.
Active-low signal sent by the microprocessor to indicate it has recognized an request.
Pins 12 - 19 ():
Dual-purpose multiplexed lower-order address/data lines.
Functions as lower address byte () during T1 of a machine cycle, and as data lines () during T2-T3 cycles.
Pin 20 ():
System ground connection ( reference).
Pins 21 - 28 ():
Higher-order address bus lines.
Unidirectional lines transmitting the upper address byte from MPU to memory.
Placed into high-impedance state (tri-stated) during and modes.
Pins 29 & 33 ():
Status pins indicating the current machine cycle operation in progress.
Pin 30 ():
Address Latch Enable output.
Indicates whether is presenting address or data bits.
: Bus serves as address bus ().
: Bus serves as data bus ().
Pin 31 ():
Active-low Write control output signal.
Indicates that data on the data bus is to be written into the selected memory or I/O location.
Pin 32 ():
Active-low Read control output signal.
Indicates that the selected memory or input device is to be read and data placed on the data bus.
Pin 34 ():
Operation type selector output.
: I/O operation.
: Memory operation.
Pin 35 ():
Input signal used to synchronize slower peripherals with the fast MPU clock.
Logic 1: Peripheral is ready to transfer data.
Logic 0: Microprocessor enters wait states until goes high.
Pin 36 ():
Active-low input signal.
Holding this pin low for at least 3 clock cycles forces the microprocessor to reset itself:
Program counter is set to .
Control lines and buses are tri-stated.
Pin 37 ():
System clock output pin.
Provides a clock signal to drive other peripheral ICs in the system.
Pin 38 ():
Direct Memory Access (DMA) bus request input signal.
Logic high signals that an external controller (e.g., DMA controller) is requesting control of the address and data buses.
Upon receipt, the microprocessor completes the current machine cycle and relinquishes bus control.
Pin 39 ():
Hold Acknowledge output signal.
Driven high by the MPU to signal that it has acknowledged a request and tri-stated its buses (, , , , ).
Bus ownership remains with the DMA controller until is driven low, causing to go low and returning bus control to the MPU.
Pin 40 ():
Power supply pin requiring a DC voltage source.
Combined Bus and Status Encoding Table (, ):
Data Bus / Operation Status | |||
|---|---|---|---|
Halt | |||
Memory Write () | |||
Memory Read () | |||
Opcode Fetch | |||
No Operation | |||
I/O Write () | |||
I/O Read () | |||
Interrupt Acknowledge |
8085 Interrupt System
Interrupt Concept & Execution Sequence:
An interrupt is a signal sent by an external device or initiated by software to alter or halt regular program execution.
Execution Sequence:
The MPU receives an interrupt request signal while executing a main program.
It completes execution of the current instruction.
Program control branches to a specific interrupt subroutine (Interrupt Service Routine - ISR) by generating a signal.
The microprocessor executes the ISR.
Upon executing a (Return) instruction at the end of the ISR, program control returns to the main program location where it was suspended.
Hardware Interrupts:
Hardware interrupts are externally initiated signals received via physical input pins of the processor.
The 8085 contains 5 hardware interrupt pins:
Software Interrupts:
Software interrupts (also called Restart Interrupts) are explicit single-byte instructions (mnemonics/opcodes) inserted directly into a program.
The 8085 features 8 software instructions:
, , , , , , ,
Classification of Interrupts:
Maskable Interrupts:
Interrupts that can be delayed, disabled, or ignored by software execution ( instruction).
Includes: , , , and .
Non-Maskable Interrupts:
Interrupts that cannot be disabled or ignored by the microprocessor.
Includes: (used for critical emergencies like power failure).
Vectored Interrupts:
Interrupts where the execution subroutine starting address (vector location) is hardcoded internally.
Vector memory addresses are calculated using the general formula: (Where TYPE is the restart index number, and the resulting decimal value is converted into Hexadecimal).
Non-Vectored Interrupts:
Interrupts without a predefined vector address.
The external peripheral device must supply the vector location address over the data bus during the interrupt acknowledge cycle.
is the only non-vectored hardware interrupt in the 8085.
Hardware Interrupt Priority and Vector Locations:
Priority | Interrupt Name | Maskability | Trigger Type | Vector Address (Hex) |
|---|---|---|---|---|
1 (Highest) | Non-Maskable | Edge and Level | () | |
2 | Maskable | Positive Edge | () | |
3 | Maskable | Level | () | |
4 | Maskable | Level | () | |
5 (Lowest) | Maskable | Level | Non-Vectored (Provided externally) |
Software Interrupt Vector Locations:
Software Interrupt | Calculation Formula | Vector Address (Hex) |
|---|---|---|
Chapter Assignment Reference Questions
Question 1: Draw Block Diagram of a Basic Microcomputer.
Question 2: Draw and Explain Bus Organization of 8085 Microprocessor.
Question 3: Explain De-multiplexing of Add/Data Bus. Write the function of ALE pin.
Question 4: Explain how to Generate Control Signals using functions of control pins.
Question 5: Draw and Explain 8085 Architecture.
Question 6: Explain Register Organization of 8085.
Question 7: Draw and Explain Flag Register of 8085.
Question 8: Draw Pin Diagram of 8085. Explain function of each pin.
Question 9: Explain types of Interrupts.
Question 10: Write Interrupt Priority and Vector Locations of Interrupts.