MP Toppers Solution
MP Toppers Solution
MP Toppers Solution
Topper’s Solutions
…..In search of Another Topper
There are many existing paper solution available in market, but Topper’s Solution is the one which
students will always prefer if they refer… ;) Topper’s Solution is not just paper solution, it includes
many other important questions which are important from examination point of view. Topper’s
Solutions are the solution written by the Toppers for the students to be the upcoming Topper of the
Semester.
It has been said that “Action Speaks Louder than Words” So Topper’s Solution works on same
principle. Diagrammatic representation of answer is considered to be easy & quicker to understand. So
our major focus is on diagrams & representation how answers should be answered in examinations.
**** Education is Free…. But its Technology used & Efforts utilized which charges ****
It takes lot of efforts for searching out each & every question and transforming it into Short & Simple Language.
Entire Topper’s Solutions Team is working out for betterment of students, do help us.
“Say No to Xerox…. “
With Regards,
Microprocessor (MP)
Chapters Syllabus Page
No.
3. System 3.1 Memory Interfacing: SRAM, ROM and DRAM (using DRAM 39
Designing Controller Intel 8203).
with 8086 3.2 Applications of the Peripheral Controllers namely 8255PPI,
8253PIT, 8259PIC and 8237DMAC. Interfacing of the above
Peripheral Controllers with 8086 microprocessor.
3.3 Introduction to 8087 Math Coprocessor and 8089 I/O Processor.
5. Pentium 5.1 Block Diagram, Superscalar Operation, Integer & Floating Point 72
Processor Pipeline Stages, Branch Prediction, Cache Organization.
5.2 Comparison of Pentium 2, Pentium 3 and Pentium 4 Processors.
Comparative study of Multi core Processors i3, i5 and i7.
***Marks Distribution***
Chapter Chapter Name Dec MAY DEC May
No. 2014 2015 2015 2016
5. Pentium Processor 20 25 35 28
6. SuperSPARC Architecture 10 10 15 22
- Repeated Questions - 45 55 83
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
1. Programming Model of 8086 is similar to the picture of the processor as available to the
programmer.
2. This registers are used to hold number & addresses.
3. It is also used to indicate status and acts as controls.
4. Figure 1.1 shows the 8086 Programming Model.
Segment Registers:
It is a 16-bit register containing address of 64KB segment, usually with program data.
ES register can be changed directly using POP and LES instructions.
Page 5 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
It is a 16-bit register.
It is used to point the instructions.
I) Accumulator Register:
It consists of two 8-bit registers AL and AH, which can be combined together and used as a 16-bit
register AX.
Accumulator can be used for I/O operations and string manipulation.
It consists of two 8-bit registers BL and BH, which can be combined together and used as a 16-bit
register BX.
BX register usually contains a data pointer used for based, based indexed or register indirect
addressing.
It consists of two 8-bit registers CL and CH, which can be combined together and used as a 16-bit
register CX.
Count register can be used in Loop, shift/rotate instructions and as a counter in string manipulation.
It consists of two 8-bit registers DL and DH, which can be combined together and used as a 16-bit
register DX.
Data register can be used as a port number in I/O operations.
It is a 16-bit register.
SI is used for indexed, based indexed and register indirect addressing, as well as a source data
address in string manipulation instructions.
It 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.
Page 6 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Flags:
Ans: [Q2 | 5m – may15] & [Q3 | 5M – dec14 & DEC15] & [Q4 | 8m – may16]
Segment Registers:
Page 7 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Disadvantages:
It becomes complicated for the programmer as multiple register to access a memory location.
Maximum mode:
1. In the maximum mode, the 8086 is operated by strapping the MN/MX pin to ground.
2. In this mode, the processor derives the status signal S2, S1, S0.
3. In the maximum mode, there may be more than one microprocessor in the system configuration.
Page 8 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
4. The components in the system are same as in the minimum mode system.
5. The basic function of the bus controller chip IC 8288 is to derive control signals like READ and
WRITE (For memory and I/O devices), DEN, DT/R, ALE etc.
6. The bus controller chip has input lines S2, S1, S0 and CLK.
7. These inputs to 8288 are driven by CPU.
8. It derives the outputs ALE, DEN, DT/R, MRDC, MWTC, AMWC, IORC, IOWC and AIOWC.
9. The AEN, IOB and CEN pins are especially useful for multiprocessor systems.
10. AEN and IOB are generally grounded. CEN pin is usually tied to +5V.
11. The significance of the MCE/PDEN output depends upon the status of the IOB pin.
12. If IOB is grounded, it acts as master cascade enable to control cascaded 8259A; else it acts as
peripheral data.
13. INTA pin used to issue two interrupt acknowledge pulses to the interrupt controller or to an
interrupting device.
14. IORC, IOWC are I/O read command and I/O write command signals respectively.
15. These signals enable an IO interface to read or write the data from or to the address port.
16. The MRDC, MWTC are memory read command and memory write command signals respectively
and may be used as memory read or write signals.
17. All these command signals instructs the memory to accept or send data from or to the bus.
18. Figure 1.4 shows the Maximum Mode Block Diagram of 8086.
Block Diagram:
Page 9 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Q6) Draw and explain timing diagram for read operation in minimum mode of 8086
Timing diagram:
1. In a minimum mode 8086 system, the microprocessor 8086 is operated in minimum mode by
strapping its MN/MX* pin to logic1.
2. In this mode, all the control signals are given out by the microprocessor chip itself.
3. Figure 1.5 shows the timing diagram for Read Machine Cycle of 8086.
1. The 8086 will make M/IO = 1 if the read is from memory and M/IO = 0 if the read id from the I/O
device.
2. Then ALE output is asserted to 1 i.e. it is made high.
3. Make BHE low/high and send out the desired address of memory location to be read on AD0 to AD15
and A16 to A19 address lines.
4. After sometime pull down ALE (make it 0) i.e. it is made inactive. The address then gets latched into
external latch.
5. 8086 removes the address from AD0 to AD15 lines so that they can be used to read the data from
memory and put them in the input mode (float them).
6. Assert the RD (read) signal low. This will put the data from the addressed memory location or I/O
port on to the data bus.
7. Insert the “wait” T-states if the 8086 READY input is made low before or during the T 2 state of a
machine cycle.
8. As soon as READY input goes high, 8086 comes out of the wait T-states and completes the machine
cycle.
9. Complete the “Read” cycle by making the RD line high (inactive).
10. For larger systems we need to use the data buffers. Then the DT/R and DEN signals of 8086 are
connected and enabled at the appropriate time.
Page 10 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Q7) Draw and explain timing diagram for write operation in minimum mode of 8086
Timing diagram:
1. In a minimum mode 8086 system, the microprocessor 8086 is operated in minimum mode by
strapping its MN/MX* pin to logic1.
2. In this mode, all the control signals are given out by the microprocessor chip itself.
3. Figure 1.6 shows the timing diagram for Write Machine Cycle of 8086.
1. During T1 state, the 8086 will make M/IO = 0 if it has to write to an I/O port and M/IO = 1 if the
memory location is to be written.
2. Then ALE output is asserted to 1 i.e. it is made high. This will enable the address latches.
3. 8086 then outputs the BHE and the address of the desired port or memory location on the lines AD0
to AD15 and A16 to A19. Note that the address lines A16 to A19 = 0 if the port is to be written.
4. After sometime ALE output is pulled down. The address gets latched into external latches.
5. The 8086 removes the address information from AD0 to AD15 and outputs the desired data on the
data bus.
6. It then asserts the WR signal low. The low WR signal will turn on the memory or port where the
data is to be written.
7. 8086 then gives sometime for the addressed I/O port or memory to accept the data from the data
bus and then raise the WR output high and floats the data bus.
8. If the addressed memory or port devices cannot accept the data within the normal machine cycle,
then the external hardware can be setup to produce a low READY input.
9. If the READY input is pulsed low before or during the T-state T2 of the write machine cycle, then
8086 will introduce WAIT T-states after T3 as long as the READY input is held low.
10. During the WAIT T-states, the signals on the data bus, address bus and control bus do not change.
11. If the READY input is made high before the end of a wait T-state, then 8086 will continue with the
T4 state as soon as it finishes the WAIT T-state.
12. If the system is large enough then it will need the external data buffers. Then the DT/R is used to
decide the direction of data transfer.
Page 11 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
13. During the write cycle, the 8086 pushes the DT/R high to configure the external data buffers in the
“transmit” mode. Then the DEN signal is asserted low so as to enable the buffers.
14. The data output from 8086 is then passed through the data buffers to the addressed memory or
I/O port.
Block Diagram:
1. Block Diagram of 8288 Bus Controller includes Status Decoder, Control Logic, Command Signal
Generator and Control Signal Generator.
2. 8288 Bus Controller accepts the CLK signal along with S0, S1 & S2 outputs of 8086 and generates
command, control & timing signals at its output.
Page 12 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
1. Out of the 9 Active Flags, 6 are conditional (status) flags and the remaining 3 are called as control
flags.
2. Control flags are used to control certain operations of the processors.
3. Figure 1.8 shows the 8086 flag register format.
Control Flags
U U U U OF DF IF TF SF ZF U AF U PF U CF
Setting TF puts the processor into single step mode for debugging.
In single stepping, microprocessor executes an instruction and enters into single step ISR.
After that the user can check register.
This utility is, to debug the program.
If TP = 1, the CPU automatically generates an internal interrupt after each instruction, allowing a
program to be inspected as it executes instruction by instruction.
This flag is used by debuggers for single step operations.
TF = 1 then Trap On, TF = 0 then Trap Off.
If user sets IF flag, the CPU will recognize external interrupt requests.
Clearing IF disables these interrupts.
IF Flag has no effect on either non-maskable external or internally generated interrupt.
The IF Flag is used for allowing or prohibiting the interruption of a program.
IF = 1 then Interrupt Enabled, IF = 0 then Interrupt Disabled.
Page 13 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Ans:
Before Execution:
MSB of flag register = OC H LCB of flag register = C6 H
AH AL U U U U OF DF IF TF SF ZF U AF U PF U CF
A0 03 0 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0
After Execution:
MSB of flag register = OC H Contents of LSB of flag register = C6
H are copied to AH register
AH AL U U U U OF DF IF TF SF ZF U AF U PF U CF
C6 03 0 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0
STOSB:
ES: [DI] = AL
IF DF = 0 then DI = DI + 1
Else DI = DI – 1
Page 14 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Table 1.1: Comparison between minimum mode & maximum mode in 8086.
Operating Mode The microprocessor system operates If MN/MX pin is grounded, the system
in the minimum mode by default on operates in maximum mode.
power on.
CPU When only one CPU is to be used in a Maximum mode uses Multiple CPUs
microcomputer system it is used in to operate.
minimum mode operation.
Control Signals CPU issues the control signals that In Maximum mode the control signals
are required by the memory and I/O are issued by the Intel 8288 bus
devices. controller.
Pins Used M/IO, INTA, ALE, HOLD, HLDA, DT/R, S2, S1, S0, LOCK, QS1, QS0, RQ0 / GT0,
DEN, WR RQ1 / GT1
Memory & I/O Memory & I/O Control Signals are Control Signals are generated by
Control Signals generated by the microprocessor External Bus Controller like 8288.
itself.
Q12) Design 8086 based minimum mode system for following requirement:
Step-1:
Page 15 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Set-1:
Set-2:
Ending address = Previous Starting Address – 1
= E0000 H – 1
= DFFFF H
Set size = 1FFFF H
Starting address = DFFFF H – 1FFFF H
= C0000 H
Step-2:
Page 16 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
RAM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B 00000
T EA = 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- 1FFFE
1 O SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B 00001
EA = 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1FFFF
ROM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B E0000
T EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- FFFFE
1 O SA = 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B E0001
EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FFFFF
S E SA = 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B C0000
T EA = 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- DFFFE
2 O SA = 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B C0001
EA = 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
DFFFF
A8 A7 A6 A5 A4 A3 A2 A1 A0
8255 PA = 00 H 0 0 0 0 0 0 0 0 0
Even Bank PB = 02 H 0 0 0 0 0 0 0 1 0
A7 PC = 04 H 0 0 0 0 0 0 1 0 0
CW = 06 H 0 0 0 0 0 0 1 1 0
Page 17 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
A8 A7 A6 A5 A4 A3 A2 A1 A0
8255 PA = 01 H 0 0 0 0 0 0 0 0 1
Odd Bank PB = 03 H 0 0 0 0 0 0 0 1 1
A7 PC = 05 H 0 0 0 0 0 0 1 0 1
CW = 07 H 0 0 0 0 0 0 1 1 1
For 8 Interrupts we need two 8259, one as a master & other as a slave.
A8 A7 A6 A5 A4 A3 A2 A1 A0
8259 Address 1 = C0 H 1 1 0 0 0 0 0 0 0
Even Bank Address 2 = C2 H 1 1 0 0 0 0 0 1 0
A7 Address 1 = C1 H 1 1 0 0 0 0 0 0 1
Odd Bank Address 2 = C3 H 1 1 0 0 0 0 0 1 1
Step-1:
Page 18 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Set-2:
Set-2:
RAM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B 00000
T EA = 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
- 01FFE
1 O SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B 00001
EA = 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1
01FFF
S E SA = 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
E B 02000
T EA = 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- 03FFE
2 O SA = 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1
B 02001
EA = 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
03FFF
ROM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
E B FC000
T EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- FFFFE
1 O SA = 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1
B FC001
EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FFFFF
S E SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B F8000
T EA = 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- FBFFE
2 O SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B F8001
EA = 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FBFFF
Page 20 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Step-1:
Step-2:
Page 21 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
RAM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B 00000
T EA = 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- 0FFFE
1 O SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B 00001
EA = 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0FFFF
ROM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B F8000
T EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
- FFFFE
1 O SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B F8001
EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FFFFF
Step-1:
Page 22 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Set-1:
Step-2:
Page 23 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
RAM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B 00000
T
- EA = 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 03FFE
O SA = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B 00001
EA = 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
03FFF
ROM:
A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
S E SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
E B F8000
T
- EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 FFFFE
O SA = 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
B F8001
EA = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FFFFF
Ans:
Page 24 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Ans:
BLOCK DIAGRAM:
I) Registers:
Page 25 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Timing & Control Unit controls all internal and external circuits.
It operates with the reference to clock signal.
It accepts information from instruction decoder & generates micro steps to perform it.
This unit synchronizes all the data transfers.
Ans:
Features:
Block Diagram:
Page 26 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
The 8086 CPU is divided into two independent functional units: Bus Interface Unit (BIU) & Execution Unit
(EU)
ALU:
Flag Register:
EU has 8 general purpose registers named as AL, AH, BL, BH, CL, CH, DL & DH.
These registers can be used as 8-bit registers individually or can be used as 16-bit in pair to have
AX, BX, CX, and DX.
AX Register: AX register is also known as accumulator register that stores operands for arithmetic
operation like divided, rotate.
BX Register: This register is mainly used as a base register.
CX Register: It is defined as a counter. It is primarily used in loop instruction to store loop counter.
DX Register: DX register is used to contain I/O port address for I/O instruction.
Control Circuit:
It is used to control all the operations & flow of data in the microprocessor.
The EU contains the control circuit to perform various internal operations.
Instruction decoder:
Page 27 of 98
Intel 8086/8088 Architecture Semester – 5 Topper’s Solutions
Instruction Queue:
Segment Registers:
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.
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.
Stack Segment (SS): SS defined the area of memory used for the stack.
Extra Segment (ES): ES is additional data segment that is used by some of the string to hold the
destination data.
Instruction Pointer:
Page 28 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
Types:
Q2) Write assembly language program for 8086 to exchange contents of two
memory blocks.
Assembly language:
1. Let consider the Memory Locations as: 01000 H (First Memory Block) & 02000 H (Second
Memory Block)
2. Let the block size which is to be exchange between two memory blocks be 1 KB i.e. 1024 byte.
3. The source block is at address 01000 H and destination block is at address 02000 H.
4. We will first copy 1 KB block starting at location 01000 H to another place at 03000 H onwards.
5. Then the block from 02000 H onwards is transferred to the first block i.e. starting block 01000 H.
6. Finally the block copied in location 03000 H onwards is transferred to the location 02000 H
onwards.
Page 30 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
Instruction Comments
MOV DS, AX
MOV ES, AX
CLD
REP MOVSB
REP MOVSB
REP MOVSB
Therefore the content of blocks is exchange between 01000 H (First Memory Block) & 02000 H (Second
Memory Block) using above 8086 Assembly Program.
Assembly language:
Page 31 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
Flow chart:
Figure 2.2 shows the flow chart to reverse a string using 8086 assembly language program.
Instruction Comments
MOV [SI], AL
DEC CL
JNZ REVERSE
HLT
Page 32 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
I) Method 1:
In method 1 there is a Built-In-Inline assembler used to include assembly language routines in the
C-program, without any need for a specific assembler.
Such assembly language routines are called as In-Line Assembly.
They are compiled along with C-routine & linked together using linked modules provided by the C
Compiler.
Example: Turbo C has inline Assembly.
Table 2.1 shows the Mixed Language Programming Code Example for Method – 1.
Table 2.1: Mixed Language Programing Code.
#include<iostream.h>
void main()
{
int a, b, c;
cout << “Enter Two Numbers”;
cin >> a >> b;
asm mov ax, a;
asm mov bx, b;
asm add ax, bx;
asm mov c, ax;
cout << “The Sum is” << c;
II) Method 2:
There are times when programs written in one language have to call modules written in other
language.
Instead of compiling all source programs using the same compiler, different compilers or
assemblers are used as per the language used in the program.
Page 33 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
Figure 2.3: Compile, Assemble & Link processes in Mixed Language Programming.
Types:
Page 34 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
In Register & Immediate Addressing Mode, Execution Unit (EU) has direct access to Register &
Immediate data.
In Memory Addressing Mode, memory operands must be transferred to/from the CPU over the BUS.
Whenever EU needs to read or write a memory operand, it must pass an offset value to the BIU.
Page 35 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
The BIU adds offset to the shifted contents of segment register, which produces 20 bit physical
address.
After that it executes the bus cycle needed to access the operand.
The offset for a memory operand is called the operand’s Effective Address.
Types:
Page 36 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
Page 37 of 98
Instruction Set & Programming Semester – 5 Topper’s Solutions
String Addressing Mode does not use normal Memory Addressing Mode to access their operands.
When a string instruction is executed, SI is assumed to point to the first byte or word of the source
string and by default DS is assumed as Segment Register.
DI will point to the first byte or word of the destination string and by default ES is assumed as
Segment Register.
In repeated string operation, the CPU automatically adjust the SI & DI to obtain subsequent bytes
or word.
This automatic adjustment is done with the help of Direct Flag (DF) in flag register.
The instructions which do not have operands are considered as Implied Addressing Mode.
For Example: STC (Sets the Carry Flag), CLD (Clears the Direction Flag), STD (sets the Direction
Flag) etc.
Page 38 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
1. For the application where we require multiple interrupt sources, we need to use an external device
called as Programmable Interrupt Control (PIC).
2. By connecting a PIC to the microprocessor we can increase the interrupt handling capacity of the
microprocessor.
3. 8259 is commonly used PIC.
1. PIC 8259 is a Programmable Interrupt Controller that can work with 8085, 8086, etc.
2. 8259 has flexible priority structure.
3. 8259 PIC is used to implement 8 level interrupt system.
4. While cascaded configuration of 1 master 8259 & 8 slave 8259s can handle up to 64 interrupt
systems.
5. 8259 can handle edge as well as level triggered interrupts.
6. In 8259, interrupts can masked individually.
7. The vector address of interrupt is programmable.
8. Status of interrupts (pending, in-service, and masked) can be easily read by microprocessor.
9. 8259 does not requires clock signal.
10. It can also be used in buffered mode.
BLOCK DIAGRAM:
Page 39 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Block Diagram of 8259 PIC is shown in figure 3.1 & it contains following blocks:
I) Data Bus Buffer:
It is a programmable register.
It is used to mark some interrupt lines by selecting proper bits.
Microprocessor can read contents of this register without issuing any command word.
*** Note: write any one out of the following for 5 marks ***
DIAGRAM:
Page 41 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
1. 8259 in cascade mode is preferred to increase number of interrupts more than 8 up to 64.
2. In this, three 8259 are used. One 8259 master and other two 8259 are known as slave-0, slave-1.
3. For Master, SP/EN +5V, For Slave, SP/EN +0V.
4. First all 8259’s are initialized by writing proper ICW’s & OCW’s.
5. INTR of 8086 is enabled by using the instruction STI (now IF is set).
6. When request appears on any one of IR inputs of slave, then after resolving priority, slave makes
INT high which is given at IR inputs of master.
7. After resolving priority, master makes INT high which is given to microprocessor.
8. Now microprocessor is interrupted.
9. Microprocessor gives 2 INTA pulses to 8259.
10. First INTA pulse is accepted only by master.
11. Now master gives slave identification number on CAS2, CAS1 & CAS0.
12. The second INTA pulse is recognized only by that master for which its identification number
matches with CAS2, CAS1 & CAS0.
13. Now slave gives type number to 8086.
14. Now 8086 execute ISR.
15. At the end of ISR, 2 EOI command is executed.
16. One EOI command for master & another for slave to clear corresponding bit in ISR of master & slave.
17. Due to this, master & slave can respond to other low priority interrupts.
18. Figure 3.3 shows interfacing of 8259 with 8086 in minimum mode (8259 in cascade mode).
Page 42 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Q5) Draw and explain the block diagram of 8255. Also Explain Different Operating
Modes of 8255.
FEATURES:
1. 8255 PPI contains 24 programmable I/O pins arranged as 2 8-bit ports & 2 4-bit ports.
2. 8255 PPI contains 3 ports and they are arranged in two groups of 12 pins.
3. It is fully compatible with Intel Microprocessor families.
4. It is also TTL compatible.
5. It has improved DC driving capability.
6. 8255 can operates in 3 modes:
a. Mode 0: Simple I/O.
b. Mode 1: Strobed I/O.
c. Mode 2: Strobed bidirectional I/O.
Block diagram:
Page 43 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
8255 I/O ports are divided into 2 sections: Group A & Group B
Group A control block controls Port A & Port C upper i.e. PC7 – PC4.
Group B control block controls Port B & Port C lower i.e. PC3 – PC0.
Each group is programmed through software.
Group A & Group B controls accepts the control signals from the control word and forwards them
to the respective ports.
Group A control block controls Port A & Port C upper i.e. PC7 – PC4.
Only Port C can also be programmed to work in Bit Set/Reset Mode to manipulate its individual
bits.
Port C function is dependent on mode of operation.
It can be used as Simple I/O, Handshake Signals & Status Signal Input.
Page 44 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Control Word Register defines the function of each I/O Port and in which mode they should operate.
1. To perform 8-bit data transfer using Ports A, B & C, 8255 needs to be in the I/O Mode.
2. The bit pattern for the control word in the I/O Mode is as follows:
3. Figure 3.5 shows the bit pattern of control word in 8255 I/O Mode.
Page 45 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Mode 1:
1. In this Port A & Port B are provided 3 signals i.e. 2 Handshake Signal & 1 Interrupt Signal.
2. These signal are provided by Port C.
3. The remaining 2 lines of Port C can be used for Simple I/O function.
4. There are two case: Input Mode & Output Mode.
I) Input Mode:
In Mode 1 Input Mode Port A uses PC3, PC4, PC5 and Port B uses PC0, PC1, PC2 signals as handshake
signals.
Port A, Port B and handshake signals are interfaced with peripheral.
The aim of interfacing is to transfer data from peripheral to CPU through 8255.
The different handshake signals used are STB, IBF & INTR.
Figure 3.7 shows PA, PB & PC in Mode 1 output mode.
Page 46 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
After that IBF goes high and then STB also goes high.
Now INTR goes high if internal INTE F/F is enabled.
Now microprocessor is interrupted to read data or microprocessor can read data by checking Port
C.
Once microprocessor reads data IBF goes low.
Now Peripheral devices places next data.
In Mode 1 Output Mode Port A uses PC3, PC6, PC7 and Port B uses PC0, PC1, PC2 signals as
handshake signals.
Port A, Port B and handshake signals are interfaced with peripheral.
The aim of interfacing is to transfer data from peripheral to CPU through 8255.
The different handshake signals used are OBF, ACK & INTR.
Figure 3.9 shows PA, PB & PC in Mode 1 output mode.
Page 47 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
*** NOTE: Answer below is written for 10 Marks. For 5 Marks Make it Short. ***
Page 48 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Page 49 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Page 50 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Page 51 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
1. Interfacing of the latch 8282 with the 8086 processor is shown in figure 3.19.
2. The ALE signal is being used as the strobe (STB) input for the latches, which enables the latches and
loads the address into the latches.
3. Since each latch is an octal, we have to use 3 such latches in order to latch a 20 bit address.
4. On receiving the HIGH (1) ALE signal from the processor, the latches will be enabled and the A 0 to
A19 address is latched.
5. Before the address disappears from the multiplexed bus, the ALE reduces to 0 and the latches are
disabled.
Figure 3.17: Interfacing of the latch 8282 with the 8086 processor.
Q10) Interface DMA controller 8237 with 8086 Microprocessor. Explain Different
data transfer modes of 8237 DMA Controller.
Ans: [Q10 | 10M – DEC14] & [Q11 | 10M – may15 & 5M - DEC15]
1. Usually Data Transfer takes place between Microprocessor & Peripheral Device by using a program
stored in a memory.
2. It is known as Microprocessor Controlled Data Transfer.
3. This method is used when the speed of Peripheral is less than or equal to the speed of
Microprocessor.
4. If the speed of Peripheral is greater than the speed of microprocessor then microprocessor is
disconnected from the system and DMA Controller is used to transfer the data between peripheral
devices.
5. Now it is known as Device Controlled Data Transfer.
Page 52 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
6. This method does not requires software and so data transfer takes place at high speed.
7. For example: Data transfer between system memory and floppy disk.
Page 53 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
It is very similar to block transfer, except that the DREQ must active throughout the DMA operation.
In this mode, the number of bytes to be transferred is controlled by I/O device.
If during the operation DREQ gets low, the DMA operation is stopped and the busses are returned
to the microprocessor.
In meantime, the microprocessor can continue with its own operations.
Once DREQ goes high again, the DMA operation continues from where it had stopped.
Page 54 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Features:
Block diagram:
I) Control Unit:
Page 55 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Features:
Block Diagram:
Page 56 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
This registers permits 8089 to deal with 8-or 16-bit data width devices or a mix of both.
In a particular case of an 8–bit width I/O device inputting data to a 16-bit memory interface, 8089
capture two bytes from the device and then write it into the assigned memory locations with the
help of assembly/disassembly register.
V) Instruction Fetch:
It is used to fetches the instructions from the external memory and stores them in the Queue to be
executed further.
Ans:
Features:
BLOCK Diagram:
It accepts the read & write signals, which are used to control the flow of data through data bus.
It also accepts the A1 – A0 Address lines which are used to select one of the counters or the control
word as shown below:
A0 A1 Selection
0 0 Counter 0
0 1 Counter 1
1 0 Counter 2
1 1 Control Word
Page 58 of 98
System Designing with 8086 Semester – 5 Topper’s Solutions
Control Word Register is 8 bit register that holds the Control Word.
It is selected when A1 – A0 contain 11.
It is used to specify the BCD or Binary Counter to be used, its mode of operation and the data
transfer to be used.
The data can only be written into control word register, no read operation is allowed.
IV) Counters:
Page 59 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
1. Memory management is the act of managing computer memory at the system level.
2. Memory Management dynamically allocate portions of memory to programs at their request, and
free it for reuse when no longer needed.
3. In 80386 DX, the logical (virtual) address is converted to the linear address.
4. This is done with the help of segmentation mechanism.
5. While the linear address is converted to physical address with the help of paging mechanism.
6. Thus, memory management in 80386 DX is done by converting logical address to physical address
with the help of segmentation & paging.
7. Figure 4.1 shows logical to physical address translation in 80386.
Segment Translation:
Page 60 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
3. To perform this translation, the processor uses the following data structures:
Descriptors:
The segment descriptor is used to provide the data which is required to map a logical address into
a linear address.
Descriptors are created by compilers, linkers, loaders, or the operating system, not by applications
programmers.
Descriptor Table:
A descriptor table is simply a memory array of 8-byte entries that contain descriptors.
Segment descriptors are stored in either of two kinds of descriptor table:
a. The global descriptor table (GDT): GDT is common table accessible to all the tasks.
b. A local descriptor table (LDT): LDT is separate for each task.
Selector:
Selector is used to select one of the 8192 descriptors from one of the tables Viz. GDT & LDT.
Structure of selector:
16 3 2 1 0
Selector TI RPL
Page 61 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
Segment Register:
Page Translation:
31 12 11 10 9 8 7 6 5 4 3 2 1 0
13. D stands for Dirty, A stands for Access, P for Present & R/W for Read & write.
14. PCD stands for Page Cache Disabled & PWT Stands for Page Write Through.
15. U/S bit differentiates between User & Supervisor Privileges.
Page 62 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
Page 63 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
General Real Mode is also called Real Protected Mode is also called Protected
Address Mode. Address Mode.
Default Mode It is the default operating mode on It is not default operating mode on
Reset. reset.
Entering the Mode The 80386 begins its execution in For protected mode operation the
real mode on power up or reset. Protection Enable (PE) bit of Control
Register 0 must be set.
Leaving the Mode To leave the Real Mode & Enter To leave the Protected Mode the User
Protected Mode the PE bit of can clear the PE bit in Control Register
Control Register 0 must be set. 0.
Access In the Real Mode 80386 can access Protected Mode can access all general
all the registers. purpose registers, control registers,
debug registers, test registers, segment
selectors and segment descriptors.
Page 64 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
1. The segment descriptor is used to provide the data which is required to map a logical address into
a linear address.
2. Descriptors are created by compilers, linkers, loaders, or the operating system, not by applications
programmers.
3. Descriptor is used to give the different details of the segment.
4. The structure of Segment Descriptors is shown below:
Page 65 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
Granularity Bit specifies the units with which the LIMIT field is interpreted.
When G = 0, 20 bit Limit specifies the segment size from 1 byte to 1 MB.
When G = 1, 20 bit Limit is to be multiplied by 4K hence segment size varies from 4 KB to 4 GB.
Availability (AV):
7 6 5 4 3 2 1 0
P DPL S E ED/C RW A
Present (P):
Executable (E):
Writeable (W):
Readable (R):
Accessed (A):
Q6) State the use of RF, TF, VM, NT, IOPL flag Bits.
Flag register:
Page 67 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
RF:
TF:
VM:
NT:
IOPL:
Page 68 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
7. It can switch repeatedly & rapidly between V86 Mode & Protected Mode.
8. To execute an 8086 program, the CPU enters in V86 Mode from Protected Mode.
9. CPU Leaves V86 Mode and enters protected mode to continue executing a native 80386 program.
1. The address forming mechanism in virtual 8086 mode is exactly identical with that of 8086 real
mode.
2. In virtual mode, 8086 can address 1MB of physical memory that may be anywhere in the 4GB
address space of the protected mode of 80386.
3. Like 80386 real mode, the addresses in virtual 8086 mode lie within 1MB of memory.
4. In virtual mode, the paging mechanism and protection capabilities are available at the service of
the programmers.
5. The virtual mode allows the multiprogramming of 8086 applications.
6. The virtual 8086 mode executes all the programs at privilege level 3.
Features:
Page 69 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
BLOCK DIAGRAM:
This unit includes the address drivers, transceivers for data bus & bus control signals.
It handles the communication with devices external to the microprocessor chip.
The Prefetcher fetches the instructions from the external memory and stores them in the Prefetch
queue to be executed further.
Prefetch queue is 16 byte in size.
The instruction decoder takes the instruction from the Prefetch queue and after decoding it,
stores them in the decoded instruction queue.
The decoded instruction queue can store up to three decoded instructions.
Page 70 of 98
Intel 80386DX Processor Semester – 5 Topper’s Solutions
It consists of 8 general purpose 32 bits register, 64 bit barrel shifter & ALU.
The execution unit executes each instruction received from the decoded instruction queue.
V) Segmentation Unit:
Page 71 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Features:
Block Diagram:
Page 72 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Bus Unit:
7. It provides the physical interface between the Pentium processor & rest of the system.
8. It consists of Address Drivers & Receivers, Data Bus Transceiver & Bus Control Logic.
Data Cache:
Code Cache:
Prefetcher:
Prefetch Buffers:
ALU:
The ALU for ‘U’ Pipeline can complete an instruction prior to the ALU in ‘V’ Pipeline.
But the ALU for ‘V’ Pipeline cannot complete an instruction prior to the ALU in ‘U’ Pipeline.
Paging Unit:
If Paging is enabled, the Paging Unit translates the linear address from address generator to a
physical address.
Two translation look aside Buffers (TLB) are implemented, one for each code & data cache.
Page 73 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Q3) Explain how the flushing of pipeline problem is minimized in Pentium Arch.
Ans: [Q3 | 10M – DEC14] & [Q4 | 10M – May15 & Dec15]
1. Program Transfer Instructions such as JMP, CALL, RET and Conditional Jumps reduces the
performance gain through pipelining.
2. This is because they change the sequence of all the instructions that entered the pipeline after
Program Transfer Instruction, thus assuming the previous instructions invalid.
3. Suppose instruction I3 is a conditional jump to I50 at some other address (target address), then the
instructions that entered after I3 is invalid and new sequence beginning with I50 need to be loaded
in.
4. This causes bubbles in pipeline, where no work is done as the pipeline stages are reloaded.
5. To avoid this problem, the Pentium uses a scheme called Dynamic Branch Prediction.
6. In this scheme, a prediction is made concerning the branch instruction currently in pipeline.
7. Prediction will be either taken or not taken.
8. If the prediction turns out to be true, the pipeline will not be flushed and no clock cycles will be
lost.
9. If the prediction turns out to be false, the pipeline is flushed and started over with the correct
instruction.
10. It results in a 3 cycle penalty if the branch is executed in the u-pipeline and 4 cycle penalty in v-
pipeline.
11. It is implemented using a 4-way set associative cache with 256 entries.
12. This is referred to as the Branch Target Buffer (BTB).
Page 74 of 98
Pentium Processor Semester – 5 Topper’s Solutions
13. The directory entry for each line contains the following information:
a. Valid Bit: Indicates whether or not the entry is in use.
b. History Bits: Track how often the branch has been taken.
c. Source memory address that the branch instruction was fetched from (Address of I3).
14. The history bits indicates one of four possible states.
History Resulting Description Prediction Made If branch is taken If branch is not taken
Bits
11 Strongly Taken Branch Taken Remains Strongly Downgrades to Weakly
Taken Taken
10 Weakly Taken Branch Taken Upgrades to Downgrades to Weakly
Strongly Taken Not Taken
01 Weakly Not Taken Branch Not Taken Upgrades to Downgrades to
Weakly Taken Strongly Not Taken
00 Strongly Not Taken Branch Not Taken Upgrades to Remains Strongly Not
Weakly Not Taken Taken
15. Thus, if the branch was correctly predicted to be taken, the history bits are upgraded and no further
action necessary i.e. correct instructions are already in the pipeline.
16. While, if branch was incorrectly predicted to be taken, the history bits are downgraded and pipeline
needs to be flushed and switching of pre-fetcher queue takes place.
17. And if the branch was correctly predicted not to be taken, history bits are downgraded and no action
required.
18. While, if incorrectly predicted not to be taken then history bits are upgraded and the queue is
flushed and instructions fetched from previous Prefetch queue that contains sequential
instructions.
19. Hence time is saved in this case because there are two Prefetch queues.
Q5) Enlist the instruction pairing rules for U & V Pipeline in Pentium.
Page 75 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Page 76 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Table 5.1 shows the Comparative Study of multicore i3, i5 & i7 processors.
Features i3 i5 i7 i7 Extreme
Processing 4 for Desktop as 8 threads for Desktop. 8 or 12 threads for 12 threads for
Threads well as Laptop. Desktop. Desktop.
4 threads for Laptop.
4 or 8 threads for 8 threads for
Laptop. Laptop.
Maximum 3 MB 6 MB 12 MB 15 MB
Smart Cache
Size
Best Intel Core i3-2130 Intel Core i5-2550 K Intel Core i7-3930 Intel Core i7-
Desktop (3.4 GHz, 3 MB) (3.4 GHz, 6 MB) (3.2 GHz, 12 MB) 3960 (3.3 GHz,
Processor 15 MB)
Best Mobile Intel Core i3-2370 Intel Core i5-2540 M Intel Core i7-2860 Intel Core i7-
(Laptop) (2.4 GHz, 3 MB) (2.6 GHz, 3 MB) (2.5 GHz, 8 MB) 2960 XM (2.7
Processor GHz, 8 MB)
Page 77 of 98
Pentium Processor Semester – 5 Topper’s Solutions
No. of Cores. 1. 1. 1.
Page 78 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Table 5.3 shows the Comparative Study of 8086, 80386 & Pentium processors.
Table 5.3: Comparative Study of Pentium 8086, 80386 & Pentium Processor.
Superscalar. No No Yes.
No. of Cores. 1. 1. 1.
Page 79 of 98
Pentium Processor Semester – 5 Topper’s Solutions
Page 80 of 98
Pentium Processor Semester – 5 Topper’s Solutions
12. The directories are accessed by the address issued by the Prefetcher.
13. When the Prefetcher initiates a split-line access, the two line address are submitted to the code
cache.
14. Address bits A11 – A15 from the Prefetcher identify the set where the target line may reside in cache,
and are used as index into the cache directories.
15. The lower portion of the Prefetcher address A4 – A0 identifies a byte within the line.
1. All accesses by the Execution Units for data are routed through the data cache.
2. Data Cache is used to stores operand information.
3. Figure 5.4 shows Pentium Data Cache Architecture.
Page 81 of 98
Pentium Processor Semester – 5 Topper’s Solutions
11. And in case of parity error being detected, an internal parity error is signaled to external logic
through the Internal Error Output.
12. Also the processor generates a special shutdown bus cycle and stops execution.
13. Each Directory entry has a tag field used to record the page number of the memory page where the
line of information came from.
14. Figure 5.5 shows the Data Cache Directory Entry Structure.
a. Prefetch stage:
b. Decode one:
If they can form a pair, then both the instruction move in together.
If they cannot, then instruction in the V pipeline of decode one stage is transferred to decode one
stage of U pipeline.
At the same time, first instruction in decode one stage of U pipeline is moved to decode two stage
of U pipeline.
c. Decode Two:
Page 83 of 98
Pentium Processor Semester – 5 Topper’s Solutions
d. Execution Unit:
It is used to access all the data from main memory and perform all the operation on that data.
In this U pipeline has ALU and barrel shifter.
V pipeline only have ALU.
Due to this V pipeline cannot handle all instructions.
Page 84 of 98
Pentium Processor Semester – 5 Topper’s Solutions
STAGES:
I) Prefetch stage:
Page 85 of 98
Pentium Processor Semester – 5 Topper’s Solutions
It is used to access all the data from main memory and perform all the operation on that data.
In this U pipeline has ALU and barrel shifter.
V pipeline only have ALU.
Due to this V pipeline cannot handle all instructions.
Page 86 of 98
Pentium Processor Semester – 5 Topper’s Solutions
This stage is used to read the information from the memory or register and move them into floating
point register.
In this stage the result is rounded of and written in the target of floating point register.
If results are to be stored in memory, then transfer to EX stage is done.
Ans:
Page 87 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Ans: [Q1 | 5M – dec14], [q2 | 10m – may15], [q3 | 10m – dec15] & [Q4 | 12M - MAY16]
Features:
1. It is 32 bit Microprocessor.
2. It was developed by Sun Microsystems & Texas Instruments.
3. It is RISC Processor. (Reduced Instruction Set Computer)
4. It has 32 bit address bus.
5. It has 64 bit data path.
6. Physical memory is of 64 GB.
7. It includes Level 1 Code Cache of 20 KB.
8. It includes Level 1 Data Cache of 20 KB.
9. SuperSPARC Processor has Prefetch Queue of 16 bytes.
10. It has 3 issues Superscalar.
11. Super SPARC Architecture consists of Integer Unit, Floating Point Unit & Memory Management Unit.
12. It has 4 stage pipelining of 8 phases.
13. It uses technique of delayed branch.
14. It has 3.1 Million transistors.
Block Diagram:
It consist of 20 KB Instruction Cache (Code Cache) with 5 way set associate mapping.
It also consist of 16 KB Data Cache with 4 way set associate.
Figure 6.1 shows the SuperSPARC Architecture.
Page 88 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
The Prefetcher fetches the instructions from the instruction cache & place them in the instruction
queue.
Up to 3 instructions are issued to be executed simultaneously.
This are the register file for Integer Execution Unit & Floating Point Execution Unit.
There are 32 registers per window.
The Integer unit dynamically selects “a group” of up to three instructions in each cycle.
It allows combination of independent as well as dependent integer operation to be completed.
Page 89 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
The memory reference address is calculated here using register file ports & virtual address adder.
The virtual address is then used by the cache and MMU to access load/store data.
VIII) FP Unit:
Sun SPARC implements two types of data formats viz. Integer & Floating Point Data Formats.
Page 90 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Page 91 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
It includes:
It is 32 it register.
It contains various fields that control and hold status information.
The privileged instructions RDPSR & WRPSR are used to read & write the PSR respectively.
WIM register works with the register windowing mechanisms of the Sun SPARC Processor.
It is used to determine a window overflow or underflow has taken place.
This register contains 3 fields that determines the address to which the control is to be transferred
in case of occurrence of trap.
The TBR can be written by the instruction WRTBR.
It is 32 bit register.
It contains most significant word of the double precision product of an integer multiplication &
double precision dividend for an integer divide instruction.
It is 32 bit register.
PC contains the address of the instruction currently being executed by the Integer Unit.
nPC holds the address of the next instruction to be executed.
Page 92 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
The contents and operation of an IU Deferred-Trap Queue are implementation dependent and are
not visible to user application programs.
It is 32 bit register.
A single ‘f’ register can hold one single-precision operand.
Floating Point Deferred Trap Queue, if present in implementation, contains sufficient state
information to implement resumable, deferred floating point traps.
If floating point instructions execute synchronously with integer instructions, provision of a floating
point queue is optional.
Page 93 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Q1] (a) Draw and explain timing diagram for read operation in minimum mode of 8086. [5]
Ans: [Chapter - 1]
(b) Explain I/O related addressing mode of 8086. [5]
Ans: [Chapter - 2]
(c) Write down features of Super SPARC Processor. [5]
Ans: [Chapter - 6]
(d) Enlist the instruction pairing rules for U & V Pipeline in Pentium. [5]
Ans: [Chapter - 5]
Q2] (a) Explain address translation mechanism used in protocol mode of 80386. [10]
Ans: [Chapter - 4]
(b) Write assembly language program for 8086 to exchange contents of two memory blocks. [10]
Ans: [Chapter - 2]
Q3] (a) Design 8086 microprocessor based system with following specifications [10]
(i) Microprocessor 8086 working at 10 MHz in minimum mode.
(ii) 32 KB EPROM using 8 KB chips.
(iii) 16 KB SRAM using 4 KB chips.
Ans: [Chapter - 1]
(b) Explain how the flushing of pipeline problem is minimized in Pentium Arch. [10]
Ans: [Chapter - 5]
Q4] (a) Interface DMA controller 8237 with 8086 Microprocessor. Explain Different data transfer modes of
8237 DMA Controller. [10]
Ans: [Chapter - 3]
(b) Differentiate between real mode & protected mode. [10]
Ans: [Chapter - 4]
Q5] (a) Draw & Explain block diagram of 8259 PIC. [10]
Ans: [Chapter - 3]
(b) Draw a segment descriptor format & explain different fields. [10]
Ans: [Chapter - 4]
Page 94 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Q1] (a) Draw and Explain Timing Diagram for Write operation in minimum mode of 8086 [5]
Ans: [Chapter - 1]
(b) List operating modes of 8253. [5]
Ans: [Chapter - 3]
(c) Write down features of Pentium Processor. [5]
Ans: [Chapter - 5]
(d) Write the instruction issue algorithm used in Pentium. [5]
Ans: [Chapter - 5]
Q3] (a) Design 8086 microprocessor based system with following specifications. [10]
(i) Microprocessor 8086 working at 8 MHz in Maximum Mode.
(ii) 32 KB EPROM using 16 KB chips.
(iii) 16 KB SRAM using 8 KB chips.
Ans: [Chapter - 1]
(b) Explain branch prediction logic used in Pentium. [10]
Ans: [Chapter - 5]
Q4] (a) Explain Different data transfer modes of 8237 DMA Controller. [5]
Ans: [Chapter - 3]
(b) Explain Interfacing of 8259 with 8086 in minimum mode. [5]
Ans: [Chapter - 3]
(c) Differentiate between real mode & protected mode. [10]
Ans: [Chapter - 4]
Page 95 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Q3] (a) Explain with block diagram working of 8255 PPI. [10]
Ans: [Chapter - 3]
(b) What is segmentation? What are the advantages of segmentation? [5]
Ans: [Chapter - 1]
(c) Differentiate between minimum mode & maximum mode in 8086. [5]
Ans: [Chapter - 1]
Q5] (a) Explain different data transfer modes of 8237 DMA Controller. [10]
Ans: [Chapter - 3]
(b) Explain the architecture of Super SPARC Processor with a neat diagram. [10]
Ans: [Chapter - 6]
Page 96 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
Q2] (a) Explain memory segmentation with pros & cons. [8]
Ans: [Chapter - 1]
(b) Draw and explain the block diagram of 8255. Also Explain Different Operating Modes of 8255. [12]
Ans: [Chapter - 3]
Q3] (a) Design 8086 based minimum mode system for following requirement: [12]
(i) 256 KB of RAM using 64 KB x 8 Bit device.
(ii) 128 KB of RAM using 64 KB x 8 Bit device.
(iii) Three 8 Bit Parallel Ports using 8255.
(iv) Support for 8 interrupts.
Ans: [Chapter - 1]
(b) Explain in brief, cache organization of Pentium processor. [8]
Ans: [Chapter - 5]
Page 97 of 98
SuperSPARC Architecture Semester – 5 Topper’s Solutions
*** Final Year Projects are also Available @Toppers Solutions ***
Page 98 of 98