MP Insem Notes 2024
MP Insem Notes 2024
Or
Basically, it has 5 functional units which are as follows:
· Bus Interface Unit
· Code Fetch Unit
· Instruction Decode Unit
· Execution Unit
· Memory Management Unit
1. Bus Interface Unit
1. The bus interface unit or BIU holds a 32-bit bidirectional data bus as well as a 32-bit
address bus.
2. Whenever a need for instruction or a data fetch is generated by the system then the
BIU generates signals (according to the priority) for activating the data and address
bus in order to fetch the data from the desired address.
3. The BIU connects the peripheral devices through the memory unit and also controls
the interfacing of external buses with the coprocessors.
2. Code Prefetch Unit
1. This unit fetches the instructions stored in the memory by making use of system
buses.
2. Whenever the system generates a need for instruction then the code prefetch unit
fetches that instruction from the memory and stores it in a 16-byte prefetch queue.
3. To speed up the operation this unit fetches the instructions in advance and the
queue stores these instructions.
4. As this unit fetches one double word in a single access. So, in such a case, it is not
necessary that each time only a single instruction will be fetched, as the fetched
instruction can be parts of two different instructions.
3. Instruction Decode Unit
1. We know that instructions in the memory are stored in the form of bits.
2. This unit decodes the instructions stored in the prefetch queue.
3. Basically the decoder changes the machine language code into assembly language
and transfers it to the processor for further execution.
4. Execution Unit
1. The decoded instructions are stored in the decoded instruction queue. These
instructions are provided to the execution unit in order to execute the instructions.
2. The execution unit controls the execution of the decoded instructions.
3. This unit has a 32-bit ALU, that performs the operation over 32-bit data in one cycle.
Also, it consists of 8 general purpose as well as 8 special purpose registers.These are
used for data handling and calculation of offset addresses.
5. Memory Management Unit
This unit has two separate units within it. These are
· Segmentation Unit and
· Paging Unit
Segmentation unit:
1. Segmentation unit has the ability to convert the logical address into the linear
address at the time of executing an instruction.
2. The segmentation unit compares the effective address for the length limit
specified in the segment descriptor.
3. The segmentation unit adds the segment base and effective address to
generate a linear address.
4. It gives 4 level protection to the data or code present in the memory. Every
information in the memory is assigned a privilege level from PL0 to PL3.
Here, PL0 holds the highest priority and PL3 holds the lowest priority.
Paging Unit:
1. The paging unit changes the linear address into a physical address.
2. The paging unit supports multitasking. This is so because the physical
memory is not required to hold the whole segment of any task.
3. Despite this, only that part of the segment which is needed to be currently
executed must be stored in that memory whose physical address is calculated
by the paging unit.
4. This resultantly reduces the memory requirement and hence this frees the
memory for other tasks. Thus by this we get an effective way for managing
the memory to support multitasking.
Enlist Features of 80386 and explain any two ?
Ans:
1. As it is a 32-bit microprocessor. Thus has a 32-bit ALU.
2. 80386 has a 32-bit data bus.
3. It holds an address bus of 32 bits.
4. It supports physical memory addressability of 4 GB and virtual memory
addressability of 64 TB.
5. 80386 supports a variety of operating clock frequencies, which are 16 MHz, 20 MHz,
25 MHz, and 33 MHz.
6. It offers a 3 stage pipeline: fetch, decode and execute. As it supports simultaneous
fetching, decoding, and execution inside the system.
7. Integrated Memory Management Unit
8. Segmentation and Paging support
9. 4 Levels of Protection
10. Fully Compatible with 80286
Draw Register set/ Register Organization of 80386 and explain their function?
Ans:
General Purpose Registers:
1. The general registers of the 80386 are the 32-bit registers EAX, EBX, ECX, EDX, EBP,
ESP, ESI, and EDI. These registers are used interchangeably to contain the operands
of logical and arithmetic operations.
2. The low-order word of each of these eight registers has a separate name and can be
treated as a unit. This feature is useful for handling 16-bit data. The word registers
are named AX, BX, CX, DX, BP, SP, SI, and DI.
3. Each byte of the 16-bit registers further separate to handling characters and other
8-bit data items. The byte registers are named AH, BH, CH, and DH (high bytes); and
AL, BL, CL, and DL (low bytes).
Segment Registers
1. The segment registers CS, DS, SS, ES, FS, and GS are used to identify these six current
segments.
2. CS(code segment): The segment containing the currently executing sequence of
instructions is known as the current code segment
3. SS(Stack segment): All stack operations use the SS register to locate the stack.
Subroutine calls, parameters, and procedure activation records usually require that
a region of memory be allocated for a stack.
4. DS(Data segment): The DS, ES, FS, and GS registers allow the specification of four
data segments, each addressable by the currently executing program.
Flags Register:
1. The status flags of the EFLAGS register allow the results of one instruction to
influence later instructions.
2. The arithmetic instructions use OF, SF, ZF, AF, PF, and CF. The SCAS (Scan String),
CMPS (Compare String), and LOOP instructions use ZF to signal that their operations
are complete.
3. There are instructions to set, clear, and complement CF before execution of an
arithmetic instruction.
Instruction Pointer:
1. The instruction pointer register (EIP) contains the offset address, relative to the
start of the current code segment, of the next sequential instruction to be executed.
2. The instruction pointer is not directly visible to the programmer; it is controlled
implicitly by control-transfer instructions, interrupts, and exceptions.
Explain Data Types of 80386?
Ans:
Explain Register Addressing Mode and Base index addressing mode with example?
Ans:
Register Addressing mode: In register addressing the operand is placed in one of 8 bit or
16 bit general purpose registers. The data is in the register that is specified by the
instruction.
Here one register reference is required to access the data.
Based Indexed Addressing: The operand’s offset is the sum of the content of a base
register BX or BP and an index register SI or DI.
Example: ADD AX, [BX+SI]
1. BT: BT instruction stands for Bit Test, BT copies a bit from a given register to the
carry flag.
Example: BT EAX, 2
2. BTS: BTS (Bit Test and Set) BTS copies a bit from a given register to the carry flag,
but also sets the bit in the register,
3. BTR: BTR (Bit Test and Reset) BTR copies a bit from a given register to the carry flag
and resets it,
4. BTC: BTC (Bit Test and Complement) BTC copies a bit from a given register to the
carry flag and flips it.
Ans:
BSF searches the bits of the source operand (usually a register or memory location) from
the least significant bit (LSB) towards the most significant bit (MSB) for the first set bit (i.e.,
a bit with a value of 1).
Once it finds the first set bit, it stores the position of that bit (the bit number) into the
destination register.
Draw and Explain Read or Write Cycle with pipelined address timing
Ans:
● The cycle 1 and cycle 2 in the diagram show non pipelined write and read cycles and
cycle 3 and cycle 4 in the diagram show pipelined write and read cycles,
● This diagram also shows how wait state can be avoided using pipelined bus cycles.
● In the pipelined bus cycle the address for the next bus cycle is sent during the T2 -
state of the current cycle. In 80386DX, NA (next address) signal initiates address
pipelining. The 80386DX samples NA signal at the beginning of phase 2 of any T
state in which ADS is not active, specifically.
A31-A2 (Address Bus) Address lines A31-A2 are used as the upper 30 bits of the 32-bit
address bus. These lines can address any memory locations of 1 GB x 32 memory in the
80386 memory system. A1-A0 A1 and A0 are encoded to generate BE3, BE2, BE1 and BE0.
D31-D0 (Data Bus) The data bus D31-D0 are used to transfer data between the
microprocessor and memory and input/output devices.
BE3–BE0 (Bank Enable Signals) The memory system of 80386 can be observed as a
4-byte wide memory access mechanism. The four byte enable signals arc BE3, BE2, BE1 and
BE0. These signals are used to enable four banks. These signals are generated by the
microprocessor from address bits A1 and A0 and used to access 1 byte, 2 bytes or word and
4bytes or double word of data simultaneously.
Bus control signals
BS16 Bus size of 16 bits BS16 indicates the interfacing of 16-bit devices with the 32-bit
wide 80386 data bus.
N̅A̅ The N̅A̅ represents the Next Address input signal. When this signal is active low, it
allows address pipelining in the 80386 bus cycles.
R̅E̅A̅D̅Y̅ The R̅E̅A̅D̅Y̅ signal indicates that the previous bus cycle has been completed and
the bus is ready for the next bus cycle. This signal controls the number of WAIT states
inserted into the bus cycle. Usually, this signal is used for interfacing slow I/O devices with
CPU.
Coprocessor interface
P̅E̅R̅E̅Q̅ The Processor Extension Request (PEREQ) indicates that the 80387 arithmetic
coprocessor has data to transfer to the processor.
B̅U̅S̅Y̅ The BUSY input signal indicates that the math coprocessor is busy.
E̅R̅R̅O̅R̅ The Error input signal indicates that the math coprocessor has an error condition.
Interrupt interface
INTR The Interrupt Request (INTR) pin is used as a maskable interrupt input. This pin will
be masked using the IF of the flag register.
NMI The Non-maskable Interrupt (NMI) signal requests a nonmaskable interrupt just like
the 8086 microprocessor.
RESET When RESET pin is high, the processor suspends the current operation and
becomes reset. Therefore, the processor restarts the execution from the starting memory
location FFFFFFF0H
DMA Interface
HOLD The Hold request signal allows another bus master to request control of the local
bus. This signal is commonly used in DMA operation just like it did on the 8086
microprocessor.
HLDA The Hold Acknowledgement (HLDA) indicates that the 80386 processor has
surrendered control of its local bus to another bus master.