Overview of 8086 Microprocessor Features
Overview of 8086 Microprocessor Features
ANS: History- The Intel 8086 microprocessor was developed by Intel Corporation in 1978. It was a 16-bit processor and laid the
foundation for modern x86 architecture. It was designed as an enhancement of the 8085 (8-bit processor) and was later followed
by 80286, 80386, and Pentium series processors. It played a crucial role in the development of personal computers, especially in
the early IBM PC models.
Definition- The Intel 8086 is a 16-bit microprocessor designed by Intel with a 20-bit address bus, allowing it to address 1MB of
memory. It supports multiprogramming, pipelining, and segmented memory architecture. The 8086 is capable of performing
arithmetic, logic, and control operations efficiently.
Features-
Architecture diagrams –
• Contains General-Purpose Registers, ALU (Arithmetic Logic Unit), and Control Unit.
Registers in 8086:
1. General-Purpose Registers
2. Segment Registers
4. Flag Register
• Holds condition flags like Zero Flag, Carry Flag, Parity Flag, Sign Flag, Overflow Flag, etc.
1. Fetch Stage: The Bus Interface Unit (BIU) fetches the instruction from memory and places it in the instruction queue.
4. Memory/IO Operations: The result is either stored in registers or sent to memory/I/O devices.
5. Next Instruction: The BIU fetches the next instruction, and the cycle continues.
Result: AX = 08H
8086 Microprocessor Architecture Explanation
The 8086 microprocessor is a 16-bit processor developed by Intel. It follows a CISC (Complex Instruction Set Computing)
architecture and uses segmentation to manage memory efficiently. The 8086 architecture consists of two main units:
The BIU is responsible for fetching instructions, reading/writing data, and managing the memory and I/O addresses. It works
independently of the execution unit to improve performance.
Components of BIU:
• Segment Registers (CS, DS, SS, ES): Holds the base addresses of memory segments
• Instruction Pointer (IP): Holds the offset of the next instruction to be executed
• Instruction Queue: A 6-byte queue used for pipelining (pre-fetching instructions to improve speed)
• Address Generation Circuit: Generates physical addresses using Segment × 16 + Offset
• Bus Control Logic: Controls communication between the processor and memory/I/O
The EU is responsible for executing instructions fetched by the BIU. It processes data and performs arithmetic, logic, and control
operations.
Components of EU:
• General-Purpose Registers (AX, BX, CX, DX): Used for data storage and operations
• Pointer & Index Registers (SP, BP, SI, DI): Used for addressing and memory operations
• Flag Register: Holds status flags (Zero, Carry, Sign, Overflow, etc.)
• Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations
• Control Unit: Decodes instructions and controls execution
Conclusion: The 8086 microprocessor architecture is designed for efficient memory access and instruction execution. The BIU
and EU work together to improve speed and efficiency through pipelining and segmentation. These features make it a
foundational microprocessor in computing history.
CT: 1. What were the key differences between the Intel 4004 and 8086 microprocessors?
Ans: The Intel 4004 and Intel 8086 microprocessors were both significant in the evolution of computing, but they had major
differences in terms of architecture, data width, performance, and capabilities. Here’s a detailed comparison:
2. Explain the role of buses in a microprocessor system. What and explain roles of Buses? Draw the diagram of the block diagram
of a computer system showing the address, data and Control bus structure??
Ans: A bus in a microprocessor system is a set of parallel wires or connections that transfer data, addresses, and control signals
between different components of the computer, such as the CPU, memory, and I/O devices. The efficiency of buses significantly
impacts the speed and performance of the system.
The 8086 microprocessor and other microprocessors typically use three main types of buses: Address Bus, Data Bus, Control Bus.
The diagram effectively shows how the 8085 microprocessor interacts with memory, input, and output devices through
address, data, and control buses. This bus organization ensures smooth communication and data transfer within the system.
• Purpose: Carries memory addresses from the CPU to memory and I/O devices.
• Direction: Unidirectional (only from the CPU to memory or I/O).
• Size in 8086: 20-bit (can address 1 MB of memory).
• Example: When the CPU wants to read data from a memory location (e.g., address 0x12345), the address is sent via the
address bus to memory.
• Purpose: Transfers actual data between the CPU, memory, and I/O devices.
• Direction: Bidirectional (data flows both to and from the CPU).
• Size in 8086: 16-bit (can transfer 16-bit data at a time).
• Example: If the CPU requests a value stored at memory address 0x12345, the memory sends back the data (e.g.,
10101010 11001100) via the data bus.
3. Control Bus (Unidirectional & Bidirectional):
• Purpose: Carries control signals that manage and coordinate operations between components.
• Direction: Both Unidirectional and Bidirectional.
• Examples of Control Signals:
• Read (RD̅ ) Signal: Instructs memory or I/O devices to send data.
• Write (WR̅ ) Signal: Instructs memory or I/O devices to store data.
• Interrupt (INT) Signals: Used to handle external events like keyboard input.
• Clock Signals: Synchronize operations.
• The CPU places the memory address (0x12345) on the address bus.
• The control bus activates the Read (RD̅ ) signal.
• The memory sends the requested data (e.g., 10101010 11001100) via the data bus.
• The CPU receives the data and processes it.
• This cycle repeats for every instruction execution.
3. What were the major improvements introduced in 32-bit microprocessors compared to 16-bit ones?
The transition from 16-bit to 32-bit microprocessors brought several key advancements in performance, memory addressing,
processing power, and efficiency. Below are the major improvements:
• 16-bit processors (e.g., Intel 8086, 80286) could process 16-bit data at a time.
• 32-bit processors (e.g., Intel 80386, Pentium) could handle 32-bit data at a time, doubling the processing speed and
efficiency.
• Example: A 32-bit CPU can perform 32-bit additions in one cycle, whereas a 16-bit CPU may require multiple cycles.
• 16-bit processors used a 20-bit address bus (8086) or 24-bit address bus (80286), allowing them to address 1MB to 16MB
of memory.
• 32-bit processors used a 32-bit address bus, supporting up to 4GB (2³² bytes) of memory.
• Impact: Enabled advanced computing, multitasking, and large applications.
• 32-bit processors introduced new instruction sets such as x86-32, supporting faster arithmetic, logical, and memory
operations.
• Introduction of Pipelining and Parallel Execution: Many 32-bit CPUs (like Intel 80486 and later) introduced pipelining,
allowing multiple instructions to execute simultaneously.
• Enhanced Floating-Point Operations: Improved math coprocessor (FPU) performance, making graphics, simulations, and
calculations faster.
• 16-bit processors had limited multitasking due to restricted memory and register size.
• 32-bit processors supported true multitasking with better memory protection, enabling stable operating systems like
Windows 95, Linux, and later versions.
5. Enhanced Register Set (Larger and More Efficient)
• 16-bit processors had 16-bit general-purpose registers, limiting data storage and processing speed.
• 32-bit processors used 32-bit registers, allowing:
o Faster processing of large numbers.
o More efficient loop execution and function calls.
o Improved graphics, gaming, and scientific computations.
• 16-bit processors relied on segmented memory architecture, which was complex and less efficient.
• 32-bit processors introduced flat memory models and paging, enabling:
o Virtual memory (efficient memory usage).
o Memory protection (preventing one program from corrupting another’s memory).
• 32-bit processors supported faster data transfer rates for peripherals like hard drives, graphics cards, and network
adapters.
• Allowed high-speed buses like PCI (Peripheral Component Interconnect) and AGP (Accelerated Graphics Port) for graphics
and gaming.
• 32-bit CPUs like the Intel 80386 & 80486 ran at 16-100 MHz, and later versions reached even higher speeds.
Conclusion: The shift from 16-bit to 32-bit microprocessors was a major technological leap that enabled better performance,
multitasking, gaming, and software development. It laid the foundation for modern computing, operating systems, and high-
performance applications.
4. What are the key differences between 8-bit, 16-bit, and 32-bit microprocessors in terms of data processing capabilities?
Ans: Microprocessors are classified based on their data bus width, address bus width, processing power, and memory handling
capabilities. Here’s a detailed comparison of 8-bit, 16-bit, and 32-bit microprocessors:
Ans: Microprocessor: A microprocessor is the central processing unit (CPU) of a computer system, implemented on a single
integrated circuit (IC). It performs arithmetic, logic, control, and data processing operations, acting as the brain of the computer.
Example Microprocessors:
• Single-chip CPU: Contains ALU (Arithmetic Logic Unit), Control Unit, and Registers.
• Fetch-Decode-Execute Cycle: Processes instructions sequentially.
• Bit-width Classification: 8-bit, 16-bit, 32-bit, 64-bit, etc.
• Performs Logic & Arithmetic Operations: Addition, subtraction, comparisons, etc.
• Controls Data Flow: Communicates with memory and I/O devices.
Microprocessor 8086: The Intel 8086 is a 16-bit microprocessor developed by Intel in 1978. It is based on the x86 architecture and
was one of the first processors used in early personal computers (PCs). The 8086 is known for its powerful instruction set,
segmented memory addressing, and pipelined execution, which significantly improved computing performance compared to its
predecessors.
Applications
Ans: A microprocessor-based personal computer (PC) system is a computing device where the microprocessor (CPU) serves as the
central unit for processing data and executing instructions. It integrates various components such as memory, input/output
devices, and storage units to perform computing tasks efficiently.
1. Microprocessor (CPU)
2. Memory Unit
3. Input Devices
4. Output Devices
5. Storage Devices
6. System Bus
Types:
• The user provides input through input devices (e.g., keyboard, mouse).
• The microprocessor fetches instructions from memory.
• The CPU decodes and executes the instructions.
• Processed data is stored in memory or sent to output devices.
• The results are displayed on a screen or stored in storage devices.
Ans: The age of microprocessors began in 1971 with the introduction of the Intel 4004, a 4-bit microprocessor that revolutionized
computing by integrating the CPU onto a single chip. Over the years, microprocessors have evolved significantly in terms of speed,
memory capacity, instruction sets, and processing power.
• Intel 4040 was an improved version of the 4004, with a slightly higher speed.
• Texas Instruments (TMS-1000) also introduced 4-bit microprocessors for control applications.
• Even today, 4-bit microprocessors are used in microwave ovens, small appliances, and calculators.
• Intel 8008 (1972): The first 8-bit processor, expanded memory support (16K bytes) and 48 instructions.
• Intel 8080 (1973): The first truly modern 8-bit processor, much faster and more powerful than its predecessors.
• Motorola MC6800 (1974): Competed with Intel’s 8080, influencing the evolution of microprocessors.
• Zilog Z80 (1976): An improved version of the 8080, widely used in early home computers.
• MOS Technology 6502 (1975): Used in iconic systems like the Apple I, Commodore 64, and Nintendo Entertainment System (NES).
As computing demands grew, the limitations of 8-bit processors became evident. This led to the introduction of 16-bit and later
32-bit microprocessors.
• Today’s microprocessors are multi-core, 64-bit, AI-powered, and energy-efficient, with applications in everything from
personal computers to smartphones, AI systems, and cloud computing.
Conclusion: The microprocessor age has transformed computing, from basic 4-bit chips in the 1970s to today’s powerful multi-
core, 64-bit processors that drive everything from PCs to AI systems.
4. Age of Mechanical.
Ans: The concept of mechanical computing predates modern electronic devices by centuries. Humans have sought ways to
automate calculations using mechanical systems long before the invention of electrical computers.
• Commissioned by the Royal Astronomical Society of Britain to create a machine for navigational calculations.
• Designed to store 1000 numbers (each with 20 digits).
• Used punched cards for input, inspired by Jacquard’s loom (1801).
• Concept of a variable program – a machine that could modify its function dynamically.
• Precision issues: The machining technology of the 1800s was not advanced enough to produce the 50,000+ parts required
for Babbage’s Analytical Engine.
• Limited capabilities: Mechanical systems were slow, bulky, and required manual operation.
• High costs: Developing these machines required significant financial resources.
Impact on Modern Computing: Despite its limitations, the Mechanical Age laid the foundation for modern computing. Concepts
from this era, such as automation, programming, and input/output systems, directly influenced the development of electronic
computers in the 20th century.
Ans: The Intel 8086 is a 16-bit microprocessor introduced by Intel in 1978 as the first processor in the x86 family. It was designed
for high-performance computing and became the foundation of modern processors. It has a 20-bit address bus, which allows it to
access 1MB of memory, and a 16-bit data bus, meaning it can process 16-bit data at a time.
The 8086 microprocessor was widely used in early personal computers and embedded systems. Some examples include:
• IBM PC (1981) – One of the first personal computers, powered by the 8088 (a variant of 8086 with an 8-bit data bus).
• Industrial Automation – Used in CNC machines and robotics for process control.
• Military Applications – Found in early radar and missile guidance systems.
• Embedded Systems – Used in early automotive electronics, such as engine control units (ECUs).
• Gaming Consoles – Some early arcade machines used microprocessors similar to the 8086.
First-Generation Microprocessors:
The first generation of microprocessors (1971-1978) includes the early 4-bit, 8-bit, and 16-bit processors.
• Built using NMOS technology (Later processors moved to CMOS for better efficiency).
• Limited processing power (4-bit or 8-bit initially, with 16-bit arriving later).
• Single-chip processors with a basic ALU, control unit, and registers.
• Used in calculators, control systems, and early computers.
6. Example memory based Microprocessor and I/O system working of a Microprocessor based computer system?
Ans. A microprocessor-based system consists of a microprocessor, memory (RAM/ROM), and input/output (I/O) devices that work
together to execute instructions and perform tasks. The 8086 microprocessor, for example, interacts with memory and I/O devices
through its buses (address, data, and control buses).
Components Involved:
• Microprocessor (8086) – The central processing unit that fetches, decodes, and executes instructions.
• Memory (RAM & ROM) –
• RAM (Random Access Memory): Stores temporary data and program execution results.
• ROM (Read-Only Memory): Stores firmware or permanent programs.
• I/O Devices – Includes keyboard, display, sensors, and external storage devices.
• Buses –
o Address Bus (20-bit in 8086) to access 1MB memory locations.
o Data Bus (16-bit in 8086) for data transfer between memory, CPU, and I/O.
o Control Bus for sending signals like Read (RD), Write (WR), and Interrupts.
• Clock Generator (8284A) – Provides clock signals for synchronization.
• Interrupt Controller (8259) – Manages hardware interrupts from I/O devices.
1. Instruction Fetching
• The microprocessor (8086) fetches the instruction from ROM (or RAM) using the address bus.
• The BIU (Bus Interface Unit) helps in fetching data and instructions.
• The Control Unit (CU) decodes the fetched instruction to understand what operation needs to be performed.
• The ALU (Arithmetic and Logic Unit) performs the necessary operations (addition, subtraction, logical operations, etc.).
4. Memory and I/O Access
• If the instruction requires data from memory, the 8086 sends an address through the address bus and fetches the data
via the data bus.
• If the instruction involves I/O devices (keyboard, display, printer), the control bus signals the appropriate I/O port to
perform the operation.
• The result is either stored in the registers, memory, or sent to an output device.
• If an interrupt occurs (e.g., user presses a key), the Interrupt Controller (8259) signals the CPU to handle it.
• The processor temporarily stops execution, processes the interrupt service routine (ISR), and then resumes normal
execution.
• ROM stores a program that cycles through red, yellow, and green lights.
• The microprocessor reads input signals from sensors (e.g., vehicle detectors).
• Based on the inputs, it sends signals to control traffic lights (I/O output ports).
• The system continues looping until power is turned off.
Conclusion: A microprocessor-based computer system operates by continuously fetching, decoding, and executing instructions,
communicating with memory and I/O devices using buses. This process allows computers and embedded systems to perform
complex tasks efficiently.
[ 8086 and 8685 ] [ 4046 and ENIAC ] [ 8086 and 80286 ] [ 16bit and 32 bit ] [ 4004 and 8086 ]
Ans: To compare the features and improvements between the microprocessors you mentioned, I'll break it down by each pair of
processors and the differences in their data processing capabilities:
1. 8086 vs. 8051: If referring to 8051, the 8086 has a wider data bus (16 bits vs. 8 bits) and supports more memory (1 MB vs. 64
KB). The 8086 is more suited for general-purpose computing, whereas the 8051 is used for embedded applications.
8086:
• Data Bus Width: 16 bits.
• Address Bus Width: 20 bits (1 MB of addressable memory).
• Processing: Primarily used for basic integer operations. It lacks advanced memory management features.
8051:
• Data Bus Width: 8 bits.
• Address Bus Width: 16 bits (64 KB of addressable memory).
• Processing: The 8051 is an 8-bit microcontroller designed for embedded applications. It has a small instruction set and is
slower than the 8086 for general-purpose computing tasks.
2. 4046 vs. ENIAC: 4046 vs. ENIAC: The ENIAC, being a massive machine from the 1940s, had much more computing power and
speed than the 4046, which was a smaller microprocessor.
4046:
• This is likely referring to the Intel 4046, which was a microprocessor used in early computing, with an architecture similar
to the Intel 4004 but more focused on specialized applications.
• Data Bus Width: 4 bits.
• Processing: Limited processing power with small memory addressing capabilities. The 4046 was used in control and timing
operations rather than general-purpose computing.
ENIAC (Electronic Numerical Integrator and Computer):
• Data Bus Width: 10 decimal digits (around 40 bits per word).
• Processing: ENIAC was one of the first general-purpose computers, capable of handling large-scale computations,
especially for scientific and military applications.
• Improvements: ENIAC was significantly faster than earlier electromechanical computers, but it was still much slower
compared to later processors. It was programmed using plugboards and had no internal memory, relying on external
storage.
3. 8086 vs. 80286: The 80286 brought protected mode, allowing better multitasking and memory management, while the 8086
was limited to real mode with a smaller address space.
8086:
• Data Bus Width: 16 bits.
• Address Bus Width: 20 bits (1 MB of addressable memory).
• Processing: Basic data processing with 16-bit operations. It operated mainly in real mode, meaning that it had limited
memory access and management.
80286:
• Data Bus Width: 16 bits.
• Address Bus Width: 24 bits (16 MB of addressable memory).
• Processing: The 80286 introduced protected mode, which allowed better memory management, multitasking, and
protection between processes.
• Improvements: The 80286 introduced a larger memory space and basic support for multitasking, a significant step forward
in system stability and efficiency compared to the 8086.
4. 16-bit vs. 32-bit: A 32-bit processor can handle larger data, more memory, and provides better multitasking, while a 16-bit
processor is limited in all those aspects.
5. 4004 vs. 8086: The 8086 is far more powerful, with a larger data bus (16 bits vs. 4 bits), more memory addressing, and better
processing power compared to the 4004, which was more suited for control and embedded applications.
4004:
• Data Bus Width: 4 bits.
• Address Bus Width: 12 bits (4 KB of addressable memory).
• Processing: The 4004 was Intel’s first microprocessor, designed for simple embedded applications and basic data
processing. It had very limited memory addressing and computing power compared to later processors.
8086:
• Data Bus Width: 16 bits.
• Address Bus Width: 20 bits (1 MB of addressable memory).
• Processing: The 8086 marked a major leap forward, with 16-bit processing, significantly higher memory capacity, and
better instruction sets for handling more complex tasks.
• Improvements: The 8086 introduced 16-bit processing and was suitable for general-purpose computing tasks, unlike the
4004, which was more suitable for control applications.
8. Suppose a 16-bit processor contain: 16 bit, data bus and 20-bit address bus. Calculate total memory space of that
processor. [16-bit]--- (8bit - 1 byte) (16 bit-2 byte).
Ans:
To calculate the total memory space of a processor, we need to use the address bus width to determine the amount
of memory the processor can access.
Given:
Step-by-step Calculation:
The address bus width determines the number of unique memory locations the processor can access.
• With a 20-bit address bus, the total number of unique memory locations is:
Number of Memory Locations=2Address Bus Width=220=1,048,576memory locations
• Since each memory location typically holds 1 byte of data (this is a common convention unless otherwise
specified), the total memory space the processor can access is:
Answer:
The processor with a 20-bit address bus can access a total of 1 MB of memory.
Since each 16-bit word is equivalent to 2 bytes, we need to adjust the calculation accordingly.
Given:
Step-by-step Calculation:
1. Number of Memory Locations: The number of unique memory locations that can be accessed is determined
by the address bus width:
2. Memory Size per Location: Since each location stores a 16-bit word (2 bytes), the total memory space is:
Final Answer:
The processor with a 20-bit address bus and 16-bit data bus (2 bytes per location) can access a total of 2 MB of memory.
9. what is opcode Microprocessor 8086.
Ans: In the 8086 microprocessor, an opcode (short for operation code) is the part of an instruction that specifies the
operation to be performed. The opcode tells the microprocessor what type of operation is to be executed, such as
addition, subtraction, data transfer, comparison, or logical operations.
1. Instruction Format: An instruction in 8086 consists of an opcode followed by operands (data or addresses), and
possibly some additional bytes for specific addressing modes or instruction extensions.
2. Size: The opcode size in the 8086 instruction set is typically 1 byte, but some instructions can have multi-byte
opcodes, depending on the operation and addressing mode.
4. Instruction Length: The length of an instruction in 8086 varies depending on the opcode and the operands. Some
instructions are 1 byte long, while others may be 2, 3, or 4 bytes long.
5. Example:
MOV: Data transfer ADD: Addition SUB: Subtraction MUL: Multiplication DIV: Division
INC: Increment DEC: Decrement AND: Bitwise AND OR: Bitwise OR XOR: Bitwise XOR
CMP: Compare JMP: Jump CALL: Call procedure RET: Return from procedure
Opcode Format: Each opcode is represented by a binary code that the microprocessor understands. For example:
a. MOV might be represented by the binary 1011. b. ADD might be represented by 0000.
These binary codes are part of the machine code that the 8086 microprocessor uses to perform operations. In summary, opcode
in the 8086 is the part of the instruction that specifies which operation the processor should perform, and there is a wide range of
opcodes for different types of operations
10. What are the instruction set of 8086 Microprocessor.
Ans: The 8086 microprocessor has a rich instruction set that allows it to perform a wide variety of operations, from data transfer
to arithmetic and logical operations, control flow, and string manipulation. The instructions are divided into different categories
based on the type of operation they perform. Here's a breakdown of the major instruction categories and some of the instructions
in each category:
These instructions are used to move data from one place to another (registers, memory, or I/O ports).
-MOV: Move data from source to destination. -PUSH: Push a value onto the stack.
-POP: Pop a value from the stack into a register or memory. -XCHG: Exchange values between two operands.
-IN: Read data from an I/O port. -OUT: Write data to an I/O port.
2. Arithmetic Instructions
-ADD: Add two operands. -SUB: Subtract the second operand from the first.
3. Logical Instructions
-XOR: Bitwise XOR of two operands. -NOT: Bitwise NOT (invert bits) of the operand.
-JNC: Jump if carry flag is not set. -JC: Jump if carry flag is set.
• CMP: Compare two operands (subtracts the second operand from the first but does not store the result).
• TEST: Perform a bitwise AND operation but does not store the result.
6. String Instructions
MOVS: Move string (byte or word). LODS: Load string (byte or word).
STOS: Store string (byte or word). CMPS: Compare string (byte or word).
-CLC: Clear the carry flag. -STC: Set the carry flag.
-CLI: Clear the interrupt flag. -STI: Set the interrupt flag.
11. Draw and explain the pins of the Pin Diagram of 8086 microprocessor?
Ans: The 8086 microprocessor has a 40-pin dual in-line package (DIP), with each pin serving a specific function for various
operations such as data transfer, memory access, control signals, and more. Below is a diagram followed by an explanation of the
function of each pin. 8086 Microprocessor Pin Diagram
+-------------------+
Pin Function
Vcc --| 1 40 |-- Vss
Vcc (Pin 1) Power supply (+5V)
A19/S6 --| 2 39 |-- A18/S5 Vss (Pin 40) Ground (0V)
A0 to A19 (Pins 2 to 21) Address bus (20-bit address)
A17 --| 3 38 |-- A16/S4 D0 to D15 (Pins 34 to 19) Data bus (16-bit data)
A15 --| 4 37 |-- A14/S3 BHE/S7 (Pin 12) Bus High Enable / Status 7
DEN (Pin 29) Data Enable
A13 --| 5 36 |-- A12/S2 RD (Pin 13) Read operation
WR (Pin 28) Write operation
A11 --| 6 35 |-- A10/S1
M/IO (Pin 27) Memory/I/O operation
A9 --| 7 34 |-- A8/S0 ALE (Pin 25) Address Latch Enable
INTA (Pin 14) Interrupt Acknowledge
A7 --| 8 33 |-- A6 NMI (Pin 15) Non-Maskable Interrupt
A5 --| 9 32 |-- A4 INT (Pin 16) Interrupt
INTR (Pin 21) Interrupt Request
A3 --| 10 31 |-- A2 RESET (Pin 19) Reset the processor
CLK (Pin 24) Clock signal input
A1 --| 11 30 |-- A0
CLKOUT (Pin 17) Clock output signal
BHE/S7 --| 12 29 |-- DEN READY (Pin 20) External device readiness signal
SID (Pin 23) Serial Data Input
RD --| 13 28 |-- WR
SOD (Pin 22) Serial Data Output
INTA --| 14 27 |-- M/IO 8086 Pin diagram. Explain every pin.
+-------------------+
The 8086 microprocessor has 40 pins that serve various functions related to power, memory addressing, data transfer, control, and
communication. Here's a brief summary:
-Vcc (Pin 1): Power supply (+5V). -Vss (Pin 40): Ground (0V).
-Pins 2 to 21: Used for specifying memory or I/O addresses. The 8086 has a 20-bit address bus, allowing access to 1MB of
memory.
-Pins 19 to 34: 16-bit data bus used for transferring data between the processor and memory or I/O devices.
-BHE/S7 (Pin 12): Indicates if the high or low byte of data is being transferred.
-RD (Pin 13): Read control (low means read operation).
-WR (Pin 28): Write control (low means write operation).
-M/IO (Pin 27): Indicates if the operation is to memory or I/O.
-ALE (Pin 25): Latches the address for external components.
-INTA (Pin 14): Interrupt Acknowledge.
These pins collectively manage memory access, data transfer, interrupt handling, and synchronization in the 8086 microprocessor.
Chapter 2:
The Execution Unit (EU) is responsible for carrying out the operations of the 8086 microprocessor. It fetches instructions from
memory, decodes them, and executes them. It works in coordination with the Bus Interface Unit (BIU). Here’s the primary role of
the EU:
• Fetch: The EU receives instructions from the memory via the BIU.
• Execute: Executes the decoded instruction by performing the necessary arithmetic or logical operations.
The EU is where the actual processing of data occurs (arithmetic operations, logical operations, etc.).
Flag Registers in the 8086 Microprocessor:
The Flag Register in the 8086 microprocessor is a 16-bit register used to store the status of the processor based on the outcome
of operations. It contains flags that are set or cleared depending on the result of the last executed instruction.
• Bit 15 (Sign Flag): Set if the result of the operation is negative (MSB is 1).
• Bit 14 (Zero Flag): Set if the result of the operation is zero.
• Bit 13 (Auxiliary Carry Flag): Set if there’s a carry from bit 3 to bit 4 in a binary operation (used for BCD operations).
• Bit 12 (Parity Flag): Set if the number of 1's in the result is even (parity).
• Bit 11 (Carry Flag): Set if there’s a carry out or borrow into the most significant bit during an operation (used in
arithmetic).
• Bit 10 (Overflow Flag): Set if there’s an overflow during a signed arithmetic operation.
Conditional Flags:
Conditional flags are used to indicate the status of the processor after executing certain instructions, which can then be used to
make decisions in control flow (like jumps, loops, etc.).
• Sign Flag (SF): Indicates the sign of the result of the last operation. If the result is negative, SF is set (1), and if positive, it’s
cleared (0). It's based on the most significant bit (MSB) of the result.
• Zero Flag (ZF): This flag is set if the result of the last operation is zero, meaning the operands were equal or the result was
zero.
• Auxiliary Carry Flag (AF): Used in BCD (Binary-Coded Decimal) operations to indicate a carry from bit 3 to bit 4.
• Parity Flag (PF): Set if the number of 1’s in the result of the last operation is even (even parity).
• Carry Flag (CF): Set if there was a carry out of the most significant bit during an addition operation or if a borrow occurred
during subtraction.
• Overflow Flag (OF): Set if there was an overflow in a signed operation, i.e., when the result is too large to be represented
in the given number of bits.
These flags are used in conditional branching and help in decision-making for branching operations (such as JZ, JNZ, JO, etc.),
influencing the flow of a program depending on the state of these flags.
A bit (short for binary digit) is the most basic unit of information in computing and digital communications. It can have one of two
possible values: 0 or 1, representing the two states of a binary system (off/on, false/true, etc.). Bits are the foundation of all data
storage and processing in a computer system.
• Data in a computer is represented as sequences of bits, and various operations are performed on these bits to carry out
computations.
These are Instruction Pointers used in different types of processors to point to the address of the next instruction to be executed.
IP (Instruction Pointer):
• Used in: 32-bit processors (like the 80386 and later x86 processors).
• Description: The EIP register is an extension of the IP register used in 32-bit processors. It holds the address of the next
instruction to be executed, but since it’s a 32-bit register, it can address a larger memory space than the IP register in the
16-bit processor.
• Physical Address Calculation: Like the 8086, the CS register holds the code segment, and the EIP register holds the offset.
The full address is calculated similarly, but with the extended address range (32 bits).
Ans: - Memory segmentation is a memory management scheme used in some microprocessors (such as the 8086) to divide the
computer's memory into different segments, each designed to store different types of data or instructions. This allows for more
organized and efficient use of memory, especially in systems with limited resources.
In the case of the 8086 microprocessor, memory segmentation is used to overcome the limitation of addressing only 64KB of
memory with a 16-bit address bus. By dividing memory into different segments, the processor can access up to 1MB of memory
(2^20 bytes) despite having a 16-bit address bus.
DATA S1
CODE
DATA DATA S2
STACK
STACK
EXTRA
Memory
4. what is offset Address?
Ans: Offset Address: An offset address refers to the position or the distance (in bytes) within a specific segment of memory. It is
used alongside a segment address to calculate the physical memory address in a segmented memory architecture.
In segmented memory systems like the 8086 microprocessor, memory is divided into segments, and each segment can have an
addressable range of 64 KB (16-bit address space). The offset is essentially the location within that segment where the processor
needs to access the data or instruction.
5. BIU Based math and theory? .Calculate the corresponding physical address for the, address bytes in CS, DS and SS?
Ans: The Bus Interface Unit (BIU) in the 8086 microprocessor is responsible for accessing memory and interfacing with the external
bus. The BIU takes care of segmenting the memory and addressing it. To calculate the corresponding physical address, the 8086
microprocessor combines segment addresses (CS, DS, SS) with offset addresses (IP, SP, D1), and the result is a physical address.
The physical address is calculated by shifting the segment address left by 4 bits (multiplying by 16) and then adding the offset.
Given Values:
Physical Address=(CS×16)+IP
CS=1111H,IP=1232H
CS×16=1111H×10H=11110H
Physical Address=11110H+1232H=12342H
2. Physical Address for DS and D1 (Data Segment + Offset): 3. Physical Address for SS and SP (Stack Segment + Stack
Pointer):
Physical Address=(DS×16)+D1 Physical Address=(SS×16)+SP
DS=3333H,D1=0020H SS=2526H,SP=1100H
DS×16=3333H×10H=33330H SS×16=2526H×10H=25260H
Physical Address=33330H+0020H=33350H Physical Address=25260H+1100H=26360H
Result: Physical Address for DS + D1 = 33350H Result: Physical Address for SS + SP = 26360H
6. Multipurpose Registers: [RAX, RBX, RCX]
Answer: RAX is a multipurpose register that can be referenced as a 64-bit register (RAX), 32-bit register (EAX), 16-bit register (AX),
or two 8-bit registers (AH and AL). The RAX register is used for arithmetic operations like multiplication and division and can hold
an offset address of a memory location in 64-bit processors like Pentium 4 and Core2. It is a special-purpose register but can be
used for general-purpose operations.
Answer: RBX is a multipurpose register and can be addressed as RBX, EBX, BX, BH, or BL. It often holds the offset address of a
memory location in the system. In 80386 and above, EBX can also hold memory data, and in 64-bit processors like Pentium 4 and
Core2, RBX can also address memory data.
Answer: RCX is a general-purpose register that can be addressed as RCX, ECX, CX, CH, or CL. It holds a count for various instructions,
especially in repeated string operations (REP/REPE/REPNE) and for shift, rotate, and loop instructions. In 64-bit mode, the RCX
register is used for loop counters and as an operand in other instructions. ECX and RCX are used to address memory data in 80386
and later versions of the processor.
-What is the purpose of the RDX register and how is it used in multiplication or division?
Answer: RDX is a general-purpose register that holds part of the result of a multiplication operation or part of the dividend in a
division operation. It is addressable as RDX, EDX, DX, DH, or DL, and in processors from the 80386 and above, RDX can also be used
to address memory data.
Answer: RBP, also addressed as EBP or BP, is the base pointer register used to point to a memory location for memory data transfers.
It helps in stack operations and function calls by holding the base address of the stack frame or data segment.
Answer: RDI is used as the destination index register in string operations. It can be addressed as RDI, EDI, or DI, and it points to the
destination string for instructions like string copy or move. It helps in managing memory addressing for string operations.
Answer: RSI, also referred to as ESI or SI, is used as the source index register in string operations. It points to the source string that
needs to be manipulated. As a general-purpose register, it is used in string instructions and also as a regular data register.
Special-purpose registers in the 8086 microprocessor are dedicated to specific tasks and have a unique role in the microprocessor's
functioning. Unlike general-purpose registers, which can store data or addresses for any use, special-purpose registers have fixed
roles for managing system operations, control flow, or status. Here are the Special Purpose Registers in the 8086 microprocessor:
1. Program Counter (PC)/Instruction Pointer (IP): The Program Counter (also known as Instruction Pointer in x86
architecture) keeps track of the address of the next instruction to be fetched for execution..
2. Stack Pointer (SP): The Stack Pointer register is used to manage the stack. It points to the top of the stack in memory.
3. Base Pointer (BP): The Base Pointer register is used to point to a specific location in the stack frame.
4. Flag Register: The Flag Register holds various individual flags that are set or cleared based on the outcome of arithmetic
and logical operations.
5. Code Segment (CS): The CS register holds the segment address of the currently executing program code.
6. Data Segment (DS): The DS register points to the segment containing the program's data.
7. Extra Segment (ES): The ES register points to an extra segment, typically used for string operations.
8. Stack Segment (SS): The SS register holds the segment address for the stack.
These special-purpose registers are critical for the internal functioning of the 8086 microprocessor, handling everything from code
execution to memory management and status tracking.
8. Flags in 8086 Microprocessor.
Answer: Flags are individual bits in a special register that indicate the status of the processor and control the operations of the
microprocessor. The 8086 microprocessor has a 16-bit flag register, which can be divided into status flags, control flags, and system
flags. These flags are used to store the results of arithmetic and logical operations, control the execution flow, and interact with
the external system.
1. Status Flags:
2. Control Flags:
Control flags control the processor's operation and are used to enable or disable certain operations.
• In the 8086 microprocessor, segmentation is used to organize memory into different segments, each of which has a base
address. The segment registers help in accessing specific segments of memory, enabling the processor to address a larger
memory space than the physical address bus would normally allow.
• The 8086 has four segment registers, each of which is 16 bits wide. These segment registers hold the base address of the
corresponding memory segment, and they are used to form a physical address in combination with an offset.
-Code Segment Register (CS) -Data Segment Register (DS) -Stack Segment Register (SS) -Extra Segment Register (ES)
To calculate a physical address in 8086, the base address stored in the segment register is multiplied by 16 (or shifted left by 4 bits)
and then added to the offset address.
Opcode: An Opcode (Operation Code) is the part of a machine language instruction that specifies the operation to be performed.
It tells the processor what action to take, such as addition, subtraction, data movement, or logical operations.
• Data Transfer Instructions (MOV, PUSH, POP, XCHG, LEA, IN, OUT)
• Arithmetic Instructions (ADD, SUB, MUL, DIV, INC, DEC)
• Logical Instructions (AND, OR, XOR, NOT, TEST)
• Control Transfer Instructions (JMP, CALL, RET, JNZ, JZ)
• String Instructions (LODS, STOS, MOVS, CMPS, SCAS)
The Opcode Fetch Cycle is the process where the BIU (Bus Interface Unit) fetches the opcode from memory and stores it in the
Instruction Queue for execution.
Steps:
Conclusion
• An Opcode is the part of an instruction that tells the processor what to do.
• 8086 Opcodes vary in size (1 to 6 bytes).
• The BIU fetches the opcode, and the EU executes it.
• Understanding opcodes is essential for assembly language programming
MATH
1. Performance of Microprocessor.
3. Segments.