Professional Documents
Culture Documents
L1 Pin Diagram
8086
8086 is a 16-bit microprocessor fabricated using HMOS technology. 8086 has 16-bit ALU; this means 16-bit numbers are directly processed by 8086.It is a 40 pin IC. It operates at 5Mhz.Its enhanced version 8086-2 permits clock frequency 8MHz, and 8086-1, can handle upto 10MHz It has 16-bit data bus, so it can read data or write data to memory or I/O ports either 16 bits or 8 bits at a time. It has 20 address lines, so it can address up to 2 20 i.e. 1048576 = 1Mbytes of memory . Due to the 1Mbytes memory size multiprogramming is made feasible and several multiprogramming features have been incorporated in 8086 design. 8086 includes few features, which enhance multiprocessing capability (it can be used with math coprocessors like 8087, I/O processor 8089 etc. Higher Throughput (Speed)(This is achieved by a concept called pipelining).
NMI is an edge triggered nonmaskable interrupt. NMI is not maskable internally by software. A transition from a LOW to HIGH initiates the interrupt at the end of the current instruction. CLK is for supplying the clock signal that synchronizes the activity within the CPU. READY is for inputting an acknowledge from a memory or I/O interface that input data will be put on the data bus or output data will be accepted from the data bus within the next clock cycle. RESET is for inputting a system reset signal. Most systems include a line that goes to all system components and a pulse is automatically sent over this line when the system is turned on ,or the reset pulse can be manually generated by a switch that allows the operator to reinitialize the system.
ADDRESS/STATUS(A19/S6-A16/S3): During the first part of a bus cycle pins 35-38 output the 4 higher-order bits of the address, and during the remaining part of the cycle they output status information. Status bits S3 and S4 indicate the segment register that is being used to generate the address and bit S5 reflects the contents of the IF flag.S6 is always held at 0 indicating that an 8086/8088 is controlling the system bus. Vcc +5v Pin definitions for the Minimum Mode. Pins 24 to 31 are mode dependent. In minimum mode these are defined as under: INTA Indicates recognition of an Interrupt request. Consists of two negative going pulses in two consecutive bus cycles. ALE Outputs a pulse at the beginning of the bus cycle and is to indicate an address is available on the address pins. DEN Output during the latter portion of the bus cycle and is to inform the transceivers that the CPU is ready to send or receive data.
QS1 QS0 Characteristics 0(LOW) 0 No Operation 0 1 First Byte of Opcode from Queue picked 1(HIGH) 0 Empty the Queue 1 1 Subsequent Byte from Queue S0,S1,S2 Indicates the type of transfer to take place during the current bus cycle: S2 S1 S0 0 0 0 Interrupt acknowledge 0 0 1 Read I/O port 0 1 0 write I/O port 0 1 1 Halt 1 0 0 Instruction fetch 1 0 1 Read memory 1 1 0 write memory 1 1 1 Inactive-passive
LOCK Indicates the bus is not to be relinquished to other potential bus masters. It is initiated by LOCK instruction prefix. RQ/GT1 For inputting bus requests and outputting bus grants. RQ/GT0 Same as RQ /GT1 except that a request on RQ/GT0 has higher priority.
L2 8086 Architecture
8086 Architecture
8086 Architecture
The 8086 CPU is organized as two separate units, called the Bus Interface Unit (BIU) and the Execution Unit (EU). Bus interface Unit The BIU facilitates communication between the EU and the memory or I/O circuits. It is responsible for transmitting address, data, and the control signals on the buses. It contains CS, DS, ES, SS and IP registers that hold the address of the memory locations. The IP contains the address of the next instruction to be executed by the EU. An internal bus connects the EU and BIU, and they work together. While the EU is executing an instruction the BIU fetches up to six bytes of next instruction and places it in the Instruction Queue to speed up the processor. Execution Unit The purpose of the execution unit is to execute the instruction. It contains a circuit called arithmetic and logic unit (ALU). The ALU can perform arithmetic and logical operations. The data for the arithmetic and logic operations are stored in circuits called registers.
8086 Architecture
Execution Unit(cntd) The EU has eight registers for storing data. They are AX, BX, CX, DX, SI, DI, BP and SP. In addition EU has temporary registers for holding operands for CPU, and the FLAG register whose individual bit reflect the result of a computation. Responsible for decoding and executing instruction. EU accesses the instruction from output end of the instruction queue and data from general-purpose register. During execution, EU may test the status and control flags and update these flags based on the results of execution.
Segment Registers(CONCEPT Of PHYSICAL ADDRESS) Data address may be formed by adding together a combination of BX or BP register contents, SI or DI register contents, and/or a displacement*The word displacement is used to indicate a quantity that is added to the contents of a register(s) to form an EA.]. The result of such an address computation is called an Effective address(EA) or offset. The final data address, however, is determined by EA and the appropriate Data segment, Extra segment or Stack segment registers. Segment group consists of ES,SS,DS,CS registers. The registers that used for addressing, the BX, IP, SP, BP, SI, and DI registers, are only 16bits wide and, therefore an effective address has only 16bits.On the other hand, the address put on the address bus, called the physical address, must contain 20 bits. The extra 4bits are obtained by adding the effective address to the contents of one of the segment registers.
Segment Registers (CONCEPT Of PHYSICAL ADDRESS) cntd The addition is carried out by appending four 0 bits to the right of the number in the segment register before the addition is made. For example if (CS)=123A and (IP)=341B,then the next instruction will be fetched from 341B Effective address 123A0 Beginning segment address -----------157BB Physical address of instruction The utilization of the segment registers essentially divides the memory space into overlapping segments, with each segment being 64k bytes long and beginning at an address that is divisible by 16. The contents of a segment register are referred to as segment address, and the segment address multiplied by 1610 as the beginning physical segment address.
2239F 223A0
. . . .
10010
10020
. . .
Program
first 16byte boundary after the end of the program code segment Another segment
. .
0F
DF
IF
TF
SF
ZF
AF
PF
CF
8085 Flags The 8086s PSW contains 16 bits ,but 7 of them are not used. Each bit in The PSW is called a flag. The 8086 flags are divided into : conditional flags which reflect the result of the previous operation involving the ALU, and the Control flags which control the execution of special functions. Conditionl flags : SF(Sign Flag)- Is equal to the MSB of the result. Since in 2s complement negative numbers have a 1 in the MSB and for nonnegative numbers this bit is 0,this flag indicates whether the previous result was negative or nonnegative. ZF (Zero Flag)-Is set to 1 if the result is zero and 0 if the result is nonzero.
0F
DF
IF
TF
SF
ZF
AF
PF
CF
8085 Flags PF(Parity Flag)- Is set to 1 if the low order 8 bits of the result contain an even number of 1s; otherwise it is cleared. CF(Carry Flag)- An addition causes this flag to be set if there is a carry out of the MSB, and a subtraction causes it to be set if a borrow is needed. AF(Auxiliary Carry Flag)- Is set if there is carry out of bit 3 during an addition or a borrow by bit 3 during a subtraction. This flag is used Exclusively for BCD arithmetic. OF(Overflow Flag)- Is set if an overflow occurs,i.e., a result is out of Range. For addition this flag is set when there is a carry into the MSB and no carry out of the MSB or vice versa.
0F
DF
IF
TF
SF
ZF
AF
PF
CF
8085 Flags OF(Overflow Flag)cntd- For subtraction it is set when the MSB needs a borrow and there is no borrow from the MSB, or vice versa. As an Example, if the previous instruction performed the addition, 0010 0011 0100 0101 + 0010 0010 0001 1001 ---------------------------------0100 0101 0101 1110 Result SF=0,ZF=0,PF=0,CF=0,AF=0,OF=0 If the previous instruction performed the addition, 0101 0100 0011 1001 + 0100 0101 0110 1010 --------------------------------1001 1001 1010 0011 Result SF=1,ZF=0,PF=1,CF=0,AF=1,OF=1
0F
DF
IF
TF
SF
ZF
AF
PF
CF
8085 Flags ControlFlags: DF (Direction Flag)-Used by string manipulation instructions .If clear, the string is processed from its beginning with the first element having the lowest address. Otherwise, the string is processed from the high address towards the low address. IF(Interrupt Enable Flag)-If set ,a certain type of interrupt(a maskable interrupt) can be recognized by the CPU; otherwise, these interrupts are ignored. TF(Trap Flag)- If set, a trap is executed after each instruction.
8086 Architecture Internal operations (Instruction Queue) The general operation of a computer consists of: 1.Fetching the next instruction from the address indicated by the PC. 2.Putting it in the instruction register and decoding it while the PC is incremented to point to the next instruction. 3.Executing the instruction and ,if a branch is to be taken, resetting the Pc to the branch address. 4.Repeating steps 1 through 3. In 8086 the address of the next instruction is determined by the sum of IP and (CS)X16 10 ,and the instruction register is a 6 byte first in / first Out (FIFO) queue (This queue gives 8086 a pipelined architecture) that is continually being filled whenever the system bus is not needed for other operation. This look ahead feature can significantly increase the CPUs throughput because much of the time the next instruction is already in the CPU when the present instruction completes its execution.