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 BB, CC, DD, EE, HH, LL, and the Accumulator (AA).

    • 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:

    1. Fetch: Retrieves the instruction code from the memory location.

    2. Decode: Interprets the fetched binary instruction to determine the required operation.

    3. Execute: Carries out the specified operation using internal registers and the ALU until a STOPSTOP 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 1616 individual lines designated as A0A_0 to A15A_{15}.

    • Directionality: Strictly unidirectional, flowing exclusively from the microprocessor out to input/output (I/O) devices and memory.

    • Addressing Capability: A 1616 -bit address bus allows the system to address up to 216=65,5362^{16} = 65,536 memory locations (64KB64\,\text{KB}).

    • Data Bus:

    • A collection of wires through which data is transmitted between different functional blocks of the computer system.

    • Consists of 88 individual lines designated as D0D_0 to D7D_7 .

    • Directionality: Fully bidirectional, allowing two-way data transfer between the microprocessor, main memory, and peripheral devices.

    • Transfers 88 -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 (IO/MIO/\overline{M} )

      • Read control (RD\overline{RD} )

      • Write control (WR\overline{WR} )

    • Combining these three control signals allows the generation of four distinct system control signals:

      • Memory Read (MEMR\overline{MEMR} )

      • Memory Write (MEMW\overline{MEMW} )

      • Input Read (IOR\overline{IOR} )

      • Output Write (IOW\overline{IOW} )

Demultiplexing of the Address/Data Bus

  • Multiplexed Address/Data Bus (AD0AD7AD_0 - AD_7):

    • To reduce the total pin count on the physical IC package, the lower-order address bus (A0A7A_0 - A_7) and the 8-bit data bus (D0D7D_0 - D_7) are combined into 88 dual-purpose multiplexed lines designated as AD0AD_0 to AD7AD_7 .

    • During the first clock period (T-state) of a machine cycle, these lines carry the lower-order 8-bit address (A0A7A_0 - A_7).

    • During subsequent clock periods of the machine cycle, these lines function as the bidirectional data bus (D0D7D_0 - D_7).

  • 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 AD0AD7AD_0 - AD_7 connect directly to the data inputs of the 74LS373 latch.

    • The Address Latch Enable (ALEALE) output signal from the 8085 is connected to the Enable pin (GG) of the 74LS373 latch.

    • The Output Control (OC\overline{OC}) pin of the latch is permanently connected to ground (VSSV_{SS}).

  • Demultiplexing Operational Logic:

    • When ALEALE is High (Logic 1): The latch becomes transparent. The lower-order address bits (A0A7A_0 - A_7) pass through the latch and are stored/latched on its output pins.

    • When ALEALE goes Low (Logic 0): The latch freezes its output, preserving the lower-order address bits (A0A7A_0 - A_7) for the remainder of the cycle while freeing the lines AD0AD7AD_0 - AD_7 to operate as the bidirectional data bus (D0D7D_0 - D_7).

Generation of Control Signals

  • Primary Control Signals Pin Functions:

    • IO/MIO/\overline{M}:

    • 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.

    • RD\overline{RD}:

    • Active-low signal controlling READ operations.

    • When logic 0, the selected memory location or I/O device is read by the MPU.

    • WR\overline{WR}:

    • 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: IO/MIO/\overline{M}, RD\overline{RD}, and WR\overline{WR}.

    • Outputs from the decoder produce distinct active-low control commands:

    • MEMR\overline{MEMR}: Memory Read operation.

    • MEMW\overline{MEMW}: Memory Write operation.

    • IOR\overline{IOR}: Input Read operation.

    • IOW\overline{IOW}: Output Write operation.

  • Control Pin Decoding Logic Table:

IO/MIO/\overline{M}

RD\overline{RD}

WR\overline{WR}

Data Bus Status / Operation Generated

00

00

00

Halt

00

00

11

Memory Read (MEMR\overline{MEMR})

00

11

00

Memory Write (MEMW\overline{MEMW})

00

11

11

Opcode Fetch

11

00

00

No Operation

11

00

11

I/O Read (IOR\overline{IOR})

11

11

00

I/O Write (IOW\overline{IOW})

11

11

11

Interrupt Acknowledge

Internal Architecture of 8085 Microprocessor

  • General Specifications:

    • Built using N-channel Metal-Oxide-Semiconductor (NMOS) technology.

    • Data Bus Width: 88 bits (processes 88 bits of data in parallel).

    • Address Bus Width: 1616 bits (can address 216=65,5362^{16} = 65,536 bytes or 64KB64\,\text{KB} of memory space).

    • ALU Capacity: 88-bit execution unit.

    • Operating Parameters: Requires a single +5V+5\,\text{V} DC power supply (VCCV_{CC}) and operates with a standard clock cycle duration of 320ns320\,\text{ns}.

  • Functional Internal Blocks:

    • Bus Architecture:

    • Address Bus: 1616 bits total, unidirectional.

    • Higher-Order Address Bus: Pins A8A15A_8 - A_{15} (unidirectional).

    • Lower-Order Address/Data Bus: Pins AD0AD7AD_0 - AD_7 (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.

    • X1,X2X_1, X_2: Crystal input connections for internal clock generator.

    • CLK OUT\text{CLK OUT}: Output clock signal for external system synchronization.

    • ALEALE: Address Latch Enable signal for demultiplexing AD0AD7AD_0 - AD_7 .

    • RD,WR\overline{RD}, \overline{WR}: Active-low read and write control lines.

    • IO/MIO/\overline{M}: Selects I/O or memory operations.

    • S1,S0S_1, S_0: Machine cycle status signals.

    • HOLD,HLDA\text{HOLD}, \text{HLDA}: Bus request and acknowledge signals for Direct Memory Access (DMA).

    • READY\text{READY}: 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:

      • SID\text{SID}: Serial Input Data line.

      • SOD\text{SOD}: Serial Output Data line.

    • Interrupt Control Block:

    • Manages hardware interrupt requests (TRAP\text{TRAP}, RST 7.5\text{RST 7.5}, RST 6.5\text{RST 6.5}, RST 5.5\text{RST 5.5}, INTR\text{INTR}) and acknowledgement (INTA\overline{\text{INTA}}).

    • 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 (AA), Flag Register, BB, CC, DD, EE, HH, LL.

    • 16-Bit Registers: Program Counter (PC\text{PC}), Stack Pointer (SP\text{SP}).

    • 16-Bit Register Pairs: BCBC, DEDE, HLHL (formed by pairing two 8-bit general-purpose registers).

    • Temporary Registers: WW and ZZ (used internally by MPU; non-accessible to the programmer).

  • Detailed Functionality of Registers:

    • Accumulator (Register A):

    • An 88-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 (B,C,D,E,H,LB, C, D, E, H, L):

    • Six 88-bit registers used by programmers to hold temporary data during instruction execution.

    • Can be grouped into 1616 -bit register pairs (BCBC, DEDE, HLHL) to store 1616-bit data or addresses.

    • The HLHL register pair frequently functions as a memory pointer (MM).

    • Program Counter (PC):

    • A 1616-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 1616-bit register that acts as a memory pointer targeting a specific read/write memory area called the stack.

    • Automatically decremented by 2 during stack PUSHPUSH operations and incremented by 2 during stack POPPOP operations.

8085 Flag Register Details

  • Structure:

    • An 88-bit special-purpose status register containing 55 active flag bits (flip-flops).

    • The remaining 33 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

SS

ZZ

X

ACAC

X

PP

X

CYCY

  • Sign Flag (SS) [Bit 7]:

    • Reflects the value of the most significant bit (MSB / Bit 7) of the accumulator after an operation.

    • S=1S = 1: Output result is negative.

    • S=0S = 0: Output result is positive.

  • Zero Flag (ZZ) [Bit 6]:

    • Indicates whether an operation generated a zero result.

    • Z=1Z = 1: The result in the accumulator is zero (all 8 bits are logic 0).

    • Z=0Z = 0: The result in the accumulator is non-zero.

  • Auxiliary Carry Flag (ACAC) [Bit 4]:

    • Sets when a carry is generated by bit 3 (D3D_3) and passed to bit 4 (D4D_4) in arithmetic operations.

    • AC=1AC = 1: Auxiliary carry generated from bit 3 to bit 4.

    • AC=0AC = 0: No auxiliary carry generated.

    • Used internally for Binary Coded Decimal (BCD) operations.

    • Note: The ACAC flag is the only flag register bit in the 8085 that is not directly accessible to the programmer via instructions.

  • Parity Flag (PP) [Bit 2]:

    • Tests the total number of logic 1s present in the accumulator.

    • P=1P = 1: Even parity (accumulator contains an even number of 1 bits).

    • P=0P = 0: Odd parity (accumulator contains an odd number of 1 bits).

  • Carry Flag (CYCY) [Bit 0]:

    • Sets if an arithmetic operation generates a carry out of bit 7 (result exceeds 8 bits).

    • CY=1CY = 1: Carry bit generated.

    • CY=0CY = 0: No carry bit generated.

Detailed Pin Description of 8085 Microprocessor

  • Complete Pin Assignments (Pins 1 to 40):

    • Pins 1 & 2 (X1,X2X_1, X_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 3MHz3\,\text{MHz}, a 6MHz6\,\text{MHz} crystal must be connected.

    • Pin 3 (RESET OUT\text{RESET OUT}):

    • Active-high output signal.

    • Used to reset external system components and peripheral ICs.

    • Driven high continuously as long as the RESET IN\overline{\text{RESET IN}} pin is held low.

    • Pin 4 (SOD\text{SOD}):

    • 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 (SIM\text{SIM}) instruction.

    • Pin 5 (SID\text{SID}):

    • 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 (RIM\text{RIM}) instruction.

    • Pin 6 (TRAP\text{TRAP}):

    • 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 (RST 7.5\text{RST 7.5}):

    • 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 RESET IN\overline{\text{RESET IN}} signal or internal recognition.

    • Pin 8 (RST 6.5\text{RST 6.5}):

    • Maskable hardware interrupt with 3rd highest priority.

    • Triggering mechanism: Level triggered only (pin must be held high until recognized).

    • Enabled using the Enable Interrupts (EI\text{EI}) instruction and disabled using Disable Interrupts (DI\text{DI}).

    • Pin 9 (RST 5.5\text{RST 5.5}):

    • Maskable hardware interrupt with 4th highest priority.

    • Triggering mechanism: Level triggered (must be held high for a specific time period).

    • Operates similarly to RST 6.5\text{RST 6.5}.

    • Pin 10 (INTR\text{INTR}):

    • 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 (INTA\overline{\text{INTA}}):

    • Interrupt Acknowledge output signal.

    • Active-low signal sent by the microprocessor to indicate it has recognized an INTR\text{INTR} request.

    • Pins 12 - 19 (AD0AD7AD_0 - AD_7):

    • Dual-purpose multiplexed lower-order address/data lines.

    • Functions as lower address byte (A0A7A_0 - A_7) during T1 of a machine cycle, and as data lines (D0D7D_0 - D_7) during T2-T3 cycles.

    • Pin 20 (VSSV_{SS}):

    • System ground connection (0V0\,\text{V} reference).

    • Pins 21 - 28 (A8A15A_8 - A_{15}):

    • Higher-order address bus lines.

    • Unidirectional lines transmitting the upper address byte from MPU to memory.

    • Placed into high-impedance state (tri-stated) during HOLD\text{HOLD} and RESET\text{RESET} modes.

    • Pins 29 & 33 (S0,S1S_0, S_1):

    • Status pins indicating the current machine cycle operation in progress.

    • Pin 30 (ALEALE):

    • Address Latch Enable output.

    • Indicates whether AD0AD7AD_0 - AD_7 is presenting address or data bits.

    • ALE=1ALE = 1: Bus serves as address bus (A0A7A_0 - A_7).

    • ALE=0ALE = 0: Bus serves as data bus (D0D7D_0 - D_7).

    • Pin 31 (WR\overline{\text{WR}}):

    • 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 (RD\overline{\text{RD}}):

    • 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 (IO/MIO/\overline{M}):

    • Operation type selector output.

    • IO/M=1IO/\overline{M} = 1: I/O operation.

    • IO/M=0IO/\overline{M} = 0: Memory operation.

    • Pin 35 (READY\text{READY}):

    • 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 READY\text{READY} goes high.

    • Pin 36 (RESET IN\overline{\text{RESET IN}}):

    • 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 0000H0000\text{H}.

      • Control lines and buses are tri-stated.

    • Pin 37 (CLK OUT\text{CLK OUT}):

    • System clock output pin.

    • Provides a clock signal to drive other peripheral ICs in the system.

    • Pin 38 (HOLD\text{HOLD}):

    • 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 (HLDA\text{HLDA}):

    • Hold Acknowledge output signal.

    • Driven high by the MPU to signal that it has acknowledged a HOLD\text{HOLD} request and tri-stated its buses (A8A15A_8-A_{15}, AD0AD7AD_0-AD_7, RD\overline{\text{RD}}, WR\overline{\text{WR}}, IO/MIO/\overline{M}).

    • Bus ownership remains with the DMA controller until HOLD\text{HOLD} is driven low, causing HLDA\text{HLDA} to go low and returning bus control to the MPU.

    • Pin 40 (VCCV_{CC}):

    • Power supply pin requiring a +5V+5\,\text{V} DC voltage source.

  • Combined Bus and Status Encoding Table (IO/MIO/\overline{M}, S1,S0S_1, S_0):

IO/MIO/\overline{M}

S1S_1

S0S_0

Data Bus / Operation Status

00

00

00

Halt

00

00

11

Memory Write (MEMW\overline{MEMW})

00

11

00

Memory Read (MEMR\overline{MEMR})

00

11

11

Opcode Fetch

11

00

00

No Operation

11

00

11

I/O Write (IOW\overline{IOW})

11

11

00

I/O Read (IOR\overline{IOR})

11

11

11

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:

    1. The MPU receives an interrupt request signal while executing a main program.

    2. It completes execution of the current instruction.

    3. Program control branches to a specific interrupt subroutine (Interrupt Service Routine - ISR) by generating a CALLCALL signal.

    4. The microprocessor executes the ISR.

    5. Upon executing a RETRET (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:

    1. TRAP\text{TRAP}

    2. RST 7.5\text{RST 7.5}

    3. RST 6.5\text{RST 6.5}

    4. RST 5.5\text{RST 5.5}

    5. INTR\text{INTR}

  • 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:

    • RST 0\text{RST 0}, RST 1\text{RST 1}, RST 2\text{RST 2}, RST 3\text{RST 3}, RST 4\text{RST 4}, RST 5\text{RST 5}, RST 6\text{RST 6}, RST 7\text{RST 7}

  • Classification of Interrupts:

    • Maskable Interrupts:

    • Interrupts that can be delayed, disabled, or ignored by software execution (DI\text{DI} instruction).

    • Includes: RST 7.5\text{RST 7.5}, RST 6.5\text{RST 6.5}, RST 5.5\text{RST 5.5}, and INTR\text{INTR}.

    • Non-Maskable Interrupts:

    • Interrupts that cannot be disabled or ignored by the microprocessor.

    • Includes: TRAP\text{TRAP} (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:       Vector Address=8×TYPE\text{Vector Address} = 8 \times \text{TYPE}       (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.

    • INTR\text{INTR} 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)

TRAP (RST 4.5)\text{TRAP (RST 4.5)}

Non-Maskable

Edge and Level

24H24\text{H} (8×4.5=36=24H8 \times 4.5 = 36 = 24\text{H})

2

RST 7.5\text{RST 7.5}

Maskable

Positive Edge

3CH3\text{C}\text{H} (8×7.5=60=3CH8 \times 7.5 = 60 = 3\text{C}\text{H})

3

RST 6.5\text{RST 6.5}

Maskable

Level

34H34\text{H} (8×6.5=52=34H8 \times 6.5 = 52 = 34\text{H})

4

RST 5.5\text{RST 5.5}

Maskable

Level

2CH2\text{C}\text{H} (8×5.5=44=2CH8 \times 5.5 = 44 = 2\text{C}\text{H})

5 (Lowest)

INTR\text{INTR}

Maskable

Level

Non-Vectored (Provided externally)

  • Software Interrupt Vector Locations:

Software Interrupt

Calculation Formula

Vector Address (Hex)

RST 0\text{RST 0}

8×0=08 \times 0 = 0

00H00\text{H}

RST 1\text{RST 1}

8×1=88 \times 1 = 8

08H08\text{H}

RST 2\text{RST 2}

8×2=168 \times 2 = 16

10H10\text{H}

RST 3\text{RST 3}

8×3=248 \times 3 = 24

18H18\text{H}

RST 4\text{RST 4}

8×4=328 \times 4 = 32

20H20\text{H}

RST 5\text{RST 5}

8×5=408 \times 5 = 40

28H28\text{H}

RST 6\text{RST 6}

8×6=488 \times 6 = 48

30H30\text{H}

RST 7\text{RST 7}

8×7=568 \times 7 = 56

38H38\text{H}

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.