•The 8086 CPU is divided into two independent functional parts, the bus interface unit (BIU), and the execution unit (EU).
•The Bus Interface Unit
•The BIU handles all addresses and data on the buses for the execution unit. It sends (places) addresses, fetches instructions from memory, reads/writes data from/to memory or IO.
•BIU consist of Instruction queue, Segment registers, Instruction pointer, Address adder.
Instruction Queue
•To increase the execution speed, BIU fetches six instruction bytes ahead to time from memory. The pre fetched instruction bytes are held for the EU in a First In First Out (FIFO) register called a instruction queue. When the EU is ready for its next instruction, it simply reads the instruction from this instruction queue. This is much faster than fetching and executing instruction directly from memory. Fetching the next instruction while the current instruction executes is called pipelining.
Segment Registers
•The BIU contains four 16-bit segment registers. They are:
• Code Segment (CS) register, Stack Segment (SS) register, Data Segment (DS) registers & Extra Segment (ES) register.
•These segment registers are used to hold the upper 16 bits of the starting address for each of the segments. The part of a segment starting address stored in a segment register is called the segment base.
•Code Segment (CS): The CS register is used for addressing a memory location in the Code Segment of the memory, where the executable program is stored.
•Stack Segment (SS): SS defined a section of memory to store addresses and data while a subprogram executes.
•Data Segment (DS): The DS contains most data used by program. Data are accessed in the Data Segment by an offset address or the content of other register that holds the offset address.
•Extra Segment (ES): ES is additional data segment that is used by some of the string to hold the extra destination data.
Instruction Pointer (IP)
•The instruction pointer (IP) holds the 16-bit address of the next instruction to be executed.
The Execution Unit
•The EU reads instruction from IQ , decodes & executes it.
•EU consist of control system, instruction decoder, ALU, registers & flag.
•Control system performs various internal operations.
•A decoder decodes instructions & generate different internal or external control signals that required performing the operation.
•ALU performs arithmetic operations such as +, -, x & / and logical operations such as AND, OR, XOR, increment, decrement etc.