Module 5 - 5 Marks
Module 5 - 5 Marks
a. Each 128 × 8 RAM chip has 128 bytes of memory (since 8 bits = 1 byte).
Required memory = 2048 bytes
⇒ Number of chips = 2048 ÷ 128 = 16 chips
c. Number of chips = 16
⇒ log₂(16) = 4 lines must be decoded for chip select.
a) How many such chips are required, and how should their address
lines be connected, to create a memory of 1024 bytes?
Each chip = 1024 × 1 bit = 128 bytes (since 1 byte = 8 bits, and 1024 bits
÷ 8 = 128 bytes)
• All chips receive the same 10 address lines (since log₂(1024) = 10)
to access 1024 locations.
• Each chip stores 1 bit per location, so 8 chips give 1 byte per
location.
To organize :
• Group the 128 chips into 16 groups, each group having 8 chips (to
form 1 byte per address).
• These 16 groups will be selected one at a time using 4 address
lines (since log₂(16) = 4) through a 4 – to – 16 decoder.
Connection Summary :
We are given:
✓ Segments = 128 ⇒ Need log₂(128) = 7 bits for segment number
✓ Pages per segment = 32 ⇒ Need log₂(32) = 5 bits for page
number
✓ Words per page = 4K = 2¹² ⇒ Need 12 bits for word offset
✓ Segment: 7 bits
✓ Page: 5 bits
✓ Offset (within page): 12 bits
Total = 7 + 5 + 12 = 24 bits
We are given :
✓ Physical memory has 4K blocks ⇒ log₂(4K) = 12 bits for block
number
✓ Each block has 4K words ⇒ log₂(4K) = 12 bits for word offset
Total = 12 + 12 = 24 bits
5. If given a choice between increasing the number of memory banks or
implementing memory interleaving, which approach would be more
effective in improving memory access speed? [5]
• Using SRAM for main memory would make computers much costlier
and limit memory size.
• SRAM is better suited for small, high - speed caches, not large main
memory.
System requirements:
RAM needed = 2K bytes = 2048 bytes
⇒ 2048 ÷ 256 = 8 RAM chips
C. RAM (00) :
Starts from 0000H to 07FFH
(2K bytes = 2048 locations = 0x0000 to 0x07FF)
ROM (01) :
Starts from 0800H to 17FFH
(4K bytes = 4096 locations = 0x0800 to 0x17FF)
Interface (10) :
Starts from 1800H onwards (for the interface registers)
10. A virtual memory system has :
Address space = 8K words,
Physical memory space = 4K words,
Page size = 1K words.
The following page reference changes occur during a time interval :
420126140102357
(Each change is listed once even if referenced again.)
Determine the four pages that are resident in main memory after each
page reference change using :
A. FIFO page replacement
B. LRU page replacement.
1 4 4---
2 2 42--
3 0 420-
4 1 4201
Misses = 3
0 0 Miss Set0 : 0 -
8 0 Miss Set0 : 0 8
0 0 Hit Set0 : 0 8
8 0 Miss Set0 : 8 6
(replace 0)
6 0 Hit Set0 : 8 6
Misses = 3
C. Direct Mapped Cache :
• 4 blocks → 4 sets.
• Block address modulus 4 = cache line.
0 0 Miss Line0: 0
8 0 Miss Line0: 8
(replaces 0)
0 0 Miss Line0: 0
(replaces 8)
8 2 Miss Line2: 6
6 0 Miss Line0: 8
(replaces 0)
Misses = 5
12. A direct - mapped cache has 1024 blocks and uses a 32 - bit address.
Determine the number of bits required for the index and the tag. [5]
Number of blocks = 1024
Index bits = log₂(1024) = 10 bits
(Block size is not given, so block offset = 0 bits, assuming 1 word per block.)
Total address bits = 32
Tag bits = 32 − Index bits − Block offset bits
Tag bits = 32 − 10 − 0 = 22 bits
13. Describe the differences between SRAM and DRAM in terms of
structure, speed, power consumption, and applications. Why is SRAM
preferred for cache, while DRAM is used for main memory? [5]
SRAM is used for cache and DRAM is used for main memory because :
• SRAM is preferred for cache because it is faster, ideal for high - speed
small storage.
• DRAM is used for main memory because it is denser and cheaper, making
it suitable for large capacity storage.
16. A write - back cache updates the main memory only on eviction. If
10,000 memory accesses occur and 3,000 result in write - backs, what is
the write - back percentage? [5]
Using the formula,
Substituting values,
17. A CPU accesses memory 1,000,000 times. It experiences 950,000 cache
hits and 50,000 cache misses. Calculate the cache hit rate and miss rate.
Cache Hit Rate :
B. How many bits are there in each of the TAG, SET, and WORD fields?
i. How many bits are required for addressing the main memory?
Each block = 256 words
Total words = 16,384 blocks × 256 words = 4,194,304 words
Since, 4,194,304 = 222
Thus, main memory address = 22 bits.
ii. How many bits are needed to represent the TAG, SET and WORD
fields?