2.4 Microprocessor
Last updated
Last updated
It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology.
Configuration:
8-bit data bus
16-bit address bus, which can address up to 64KB
16-bit program counter
16-bit stack pointer
Six 8-bit registers arranged in pairs: BC, DE, HL
Requires +5V supply to operate at 3.2 MHz single-phase clock
Used in applications like washing machines, microwave ovens, mobile phones, etc.
Microprocessor Architecture
Understanding the architecture flow of 8085 microprocessor
The architecture of the 8085 microprocessor is designed to execute instructions in a sequence of operations, including fetching, decoding, and executing, while handling external events such as interrupts. Here's a step-by-step explanation of the flow and components involved:
1. Fetch Phase
Program Counter (PC):
The PC holds the address of the next instruction to be executed.
It sends this address via the Address Bus to the memory.
Memory Unit:
The memory receives the address and places the corresponding instruction on the Data Bus.
This instruction is then sent to the Instruction Register (IR) in the microprocessor.
Instruction Register (IR):
The instruction fetched from memory is stored in the IR.
This marks the end of the fetching phase.
2. Decode Phase
Instruction Decoder:
The instruction stored in the IR is decoded by the Instruction Decoder.
The decoder interprets the opcode and determines the operations to be performed.
Timing and Control Circuit:
Based on the decoded instruction, the Timing and Control Circuit generates appropriate control signals.
These signals direct the flow of data between registers, memory, and the Arithmetic and Logic Unit (ALU).
3. Execute Phase
Control Signals:
The control signals guide the flow of data:
Registers: Data required for the operation is fetched from the appropriate register.
ALU: The ALU performs the necessary calculation or logical operation. ALU role is to generate the result and also the status. Result stored on the accumulator while status if exist in the flag.
Accumulator (A):
The result of the operation is stored in the Accumulator, which serves as a primary data register for the microprocessor.
Flags Register:
The Flags Register is updated based on the result in the accumulator.
It holds information about the status of the result, such as:
Zero (Z), Sign (S), Carry (CY), Parity (P), and Auxiliary Carry (AC) flags.
4. Program Counter Increment
Increment/Decrement Circuit (ICR/DCR):
After fetching an instruction, the Increment/Decrement Circuit increments the PC to point to the next instruction in sequence.
Similarly, it also manages the stack pointer during stack operations by incrementing/decrementing the address.
5. Interrupts
Interrupt Handling:
If an interrupt is triggered, the current operation is paused, and the processor executes the Interrupt Service Routine (ISR).
After handling the interrupt, the processor resumes the normal execution flow.
6. Temporary Register (WZ)
The WZ Register Pair is used internally to hold temporary data during multi-step operations.
For example, in memory-related operations, WZ temporarily holds intermediate addresses or values.
It is an enhanced version of 8085 Microprocessor that was designed by Intel in 1976. It is a 16-bit microprocessor designed by Intel in 1978 using HMOS technology.
Configuration:
16-bit data bus
20-bit address bus, which can address up to 1MB
16-bit instruction pointer (IP) and stack pointer (SP)
Four 16-bit general-purpose registers: AX, BX, CX, DX
Four segment registers: CS, DS, SS, ES (64KB each)
6-byte instruction queue for pipelined execution
Requires +5V supply to operate at 5-10 MHz
Used in applications like personal computers, robotics, industrial control systems, and embedded systems.
Understanding the architecture flow of 8086 microprocessor
Here's a step-by-step explanation of the flow and components involved:
1. Fetch Phase
Program Counter (IP - Instruction Pointer):
Holds the offset address of the next instruction within the Code Segment (CS).
The CS:IP pair forms the full 20-bit physical address of the instruction in memory.
Bus Interface Unit (BIU):
Sends this address to the memory via the Address Bus.
Fetches the instruction and stores it in the Instruction Queue (6-byte FIFO buffer).
Instruction Queue:
While the Execution Unit (EU) is decoding and executing the current instruction, the BIU fetches the next instruction to optimize processing time.
2. Decode Phase
Instruction Decoder (Part of EU):
Fetches the instruction from the Instruction Queue.
Decodes the operation (opcode) and determines the required operands, addressing modes, and control signals.
Prepares the Timing and Control Unit to generate signals for data transfer and ALU operations.
3. Execute Phase
Execution Unit (EU):
The decoded instruction guides the EU to perform the operation:
Data is fetched from the General Registers, Memory, or I/O Ports as needed.
The Arithmetic and Logic Unit (ALU) performs calculations or logical operations.
Results are stored in the appropriate register or memory.
Flags Register:
The Flags Register is updated based on the result of the operation, reflecting the status (e.g., Zero, Carry, Overflow).
Stack Pointer (SP):
If the operation involves function calls or interrupts, the SP manages push/pop operations to save or restore return addresses and data.
Interrupts (if any):
If an interrupt occurs, the current instruction is paused, the context is saved on the Stack, and the Interrupt Service Routine (ISR) executes.
4. Fetch-Execute Overlap (Pipelining)
While the EU decodes and executes the current instruction, the BIU fetches the next instruction, maintaining an overlap that speeds up processing.
Comparison between 8085 & 8086 Microprocessor
Size − 8085 is 8-bitmicroprocessor, whereas 8086 is 16-bit microprocessor.
Address Bus − 8085 has 16-bit address bus while 8086 has 20-bit address bus.
Memory − 8085 can access up to 64Kb, whereas 8086 can access up to 1 Mb of memory.
Instruction − 8085 doesn’t have an instruction queue, whereas 8086 has an instruction queue.
Pipelining − 8085 doesn’t support a pipelined architecture while 8086 supports a pipelined architecture.
I/O − 8085 can address = 256 I/O's, whereas 8086 can access = 65,536 I/O's.
Cost − The cost of 8085 is low whereas that of 8086 is high.
Features of a Microprocessor
Clock Speed: Determines the speed at which the microprocessor can execute instructions. Measured in Hertz (Hz).
Instruction Set: A set of instructions that the microprocessor can understand and execute.
Address Bus: Carries addresses from the microprocessor to memory or peripherals.
Data Bus: Transfers data between the microprocessor, memory, and I/O devices.
Control Bus: Manages the control signals for read/write operations, memory access, etc.
Interrupt Handling: Microprocessors support interrupts, allowing them to respond to external events or devices asynchronously.
Introduction to Assembly Language
Assembly language is a low-level programming language that provides a direct correspondence between the instructions written by the programmer and the machine code understood by the microprocessor.
Each instruction in assembly language corresponds to a single machine code instruction, making it more efficient than high-level programming languages.
Assembly language uses mnemonics (symbolic representations) to represent machine instructions, making it easier for humans to write and understand.
Basic Assembly Language Instructions
Data Movement: Moves data between registers or memory.
Example: MOV A, B
(Move the value in register B to register A).
Arithmetic Operations: Performs arithmetic calculations.
Example: ADD A, B
(Add the value in register B to register A).
Logic Operations: Performs logical operations.
Example: AND A, B
(Perform a bitwise AND operation between registers A and B).
Branching: Changes the flow of program execution.
Example: JMP address
(Jump to the specified memory address).
Control Instructions: Used to control the execution flow.
Example: HALT
(Stops program execution).
Example of Assembly Language Program
A simple program to add two numbers:
A microprocessor is a small, integrated circuit (IC) that performs the functions of a computer's central processing unit (CPU):
Microprocessors perform arithmetic, logic, and control functions on digital signals. They accept binary data as input, process it according to instructions stored in its memory, and provide results in binary form as output.
Microprocessors are clock-driven, register-based, and operate on numbers and symbols represented in the binary number system.