كل اسئلة مواضيع تكنولوجيا الحاسبات
كل اسئلة مواضيع تكنولوجيا الحاسبات
a) 12bits-20bits
b) 16bits-32bits
c) 16bits-48bits
d) 8bits-16bits
2. The two units in the 8086up are
a) CU& PU
b) EU&CU
c) BIU&EU
d) BIU&PU
3.. Register of 8086 is either –—or ــــــــــــin length.
a) 8 OR 16
b) 6 OR 30
c) 12 OR 48
d) 20 OR 42
4. The 8088Mp is
a) 8 bit
b) 16 bit
c) 32 bit
d) 48 bit
5.If the CS =FF59, the range of physical address is:
a) FF590….0F58F
b) 0F58F…..0F5FF
c) FF950…..FF9FF
d) 0F590….0F59F
e) 12bits-20bits
f) 16bits-32bits
g) 16bits-48bits
h) 8bits-16bits
a) 8086
b) 80286
c) 8088
d) 8085
a) 8 bit
b) 16 bit
c) 32 bit
d) 48 bit
Solution:
No, since the range is 27000 to 36FFF, location 389F2 is not included in this range.
389F2 = segment value (shifted left) + 1282 → segment value (shifted left) =
37770 So that the CS value must be 3777
Q4: Assume that the DS register is 578C. To access a given byte of data at physical
memory location 67F66, does the data segment cover the range where the data is
located? If not, what changes need to be made?
Solution:
No, since the range is 578C0 to 678BF, location 67F66 is not included in this
range. To access that byte, DS must be changed so that its range will include that
byte.
Q5: Assume that SP = FF2EH, AX = 3291H, BX = F43CH, and CX = 09. Find the
content of the stack and stack pointer after the execution of each of the following
instructions.
PUSH AX
PUSH BX
PUSH CX
Solution:
Important Note:
Register CX has a value of 09 but the real size of CX is 16-bit so that we must add
00 in the higher byte of CX, so CX will become 0009 before pushing its value into
the stack.
SS: 09
FF28
SS: 00
FF29
SS: 3C 3C
FF2A
SS: F4 F4
FF2B
SS: 91 91 91
FF2C
SS: 32 32 32
FF2D
SS:
FF2E
Start After After After
SP= FF2E Push AX Push BX
Push CX
SP = FF2C SP = FF2A SP =
FF28
Q6: If SP = 24FC, what is the offset address of the first location of the stack that is
available to push data into?
Solution: 24FB
Q7: Suppose that DS = 1200H, SS = 2000H, EAX = 00001000H, EBX = 00002000H,
ECX = 00003000H, BP = 0100H, and SI = 0250H. Give the type of addressing mode
and determine the physical address for each of the following instructions,
assuming real mode operation:
Solution:
Assuming real mode operation, determine the effective address (EA) (if
applicable) resulting from the above values when the addressing mode is:
(a) Immediate
(b) Direct
Solution:
(b) EA = C237H
Sol:
Q11: why 8085 cannot implement pipeline and 8086 can implement pipeline?
Solution
8085 has one unit only which is use in fetch and execute stage
8086 has two separate unit one for fetch call BIU and one for execute call execute
unit
Q12/ what is the major difference between 8088 and 8086 CPU?
Sol:
The major difference is that the external data for the 8086 is 16-bit while the 8088
has 8-bit external data bus.8085 consist one unit can not implement pipeline while
8086 consist two unit can implement pipeline
Q13/ give the size of address bus and physical memory capacity of the following
Q14/ state the major difference between the 80386 and 80386sx
Sol:
80386 80386sx
External data 32-bit 16-bit
bus
Address bus 32-bit 24-bit
Q15/ list additional features of the 80286 CPU that were not present in the 8086
CPU.
Sol:
8086 80286
Physical 1MB 16MB
memory
Address bus 20-bit 24-bit
Q16/ state the difference between the physical address and logical address? List
three possible logical addresses corresponding to physical address 143F0.
Sol:
The physical address: is the 20-biy address that is actually put and decoded by the
memory interfacing circuitry.
1- 143F:0000
2- 1430:00F0
3- 1400:03F0
Q17/ how large is the segment in 8086? Can the physical address 346E0 be the
starting address for a segment? Why or why not?
Sol:
Sol: addressing mode allows the CPU to access operands (data) in various ways.
Sol:
1- Register
2- Immediate
3- Direct
4- Register indirect
5- Based relative
6- Indexed relative
7- Base index relative
8- Scaled-index.
Q20/ what are the three elements that can be used to form the effective address of
an operand in the memory?
Sol:
1- Base
2- Index
3- Displacement
Q21/ name the five memory operand addressing modes and give an example for
each case.
Sol:
Solution
Solution
3: Intel used of 1.2 million transistors to produce a math coprocessor on the same
chip
4: Another major addition to the 486 is the use of 4 pins for data parity (DP) which
allows implantation of parity error checking on system board?
5: 80486 involves the burst cycle clocks (performs 4 memory cycle in only 5 refer
a 2_1_1_1 which meant for reading 4 double word in 5 clocks) .While 386
performs 2 clocks each memory cycle refer as 2_2_2-2 which meant for reading 1
double word in 2 clocks).
The instruction has five stage In 80486 so that the pipeline stage is broken
down to 5 stage
2:decode 1
3:decode 2
4: execute
5: register wrire backt
Q5: Find the contents of memory location ES:4000 after executing the following
program
MOV EAX,[2000H]
BSWAP EAX
MOV ES:[4000H]
Solution:
1: MOV EAX[2000H]
EAX=87 54 F2 99
2: BSWAP EAX
EAX=99 F2 54 87
3: MOV ES:[4000H],EAX
CMPXCHG [2000h],BL
Solution
Since (AL)=(DS:2000H)=12H the zero flag is set and the value of source operand
is loaded into the destination this gives
(AL)=12h
(BL)=22H
(2000h)=22h
Q7: calculate the bus bandwidth of the followings system .assume that both
working with 33 MHz and 386 is zero wait state. also assume that the data is
aligned and in 4 consecutive double word memory locations.
Solution
Solution
1: In the Pentium, the external data bus 64bits which bring twice as much code and
data into the CPU as 486. This is done by use 8 bus request BE0 to BE7
2: The Pentium has a total of 16kbyte of on chip cache 8k is for code and other 8k
for data. Code cache is write protected .it use Harvard architecture to access two
caches simultaneously. The Pentium's cache organization for both data and code is
2_way set associative
4: is superscalar architecture. a large number of transistor where use to put into two
executing unit inside the Pentium (U unit and V unit) .the two instruction can
execute in two unit if there are not depended between them. A complier use job
instruction scheduling to remove dependent. The process of issuing two instruction
to the two execute unit (U and V) are call instruction pairing ,each unit U and V
has instruction cycle of five stage .
7: The Pentium has two set of TLB one for data and one for code. For data 64
entries for 4k page this means that the CPU has access to 256k (64*4k=265k).TLB
for code 32 entries of 4k page size therefore CPU has access 128k of code at any
time
8: The Pentium has both burst read and write cycles while 486 has only read burst
Solution
The idea is to increase the internal frequency of CPU while the external l
frequency remains the same the CPU execute code and data internally faster
while motherboard cost remain the same, example 486x2-50 used the internal
frequency 50 MHz but the external frequency 25 MHz
Q11: How Branch prediction work in Pentium
Solution
The Pentium includes a branch prediction unit based on a Branch Target Buffer
(BTB). The BTB is a cache composed of 256 entries. The cache is written each time
a jump instruction is found, in this case the target address is stored in the cache
line. And when an instruction reaches the ID1 stage, its address is sent to the BTB:
The Pentium fetches two instructions at the same time and checks whether they
can be executed in parallel by the two pipelines (U and V). The two instruction
must not dependence one on other in order to execute in same time.in(V and U)
solution
One-chip cache (L1) consist two 16 Kbyte 4-way associative and cache line 32bits.
The cache employ write-back mechanism and use LRU replacement algorithm.
The cache consist 8 bank interleaved on 4 boundaries.
Off-chip (L2) it is 12k it require 4 -10 cycle .if miss the access to main mmiory
take additional 11 cycle
Solution
A standard processor has one core (single-core.) Single core processors only
process one instruction at a time (although they do use pipelines internally, which
allow several instructions to be processed together; however, they are still run one
at a time. while
Q15: What is a Multi-Core Processor?
solution
solution
Multiple cores can be used to run two programs side by side and when an intensive
program is running (AV Scan, Video conversion, CD ripping etc.) you can utilize
another core to run your browser to check your email etc.
Multiple cores really shine when you’re using a program that can utilize more than
one core (called Parallelization) to improve the program’s efficiency. Programs
such as graphic software, games etc. can run multiple instructions at the same time
and deliver faster, smoother results.
So if you use CPU-intensive software, multiple cores will likely provide a better
experience when using your PC. If you use your PC to check emails and watch the
occasional video, you really don’t need a multi-core processor.
Solution
The Pentium pro all x 86 instructions are converted to micro-ops. This conversion
allows an increase in pipeline stages with little difficulty. This means that Pentium
pro, more instruction can be worked on and finished at a time. The Pentium pro
with 12 stage pipelines referred as super-pipelined. Pentium pro has multiple
executing unit capable of work in parallel it is also referred as superscalar. Also,
Pentium pro use what call out-of-order execution to increase the performance of
CPU.
The dependency between fetch and execute was resolve by use decoupling the
Stage 1: Instructions are fetching from memory and decoded them into series of
micro – ops, or RISC type instruction and placed into a pool called instruction
pool. This fetch/decoded of instruction is done in same order as program was
coded by program.
Stage 2: when the micro –ops are placed into instruction pool they can be executed
in any order as long as the data needed is available.
Stage 4: store the results temporarily such a speculative executing can go 20 -30
instructions deep into program .it is job of retire unit to provide the result to
program according to programmer code order
Q20: draw the internal architecture of Pentium pro
Review question part three descriptor
1. The unit provides a four level protection mechanism for system's code and data
against application program is:
a) Segmentation unit
b) Central Processing Unit
c) Bus interface unit
d) None of mentioned
3. The GDTR is a
a) 32 bits
b) 16 bits
c) 48 bits
d) 42 bits
a) 8 bits
b) 10 bits
c) 14 bits
d) 12 bits
a) 10 bits
b) 8 bits
c) 14 bits
d) 12 bits
A 10 bits
b 14 bits
c 12 bits
d 8 bits
e) 20 bits
f) 10 bits
g) 14 bits
h) 12 bits
a) 20 bits 32 bits
b) 10 bits 20bits
c) 14 bits 32bits
d) 12 bits 24bits
a) 16bits 24 bits
b) 10 bits 20bits
c) 14 bits 32bits
d) 12 bits 24bits
8. The segment that will be accessed in the protected mode of 80386Mp are
a) 4Kbyte to4Gbyte
b) 10 to 20 Mbytes
c) 20 to 30 Mbytes
d) 30 to 40 Mbytes
a) Location
b) Length
c) Access right
d) All above
Solution
A re locatable a program meant you can be placed it’s into any area of memory
and executed without change by use segment and offset schema. The memory
segment can be moved to any place in memory system without changing any of
the offset addresses this is accomplished by moving the entire program as block
to new area and then changing only the contents of segment register
Solution
• Protected mode allows access to data and programs located within and
above the first 1MB of memory.
– Microsoft Windows operates in protected mode.
• The segment registers are used differently in protected mode.
– They no longer store the segment address.
– Instead, they contain a selector that selects a descriptor from a
descriptor table.
• A descriptor table can contain up to 8192 descriptors.
• Each descriptor has 8 byte.
• There are two types of descriptor tables:
– Global descriptors: contain segment definitions that apply to all
programs.
– Local descriptors: unique to an application.
• A descriptor contains information about:
– Memory segment’s location
– Length of the segment
Access rights
This byte describes how segment function in the system .The access right byte
allows complete control over the segment in protected mode
Q5: draw the Descriptor format for 80286 and 80386 and above
Q6: what are the size of limit and base and access right in 80286 and 80386?
Solution
This byte describes how segment function in the system .The access right byte
allows complete control over the segment in protected mode
Q9: assume the value of descriptor as show below find the start address and end
address and status of descriptor
8F 10 20 00 00 9F D8 30
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
Solution
Solution:
No of descriptor=512/8=64
Q11: Code a descriptor that describes a memory segment that begin at location
(62 11 00)16and ends at location (62 11 FF)16 .this memory segment is code
segment , present ,accessed and that can be read .the descriptor is an 80286
microprocessor
Solution
Base=start=62 10 00 h
Access right=10011011=9Bh
The descriptor
FF 01 00 10 62 9B 00 00
Byte 0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
Q12: If the limit and base in global descriptor table are (0F FF)16 and (00 10 00
00)16.what is begin address of descriptor, size of the table in byte ,how many
descriptor can store and end address of table?
Solution
Q13:Assume that base address of the LDT is ( 00 12 00 00)16 and the GDT base
address is ( 00 10 00 00)16, if the value of the selector loaded into the CS register is
1007H. What is the requested privilege level? Is the segment descriptor in the GDT
or LDT? What is the start address of the descriptor from descriptor table?
Solution:
= 00121000H
Q14: The access rights byte of segment descriptor content (FE) 16 .what type
segment descriptor does it describes, and what are its characteristics?
Solution
Q15: what are the descriptor address and actual address in protected mode if
logical address DS: 10H and DS=13H and
GDTR=(00 00 20 00 00 FF)16
FF 0F 12 01 14 00 00 00
Byte0 Byte7
Solution
RPL=11
Index =2
From GDTR
1F 00 00 00 10 00 00 00
Byte0 Byte7
Solution
RPL=11 lowest
RPL: Requested privilege level where 00 is the highest and 11 is the lowest.
Selector = select one descriptor from 8192 descriptors in either the global or local
descriptor table.
Review question part four paging
2. The unit that organizes the physical memory in term of pages of 4KB size each
is:
a) Segmentation unit
b) Instruction unit
c) Paging unit
d) Exaction unit
4. The unit provides a four level protection mechanism for system's code and data
against application program is:
e) Segmentation unit
f) Central Processing Unit
g) Paging unit
h) None of mentioned
4. The unit provides a two level protection mechanism for system's code and data
against application program is:
a) Paging unit
b) Central Processing Unit
c) Segment unit
d) None of mentioned
5. Since the TLB in 386 keep the list of address for 32 most recently used pages it
allows the CPU to have access to
a) 64 Kbytes
b) 512 Kbytes
c) 128 Kbytes
d) 1M
6. In paging to get the address of code or data, the 80386 convert from
a) Physical to Logical
b) Physical to linear
c) Virtual to physical
d) Linear to physical
A CPU with virtual memory is fooled into thinking that it has access to an limited
amount of physical memory (DRAM or main memory). In virtual memory every
time the CPU looks for certain information the operating system will first search
in main memory and if it is not there it will bring it into main memory from
secondary memory (hard disk).by use LRD algorithm
2:paging. It is implemented by using page directory table and page table with
CR3(page directory base address(PDBA) size of paging 4K
The a dirty bit is use to indicated that the page in main memory has be change or
not change If page altered (update) while residing in main memory this bit=1(
change to page in main memory) otherwise this bit =0 when the page has not
change in main memory?
2: absence of what is call a dirty bit in the access byte of the descriptor table.
Q8: Q: Why should the operating system care if memory is altered(written into
change)?
if the data is altered ,it is the job of operating system to save it on the disk to make
sure that the hard disk always has latest data.
If the dirty bit is zero (D=0).it means that the data has not been altered and the
operating system can leave when it needs room for new data (or code?) Since the
original copy is on hard disk.
If the dirty bit is one (D=1) ,the operating system must save the data before it lost
.both problems of variable segment size and lack of dirty bit in segmentation are
fixed in the paging method of virtual memory
This cache used to store the 32 most recent page translation addresses .in this way
we speeds program execution because we did not want to translate the liner
address. if translation is not in TLB , the page directory and page table must be
accessed separate TLBs for each of their instruction and data caches.
Q11:what are the fields of a linear address
Solution
(03 01 00 8A)16 =
Offset = (08A)16
Q1: What are the Major changes in the 80386 )(سؤال مكرر في الجزء الثاني
Solution
During T1 part of bus cycle the 80386 DX outputs the Address of start location
that is be accessed on the address bus in a case of write cycle write data are also
output on the data bus
Q5 What dose T2 stand for ? What happens in this part of bus cycle?
Solution
During T2 external devices are to be accepting write data from the data bus and in
case of read cycle .put data on the data bus.
solution
solution
Is the amount of time that the address must be stable prior to read or write data
Q8 what is ideal state ?
solution
In case of 80386Dx pre fetch queue is already full and the instruction that
currently being executed does not need to access operands in memory .no bus
activity will take place in this case the bus goes into state of mode of operation
known as ideal state.
Q9 what does wait state?
Solution
A wait state can be inserted to extend the duration of 80386DX bus cycle this is
done in response to a request by an event in external hardware instead of an
internal event. In fact READY input of the 803806DX is provided specially for this
purpose.
Solution
By pipelining we meant that the addressing for the next bus cycle is overlapped
with the data transfer of the prior bus cycle?
Q11 draw the timing diagram for non –pipelined read cycle?
Solution
Q12 draw timing diagram for a non-pipelined write –cycle?
Solution
Q 13 what two type of bus cycle can be performed by 80386DX?
solution
c)What dose T1 stands for? What happens in this part of bus cycle?
Solution
a)Idle state
b)wait state
Wait state
Wait state can be inserted to extend the duration of 80386 bus cycle .this is done in
response to a request by an event in external hardware instead of an internal event.
READY input signal is use fro this purpose .this input signal is sampled in later of
T2 state of every bus cycle to determine if data transfer should be completed as
show in figure 9.13.whem READY logic one indicated that current cycle bus
should not completed as this signal high the read or write data transfer does not
take placed and the current T2 state become wait state (extended the duration of
bus cycle)
Q 15 what are five types of data transfer that can tack place the data bus? How
many bus cycle are required for each of the data transfer?
solution
Q16 :explain non-pipeline read cycle and how 80386 got to wait state
Solution
1:read operation start at the begin of pahse1(0) in the T1 state of bus cycle in this
moment 80386DX output address of double word memory location to be access
on the address bus
3: switch ADS to logic 0 to indicate that a valid address on the address bus at the
end of phase2(0) of T2 ads return to logic 1 inactive
4:bus cycle indicate signal M/IO , D/C and R/W are made valid at the begin of
phase1(0) of T1
5:at the begin of pahse2(0) of T2 of read cycle BS16 is active to indicate whether
the bus 16 bits or 32 bits
6:at the end of T2 the READY input signal tested by 80386DX whether the current
bus cycle completed if it have logic 0 or go to wait state if it logic 1
1: write operation start at the begin of pahse1(0) of the T1 state ,address ,byte
(BE0 --- BE3), and bus cycle indicate (M/IO ,D/C .W/R 1,1,1 ) are output
2: this output signal are latched by use ADS which is go to logic 0 output in T!
3:80386DX output the data on data bus at the begin of T1 and this data
maintained valid until the end of bus cycle
5: at the end of T2 the READY input signal tested by 80386DX whether the
current bus cycle completed if it have logic 0 or go to wait state if it logic 1
Q18:what type of bus cycle is in progress when the bus status code M/IO ,D/C and
W/R Equal 010
Solution
Q6: 80386 -20 running if full speed what duration of bus cycle fro write operation
in no wait state and one wait state
Solution
T=1/20*106 =50ns
Solution
Bus cycle =2 T
T=1/50*106 =20ns
Q2-From which dose the CPU asks for data first, cache or main memory?
solution
Cache memory
Q3-Rank the following from fastest to slowest as far as the CPU is concerned.
solution
Solution
solution
Write through: write to both cache and main memory at same time
Q8-which one increases the bus traffic, write-through or write-back?
Solution
Write through
Q9-what does LRU stand for, and how is it used?
solution
Solution
Cache memory is fast small memory placed between the CPU and main memory.in
order to speed up the system. Cache has a smaller access time in order to reduce
the average memory access time and therefore reduce overall system memory
access time
solution
1: program tend to access data at level K more than then access level K+1
2: level K+1 is slower cheaper per bit and larger than level K
3: for level K the faster and smaller device serves (take block of data from) larger
slower device in level K+1
4: A large pool of memory that costs as much as the cheap Storage near the
bottom, but that serves data to programs at the rate of the fast storage near the top.
Solution
Solution
SRAM DRAM
Larger cell-> lower density higher cost Smaller cell->higher density lower cost
per bit per bit
No refresh required Need periodic refresh
Simple read->fast access Complex read ->longer access
Stander IC Special IC process
Natural for integration with logic Difficult to integration with logic circuits
Use in cache memory Use in main memory
Solution
To speed up the system (memory access) by use faster and expansive SRAM near
to CPU (Cache memory is placed between the CPU and main memory).
it This takes advantage of the speed of SRAM and the high density and cheapness
of DRAM
Q16: What are the advantages and disadvantages of full associative mapped
address technique?
Solution
A: advantages:
1:Any incoming main memory block can be placed in any available cache
block.so that it efficiency use of cache memory high hit rate
Disadvantage:-
1: The search made in the Tag memory requires matching the tag field of the
address with each and every entry in the tag memory lead to a long delay.
Solution
A: Advantages:
Disadvantage:
Q18: Explain how set associative mid between direct and fully set cache
Solution
1: it is like direct mapping where each block in main memory goes to specific SET
in cache memory
2: when the block mapping to any SET it can maps to any location within the SET
size this is like fully associative.
Q19: What is cache coherency?
Solution
In multiple processor it must be ensured that cache always has the most recent
data. If the data in main memory has been changed by one processor, the cache of
that processor will have the copy of the latest data and the stale data in the cache
memory is marked as dirty (stale) before the processor uses it.in this when
processor tries to uses stale data it inform the situation . This is called cache
coherency.
Solution
Solution
For tag cache
Tag width=address of CPU =16 bits
depth is 128 because size of cache 128.
Total size of tag cache =128*16bits=256 byte
For data cache
Width=8 bits
Depth=128 because size of cache 128
Total size of data cache= 128*8 bits =128 byte
So that the size of total SRAM 256+128=384 byte
Q22: System has 64k byte memory and cache depth 2k what are the address format
for direct cache mapping support you answer with block diagram. What are the
locations of main memory block F7A9 in cache and what are their tags?
Solution
or
Tag=(11110)2 =(1E)16
Q15:System has main memory 64kbyte and cache 2kbyte 2way set associative
depth of draw block diagram. Calculate size tag cache and data size cache
Solution
Index=log21k=log2210=10 bits
Tag=CPU address bits-index bits=16-10=6 bits
Q16: System has main memory 64kbyte and cache 2kbyte 4way set associative
depth of draw block diagram. draw block diagram. Calculate size tag cache and
data size cache
Solution
Index=log2512=log229=9 bits
Tag=CPU address bits-index bits=16-9=7 bits
Q17: Microprocessor system has main memory 16M byte and cache depth 256k
calculate the size SRAM and draw the block diagram of system use direct
mapping.
Solution
Q18: Microprocessor system has main memory 16M byte and cache depth 256k
calculate the size SRAM and draw the block diagram of system use 2 way set
associative .
Solution
Index bits=log2 cache depth/2=log2 (256k/2)=log2 217=17 bits [A16 ----- A0]
Each set
Total=2(224byte +256kbyte)
Q19: Microprocessor system has main memory 16M byte and cache depth 256k
calculate the size SRAM and draw the block diagram of system use 4 way set
associative .
Solution
Index bits=log2 cache depth/4=log2 (256k/2)=log2 216=16 bits [A15 ----- A0]
Each set
Total=4*(256byte +256kbyte)
Q20: Calculate the tag and data cache sizes needed for each of the following cases
if the memory requesting address to main memory is 20 bits (A19-A0).Assume a
data bus of 8 bits. Draw a block for each case.
Solution
(a) Fully associative of 1024 depth
20*1k=20h bits
bits
Q2: If memory controller in 80386DX work in 2 way set associative it use LRU
for cache and memory swapping
Q3: the memory controller of 80386DX keeps track of which main memory
location are cached. It accomplishes this through what is called a cache directory.
Q4: in direct-mapping cache of (80386DX) the cache directory contain 1024 26-bit
entries
Q7: what are the different between direct-mapping and 2 way-set associative cache
for 80386 microprocessor?
One compare no algorithm sue for Use LRU algorithm for search
search
Q8: If cache directory entry for set 1 equals (00005FF)16 from which page of main
memory is the cache information ? is the cache entry valid? Which lines in set1 are
valid?
Solution
Therefore the entry is from page 2 of the main memory array next the valid bit is
Tag valid bit=bit8=1
And the tag entry is valid, finally the line valid bits are
Q9: design and draw for each of the followings by use direct mapped
external cache for 80386 processor assume that the cache page 32kb
(8k double word)
A) The cache directory set entry format
B) The address bit fields
C) The cache organization
Solution
80386 address bits=32 bits [A31 ---- A2]
RAM size=232=4 GB
Cache size=32kb=215
Number of page=arm size/cache size=232/215 =217
page 0 to page 217 -1
address= TAG +SET +line select
TAG=17 bits Line select =3bit address=30bits
Set=30-20=10bits for 1024 SET
A) The internal cache directory 26 bits
8 bits for line valid -> (B0 to B7)
One bits for TAG valid -> B8
17 bits in TAG=17 -> (B9 to B25)
The internal cache directory 26 bits
Q10: design and draw for each of the followings by use two way set
associative external cache for 80386 processor assume that the cache
page 32kb ( 8k double word)
A) The cache directory set entry format
B) The address bit fields
C) The cache organization
Solution
Since two way set associative there are two bank A and bank B
each data cache bank =cache size/2=32kb/2=16 kb
Number of page =main memory size/cache bank size
Number of pages=232/214=218 (page 0 to page 218-1)
Address=TAG +SET+ line select
TAG=18 bits
Line select =3bits
So that set =9 bits
A) There are two internal cache directory
Each of the internal cache directory 27 bits
8 bits for line valid -> (B0 to B7)
One bits for TAG valid -> B8
18 bits in TAG -> (B9 to B26)
Q11: design and draw for each of the followings by use 4-way set
associative external cache for 80386 processor assume that the cache
page 128B
A) The cache directory set entry format
B) The address bit fields
C) The cache organization
Solution
Since 4-way set associative there are four bank A and bank B bank C
and bank D
Each data cache bank =cache size/4=128kb/2=32 kb
80386 address 30bits[A31 – A2] main memory=4GB
Number of page (in main memory)=size main memory/bank size
232/215=217 so that it has [page0 ---- page 217-1]
Address=TAG +SET+ line select
TAG=17 bits
Line select =3bits
So that set =10 bits there are 1024 set in each bank
A) There are four internal cache directory
Each of the internal cache directory 26 bits
8 bits for line valid -> (B0 to B7)
One bits for TAG valid -> B8
17 bits in TAG -> (B9 to B25)
Cache organization
Q12 for direct mapped cache of the 80386 explain using diagrams how
the processor can access the location (00142028)16 show the contents of
the address bit fields and the content of cache directory
Solution
Cache size=32KB=215
Main memory size 4GB=232
So that number of page= 223/215=217 -> TAG filed bits=17bits
CPU address=30bits [A31—A2]
Address=TAG +SET +select line
30 =17 +SET +3 - SET=10
A A A A A A A
3 1 1 5 4 3 2
1 5 4
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0
17
! 17 bits TAG select 0 to 2 -1 page ! set 10 bits select !line select
Select 1 to 1024 1 to 8
0 to 1023 set
The CPU select set number =0100000001=257 set from 1024 set
25 8 7 0
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 1 0