




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































(Autonomous Institution ā UGC, Govt. of India) Recognized under 2(f) and 12 (B) of UGC ACT 1956 (Affiliated to JNTUH, Hyderabad, Approved by AICTE - Accredited by NBA & NAAC ā āAā Grade - ISO 9001:2015 Certified) Maisammaguda, Dhulapally (Post Via. Kompally), Secunderabad ā 500100, Telangana State, India
III Year B.Tech EEE-II SEM Prepared by M.RAMANJANEYULU, Associate Professor Mr. KDK AJAY, Assistant Professor Dr.S.SASIKANTH, Professor
MALLA REDDY COLLEGE OF ENGINEERING AND TECHNOLOGY III Year B.Tech EEE-II SEM L T/P/D C 3 - / - /- 3 (R18A0415) MICROPROCESSORS AND MICROCONTROLLERS COURSE OBJECTIVES:
ļ Architecture of 8086 ļ Register Organization ļ Programming Model ļ Memory addresses ļ Memory Segmentation ļ Physical Memory Organization ļ Signal descriptions of 8086- Common Function Signals ļ Minimum and Maximum mode signals ļ Timing diagrams
8086 Architecture
A microprocessor is a computer processor which incorporates the functions of a computer's central processing unit (CPU) on a single integrated circuit (IC), or at most a few integrated circuits The microprocessor is a multipurpose, clock driven, register based, digital-integrated circuit which accepts binary data as input, processes it according to instructions stored in its memory, and provides results as output. Microprocessors contain both combinational logic and sequential digital logic. Microprocessors operate on numbers and symbols represented in the binary numeral system. Generation of Microprocessors: ļ INTEL 4004 ( 1971) ļ 4 - bit microprocessor ļ 4 KB main memory ļ 45 instructions ļ PMOS technology ļ was first programmable device which was used in calculators ļ INTEL 8008 (1972) ļ 8 - bit version of 4004 ļ 16 KB main memory ļ 48 instructions ļ PMOS technology ļ Slow ļ Intel 8080 (1973) ļ· 8 - bit microprocessor ļ 64 KB main memory ļ 2 microseconds clock cycle time ļ 500,000 instructions/sec ļ 10X faster than 8008 ļ NMOS technology ļ Drawback was that it needed three power supplies.
General Architecture of Microprocessors
Register Organization of 8086 8086 has a powerful set of registers containing general purpose and special purpose registers. All the registers of 8086 are 16-bit registers. The general purpose registers, can be used either 8-bit registers or 16-bit registers. The general purpose registers are either used for holding the data, variables and intermediate results temporarily or for other purpose like counter or for storing offset address for some particular addressing modes etc. The special purpose registers are used as segment registers, pointers, index registers or as offset storage registers for particular addressing modes. Fig 1.4 shows register organization of 8086. We will categorize the register set into four groups as follows: General data Registers: The registers AX, BX, CX, and DX are the general 16-bit registers. AX Register: Accumulator register consists of two 8-bit registers AL and AH, which can be combined together and used as a 16- bit register AX. AL in this case contains the low-order byte of the word, and AH contains the high- order byte. Accumulator can be used for I/O operations, rotate and string manipulation. BX Register: This register is mainly used as a base register. It holds the starting base location of a memory region within a data segment. It is used as offset storage for forming physical address in case of certain addressing mode. CX Register: It is used as default counter or count register in case of string and loop instructions.
The pointers contain within the particular segments. The pointers IP, BP, SP usually contain offsets within the code, data and stack segments respectively Stack Pointer (SP) is a 16-bit register pointing to program stack in stack segment. Base Pointer (BP) is a 16-bit register pointing to data in stack segment. BP register is usually used for based, based indexed or register indirect addressing. Source Index (SI) is a 16-bit register. SI is used for indexed, based indexed and register indirect addressing, as well as a source data addresses in string manipulation instructions. Destination Index (DI) is a 16-bit register. DI is used for indexed, based indexed and register indirect addressing, as well as a destination data address in string manipulation instructions.
Flags Register determines the current state of the processor. They are modified automatically by CPU after mathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control to other parts of the program. The 8086 flag register as shown in the fig 1.6. 8086 has 9 active flags and they are divided into two categories:
The 8086 is mainly divided into mainly two blocks
ļ A decoder in the EU translates instructions fetched from memory Into series of actions which the EU carries out Arithmetic Logic Unit: 16 bit ALU Used to carry the operations ļ ADD ļ SUBTRACT ļ XOR ļ INCREMENT ļ DECREMENT ļ COMPLEMENT ļ SHIFT BINARY NUMBERS FLAG REGISTERS: ļ A flag is a flip flop that indicates some condition produced by execution of an instruction or controls certain operation of the EU. ļ It is 16 bit ļ It has nine active flags Divided into two types
CX Register: It is used as default counter or count register in case of string and loop instructions. DX Register: Data register can be used as a port number in I/O operations and implicit operand or destination in case of few instructions. In integer 32 - bit multiply and divide instruction the DX register contains high-order word of the initial or resulting number. 2) BUS INTERFACE UNIT (BIU) The BIU sends out ļ Addresses ļ Fetches instructions from memory ļ Read data from ports and memory Or The BIU handles all transfer of data and addresses on the buses for the Execution Unit The Bus interface unit contains
Stack: is a section of memory set aside to store addresses and data while subprogram executes is often called segment base. The stack segment register always holds the upper 16 bit starting address of program stack. The extra segment register and data segment register is used to hold the upper 16 bit starting addresses of two memory segments that are used for data. Instruction Pointer holds the 16 bit address or offset of the next code byte within the code segment. The value contained in the Instruction Pointer called as Offset because the value must be added to the segment base address in CS to produce the required 20 bit address. CS register contains the Upper 16 bit of the starting address of the code segment in the 1 Mbyte address range the instruction pointer contains a 16 bit offset which tells wherein that 64 Kbyte code segment the next instruction byte has to be fetched from. Stack Register and Stack Pointer: Stack: is a section of memory set aside to store addresses and data while subprogram executes is often called segment base. The stack segment register always holds the upper 16 bit starting address of program stack. The Stack pointer (SP) holds the 16 bit offset from the starting of the segment to the memory location where a word was most recently stored .The memory location where the word is stored is called as top of the stack
The point to note is that the beginning segment address must begin at an address divisible by 16.Also note that the four segments need not be defined separately. It is allowable for all four segments to completely overlap (CS = DS = ES = SS). Logical and Physical Address Addresses within a segment can range from address 00000h to address 0FFFFh. This corresponds to the 64K-bytelength of the segment. An address within a segment is called an offset or logical address. A logical address gives the displacement from the base address of the segment to the desired location within it, as opposed to its "real" address, which maps directly anywhere into the 1 MByte memory space. This "real" address is called the physical address. What is the difference between the physical and the logical address? The physical address is 20 bits long and corresponds to the actual binary code output by the BIU on the address bus lines. The logical address is an offset from location 0 of a given segment.
You should also be careful when writing addresses on paper to do so clearly. To specify the logical address XXXX in the stack segment, use the convention SS:XXXX, which is equal to [SS] * 16 + XXXX. Logical address is in the form of: Base Address: Offset Offset is the displacement of the memory location from the starting location of the segment. To calculate the physical address of the memory, BIU uses the following formula: