Top Banner Ad

BCS302 — Unit 4: Memory

Table of Contents (35 sections)

BCS302 · COMPUTER ORGANIZATION AND ARCHITECTURE · Unit 4

Memory

Unit Scope & Exam Weightage: This unit covers the full storage spectrum: the basic concept and hierarchy, semiconductor RAM (SRAM/DRAM), 2D and 2½D memory organisation, ROM memories, cache concept, design issues and performance, address mapping and replacement, auxiliary memories (magnetic disk, magnetic tape and optical disks) and virtual memory. The solutions corpus records 12 PYQ clusters worth about 69 marks — five of them 7-mark cache/mapping or disk numericals. A student who can split a cache address into tag/set/word fields and write the effective-access-time formula is guaranteed a large share of this unit's marks.


Front Page: Importance-Wise Topic Roadmap (2023–26 PYQs)

Priority Topic (Exact Syllabus) PYQs Asked Marks Weightage Tag
1 address mapping and replacement Auxiliary memories: magnetic disk 5 (2023-24 ×3, 2024-25, 2025-26) 7m × 5 Survival Mode Numerical
2 Basic concept and hierarchy 2 (2024-25, 2025-26) 7m + 7m Core Concept Diagram
3 2D & 2 1/2D memory organization 2 (2023-24, 2025-26) 7m + 2m Core Concept
4 semiconductor RAM memories 1 (2024-25) 7m Comparison
5 ROM memories 1 (2024-25) 2m Core Concept
6 Cache memories: concept and design issues & performance 1 (2023-24) 2m Core Concept
7 magnetic tape and optical disks Virtual memory: concept implementation 0 direct — Predicted

2-Hour Last-Night Survival Checklist:

  1. Cache mapping (#1 Priority): Memorise the address split — tag | set/block index | word offset. Direct = one line per block (index=block mod linesindex = block \bmod lines); set-associative = kk lines per set (index=block mod setsindex = block \bmod sets); fully associative = no index, full tag search.
  2. Two guaranteed numericals: (a) 64k×1664k\times16 main memory with 1k cache and 4-word blocks → tag 6, block 8, word 2 bits; 256 cache blocks; (b) set-associative M1/M2 problem → tag 11, set 6, word 3 bits and EAT ≈ 70 ns.
  3. Hierarchy pyramid (#2 Priority): Draw registers → cache → main memory → magnetic disk → tape/optical, labels "faster/smaller/costlier per bit" on top and "slower/larger/cheaper" at the bottom; add temporal + spatial locality as the justification.
  4. Memory tables (#3/#4 Priority): SRAM (6T, no refresh, fast, cache) vs DRAM (1T1C, refresh, dense, main memory); 2D (one decoder, one row = one word) vs 2½D (row + column decoders, fewer sense amplifiers).
  5. Auxiliary memory (#1 Priority): Disk access time = seek + rotational latency + transfer + controller overhead, with average rotation =30/RPM=30/\text{RPM} seconds; tape is sequential/backup, optical is laser/WORM or rewritable.

1. Basic Concept and Memory Hierarchy

Memory (2 Marks): Memory is the storage subsystem that holds instructions and data for the processor. The memory hierarchy arranges several memory levels so that the CPU sees the speed of the fastest level and the capacity/cost of the largest level.

1.1 The Hierarchy Pyramid

%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
    R["Registers<br/>~1 ns, few hundred bytes"] --> C["Cache (SRAM)<br/>~1-10 ns, KB-MB"]
    C --> M["Main memory (DRAM)<br/>~50-100 ns, GB"]
    M --> D["Magnetic disk / SSD<br/>~ms, hundreds of GB-TB"]
    D --> T["Tape / optical<br/>seconds, archival"]
Level Technology Access time Capacity Cost per bit Managed by
Registers Flip-flops < 1 ns Bytes Highest Compiler / hardware
Cache SRAM 1–10 ns KB–MB High Hardware
Main memory DRAM 50–100 ns GB Medium OS + hardware (virtual memory)
Disk / SSD Magnetic / flash 0.1–10 ms TB Low OS (files, paging)
Tape / optical Magnetic / laser seconds Archival Lowest Operator / backup software
Average access time at level i=HiTi+(1−Hi) Ti+1\text{Average access time at level } i = H_i T_i + (1-H_i)\,T_{i+1}

HiH_i is the hit ratio and TiT_i the access time of level ii. The design goal is a high HiH_i so the average approaches the fast level's TiT_i.

1.2 Chip-Expansion Arithmetic

For a chip of organisation W×BW \times B (WW words, BB bits per word):

  • address lines =log⁡2W=\log_2 W;
  • chips for word expansion =Wtarget/W= W_{\text{target}}/W;
  • chips for bit expansion =Btarget/B= B_{\text{target}}/B;
  • total chips == product of the two expansions.

A 64K×864K\times8 chip needs log⁡2(64K)=16\log_2(64K)=16 address lines. A 256K×16256K\times16 memory needs (256K/64K)×(16/8)=4×2=8(256K/64K)\times(16/8)=4\times2=\mathbf{8} such chips.

Examiner Tip: On the hierarchy question, never stop at the picture. Add the two locality reasons, the hit-ratio formula and one chip-count calculation — these are the numbered step marks in the 7-mark answer.

After-Topic PYQ (2025-26 Sec C Q4b — 7 Marks): Explain the memory hierarchy with diagram. A memory chip has a capacity of 64K×864K \times 8. (i) Find the number of address lines required. (ii) How many such chips are needed to design a 256K×16256K \times 16 memory system?

After-Topic PYQ (2024-25 Sec C Q6a — 7 Marks): Design and explain the fundamental concept of computer memory hierarchy?


2. Semiconductor RAM Memories

RAM: Random Access Memory whose words can be read or written in roughly constant time. Two families dominate: SRAM (static, flip-flop cell) and DRAM (dynamic, capacitor cell).

2.1 SRAM vs DRAM

Feature SRAM DRAM
Cell 6-transistor flip-flop 1 transistor + 1 capacitor (1T1C)
Storage Latch holds state while powered Charge on capacitor leaks away
Refresh Not needed Needed every ~16–64 ms
Read Non-destructive Destructive; sense amp restores charge
Speed Fast (1–10 ns) Slower (50–100 ns)
Density / cost Low density, expensive per bit Very dense, cheap per bit
Use CPU cache, register files Main memory, frame buffer

2.2 DRAM Operation and Refresh

write: word line HIGH → bit line drives capacitor charge
read : word line HIGH → charge shares with bit line → sense amp detects and restores
refresh: periodically read every row and restore its charge (RAS-only refresh)

A 1T1C cell stores a 1 as a charged capacitor and a 0 as discharged. Because reading disturbs the charge, DRAM requires a sense amplifier and a refresh cycle; this is why DRAM is dense but slower than SRAM.

Examiner Tip: The full-credit SRAM/DRAM answer has four scored blocks: cell circuit, read/write mechanism, refresh requirement, and an application table. Writing only "SRAM is fast, DRAM is cheap" earns roughly 2 of 7 marks.

After-Topic PYQ (2024-25 Sec C Q6b — 7 Marks): Describe the architecture and operation of semiconductor RAM (Random Access Memory) memories such as DRAM (Dynamic RAM) and SRAM (Static RAM)?


3. 2D & 2 1/2D Memory Organization

2D organisation: cells are arranged as a single array of 2k2^k rows × mm columns; one kk-to-2k2^k row decoder selects one complete word and mm sense amplifiers read it. 2½D organisation: a row decoder and a column decoder/multiplexer both participate, so a small word is selected from a large row.

3.1 Structural Comparison

%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart LR
    subgraph TD["2D: one decoder"]
        A["k address bits"] --> RD["Row decoder<br/>selects 1 of 2^k words"]
        RD --> WA["m-bit word out<br/>m sense amplifiers"]
    end
    subgraph TD2["2½D: two decoders"]
        B["row address"] --> R2["Row decoder"]
        C["column address"] --> C2["Column decoder / mux"]
        R2 --> ARR["Cell matrix"]
        C2 --> ARR
        ARR --> W2["m-bit word out<br/>few sense amplifiers"]
    end
Feature 2D 2½D
Decoders One (row) Two (row + column)
Sense amplifiers One per bit of the word (mm) Only mm for the selected slice, shared
Word selection Entire row is the word Small word picked from a long row
Address split All bits to row decoder Split into row and column fields
Scaling Large memories need very long rows Better for large capacity
Speed Faster, one decode step Slightly slower, two decode steps
Hardware Simpler, more sense amps More decoder logic, fewer sense amps

Advantages/disadvantages: 2D is simple and fast but wasteful of sense amplifiers for big arrays; 2½D saves area and power by sharing sense amplifiers but pays an extra column-decode delay.

Examiner Tip: Draw a square cell matrix for 2½D and label the row decoder and column multiplexer. State the trade-off sentence verbatim: "fewer sense amplifiers and better scaling, at the cost of two-step decoding and extra delay".

After-Topic PYQ (2025-26 Sec C Q5b — 7 Marks): Explain 2D and 212\frac{1}{2}D memory organization. Write their advantages and disadvantages.

After-Topic PYQ (2023-24 Sec A Q1f — 2 Marks): Define 2122\frac{1}{2} D memory organization.


4. ROM Memories

ROM (Read Only Memory): non-volatile semiconductor memory used for data that must survive power-off. It is written once or reprogrammed rarely and read many times.

Type Programming Erasure Typical use
Mask ROM During fabrication None Fixed boot code, lookup tables
PROM Fuses blown by programmer None Small production runs
EPROM UV light through window UV erase Development firmware
EEPROM Electrical byte write Electrical byte erase Configuration, calibration data
Flash Electrical block write Electrical block erase BIOS, SSD, USB drives

Purpose: store the boot loader/firmware, microcode, character generators and constants; because ROM is non-volatile, the machine has a valid start-up instruction after power-on.

Examiner Tip: For 2 marks, write "non-volatile, read-mostly, holds boot firmware" and name PROM/EPROM/EEPROM/flash. Adding one concrete use (BIOS or SSD) secures the full mark.

After-Topic PYQ (2024-25 Sec A Q1f — 2 Marks): Explain the purpose of ROM memories in computer systems?


5. Cache Memories: Concept, Design Issues & Performance

Cache: a small, fast SRAM buffer between CPU and main memory that keeps copies of the currently active blocks. It works because of locality of reference.

5.1 Locality of Reference

  • Temporal locality: an item accessed recently is likely to be accessed again soon (loop counters, repeated variables).
  • Spatial locality: items near a recently accessed address are likely to be needed soon (arrays, sequential instructions).
  • A cache exploits spatial locality by fetching a whole block of 4–64 words, and temporal locality by keeping that block after first use.
Teff=h Tcache+(1−h) (Tcache+Tmem)(hierarchical probe)T_{\text{eff}} = h\,T_{\text{cache}} + (1-h)\,(T_{\text{cache}}+T_{\text{mem}}) \quad \text{(hierarchical probe)}

If the cache and memory are probed in parallel, the miss service time is TmemT_{\text{mem}} alone and Teff=hTc+(1−h)TmT_{\text{eff}}=hT_c+(1-h)T_m.

5.2 Design Issues

Issue Choices Consequence
Block size 4–64 words Larger blocks exploit spatial locality but increase miss penalty
Mapping Direct / associative / set-associative Hardware cost vs conflict misses
Replacement LRU / FIFO / random Which line is evicted on a miss
Write policy Write-through / write-back Simplicity vs memory-traffic reduction
Write miss Write-allocate / no-write-allocate Whether the block is loaded on a write miss

Examiner Tip: The 2-mark locality note must name both kinds and give one example each (loop variable and array traversal). For a 7-mark cache question add the EAT formula and a write-policy comparison.

After-Topic PYQ (2023-24 Sec A Q1e — 2 Marks): Write a short note on locality of reference.

5.3 Cache Mapping Techniques

The address from the CPU is split into tag | index | word offset. The index chooses a line or set; the tag identifies which main-memory block is resident.

Technique Address fields Placement rule Strength Weakness
Direct tag / line index / offset Block jj goes only to line j mod Lj \bmod L Cheapest, one tag compare Conflict misses when two blocks map to same line
Fully associative tag / offset Block may go anywhere Lowest conflict misses Parallel comparison of all tags; expensive
Set-associative tag / set index / offset Block jj goes to set j mod Sj\bmod S, any of its kk ways Balanced kk tag compares per access
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
    A["CPU address"] --> B["word offset<br/>select word in block"]
    A --> C["set/line index<br/>select cache location"]
    A --> D["tag<br/>compare with stored tags"]
    C --> E{"match?"}
    D --> E
    E -->|yes| F["HIT: read word"]
    E -->|no| G["MISS: fetch block from M2<br/>evict by LRU/FIFO"]

Replacement policies: LRU evicts the least recently used way (best, needs access history); FIFO evicts the oldest-loaded (simple, can evict a hot line); random needs no history and avoids pathological FIFO behaviour.

After-Topic PYQ (2025-26 Sec C Q5a — 7 Marks): Explain the following cache mapping techniques: (i) Direct Mapping (ii) Associative Mapping (iii) Set-Associative Mapping


6. Cache Mapping Numericals

6.1 Set-Associative Hierarchy — Worked

Lines=16K8=2048=211,256 words8 words/line=32 lines/set=25,sets=204832=64=26\text{Lines}=\frac{16K}{8}=2048=2^{11},\quad \frac{256\text{ words}}{8\text{ words/line}}=32\text{ lines/set}=2^5,\quad \text{sets}=\frac{2048}{32}=64=2^6 tag=20−6−3=11 bits,set=6 bits,word=3 bits\text{tag}=20-6-3=11\text{ bits},\quad \text{set}=6\text{ bits},\quad \text{word}=3\text{ bits}

Here M2=1M words=220M_2=1M\text{ words}=2^{20} gives a 20-bit word address and an 8-word block gives the 3-bit offset. A block B=⌊A/8⌋B=\lfloor A/8\rfloor maps to set B mod 64B\bmod 64 with tag ⌊B/64⌋\lfloor B/64\rfloor.

Effective access time, h=0.95h=0.95: hierarchical probe → 0.95(50)+0.05(50+400)=47.5+22.5=70 ns0.95(50)+0.05(50+400)=47.5+22.5=\mathbf{70\ ns}; if M2 is probed in parallel → 0.95(50)+0.05(400)=67.5 ns0.95(50)+0.05(400)=\mathbf{67.5\ ns}. State which convention is assumed.

6.2 Direct-Mapping Numerical — Worked

Main memory 64k×16⇒21664k\times16 \Rightarrow 2^{16} words → 16-bit address. Cache =1k=210=1k=2^{10} words with 4-word blocks (222^2 offset bits) gives 210/22=28=2562^{10}/2^2=2^8=256 lines.

Field Bits Reason
Tag 6 16−8−216-8-2
Block / line index 8 log⁡2256\log_2 256
Word offset 2 log⁡24\log_2 4

Examiner Tip: In every mapping numerical, write the three field widths before answering the sub-questions. Examiners award "address format" marks separately from "number of blocks" marks.

After-Topic PYQ (2023-24 Sec C Q6a — 7 Marks): Consider a cache (M1) and memory (M2) hierarchy with following characteristics:\n- M1 : 16K word, 50 ns Access time\n- M2 : 1M word, 400 ns Access time\nAssume 8-word cache blocks and set size 256 words with set associative mapping.\n(i) Show and explain the mapping between M2 and M1.\n(ii) Calculate the effective memory access time with cache hit ratio = 0.95.

After-Topic PYQ (2023-24 Sec C Q6b — 7 Marks): Explain the direct mapping technique. Consider a digital computer has a memory unit of 64k×1664k \times 16 and cache memory of 1k words. The cache uses direct mapping with 4 block size of four words.\n(i) How many bits are there in the tag, block and word fields of the address format?\n(ii) How many blocks can the cache accommodate?


7. Auxiliary Memories: Magnetic Disk, Tape and Optical Disks

7.1 Classification by Method of Access

Access type Meaning Example
Random Any location reached in constant time RAM, ROM
Direct Address given, then seek to neighbourhood; short sequential wait Magnetic disk, SSD
Sequential Items reached in fixed order from the beginning Magnetic tape
Associative Content compared in parallel Cache / content-addressable memory

7.2 Magnetic Disk Construction and Access Time

A disk has one or more rotating platters; each surface has concentric tracks, divided into sectors. Tracks at the same radius on all surfaces form a cylinder. A read/write head on an actuator arm moves radially to the selected track while the platter spins beneath it.

Taccess=Tseek+Trotation+Ttransfer+Tcontroller,Trotation,avg=12⋅60RPM=30RPMsT_{\text{access}} = T_{\text{seek}} + T_{\text{rotation}} + T_{\text{transfer}} + T_{\text{controller}}, \qquad T_{\text{rotation,avg}}=\frac{1}{2}\cdot\frac{60}{\text{RPM}}=\frac{30}{\text{RPM}}\\ \text{s}

For a 7200 RPM disk, average rotational delay =30/7200=4.17=30/7200=4.17 ms; a typical average seek is 5–10 ms.

7.3 Disk vs Tape vs Optical

Medium Access Capacity Speed Volatile? Strength / use
Magnetic disk Direct/random Hundreds GB–TB ms No Primary secondary storage, OS and files
Magnetic tape Sequential TB per cartridge seconds No Cheap archival backup
Optical disk (CD/DVD/Blu-ray) Direct 700 MB–50 GB+ tens–hundreds ms No Distribution, WORM or rewritable archive

Optical media use a laser: CD-ROM/DVD-ROM are read-only, CD-R is write-once (WORM), and CD-RW/DVD-RW use phase-change material for rewritability.

Examiner Tip: The disk question scores on the four access-time components and the formula. For the auxiliary-memory comparison, give one "characteristic" and one "function" per medium, not just a list of names.

After-Topic PYQ (2024-25 Sec B Q2d — 7 Marks): Discuss the characteristics and functionalities of auxiliary memories such as magnetic disks, magnetic tapes, and optical disks?

After-Topic PYQ (2023-24 Sec B Q2d — 7 Marks): Give classification of memory based on the method of access. Also discuss construction and working of magnetic disk and various components of disk access time.


8. Virtual Memory: Concept and Implementation

Virtual memory: a technique that gives each process a large, private address space by mapping virtual pages to physical frames in main memory, with the help of a page table and disk backing store.

8.1 Implementation Steps

  1. CPU generates a virtual address = virtual page number (VPN) + page offset.
  2. The TLB is searched first; on a TLB miss the page table is consulted.
  3. Page-table entry gives the physical frame number (PFN) plus valid/protection/dirty bits.
  4. Physical address = PFN + the same page offset.
  5. If the valid bit is 0 → page fault: OS loads the page from disk into a free frame, updates the table and restarts the instruction.
physical address=PFN×2offset bits+offset,EATVM=(1−p) Tmem+p Tdisk\text{physical address} = \text{PFN}\times 2^{offset\,bits} + \text{offset}, \qquad \text{EAT}_{\text{VM}} = (1-p)\,T_{\text{mem}} + p\,T_{\text{disk}}

pp is the page-fault rate; because Tdisk≫TmemT_{\text{disk}}\gg T_{\text{mem}}, even a small pp dominates performance.

Concept Meaning
Page Fixed-size virtual block (e.g., 4 KB)
Frame Equal-size physical block in RAM
Demand paging Page loaded only when first referenced
Replacement LRU/FIFO when no free frame exists
Working set Pages actively needed by a process

Examiner Tip: Virtual memory has no PYQ in this set, so any question on it is predicted. Write the VPN/offset → TLB → page table → PFN chain and the page-fault path; that is a complete 7-mark answer.


Solved Exam-Ready Questions

Solved Q1 (2025-26 Sec C Q5a — 7 Marks | Survival Mode)

Q: Explain the following cache mapping techniques: (i) Direct Mapping (ii) Associative Mapping (iii) Set-Associative Mapping

Solution:

  1. Common idea: a cache address is divided into tag, index and word offset; the tag tells which main-memory block is stored in the selected location.
  2. Direct mapping: with LL cache lines, block jj must occupy line j mod Lj\bmod L (tag =j÷L=j\div L). One tag comparison, cheapest hardware, but two frequently used blocks with the same index evict each other (conflict miss).
  3. Associative mapping: a block may occupy any line; all tags are compared in parallel. Lowest conflict misses, but LL comparators make it expensive and slow for large caches.
  4. Set-associative mapping: LL lines are grouped into SS sets of k=L/Sk=L/S ways; block jj goes to set j mod Sj\bmod S and may use any of its kk ways. It uses kk tag comparisons — a compromise.
  5. Address fields: direct = tag/line/word; fully associative = tag/word; set-associative = tag/set/word.
  6. Replacement: when the chosen location is full, LRU (or FIFO/random) selects the victim; a write-back cache must first write a dirty victim to main memory.
  7. Conclusion: direct is cheapest but most conflict-prone, fully associative is fastest in hit rate but costliest, and set-associative is the practical choice (commonly 2-, 4- or 8-way).

Solved Q2 (2024-25 Sec B Q2d — 7 Marks)

Q: Discuss the characteristics and functionalities of auxiliary memories such as magnetic disks, magnetic tapes, and optical disks?

Solution:

  1. Role: auxiliary (secondary) memory is non-volatile, large and cheap per bit; it holds programs and files when main memory loses power.
  2. Magnetic disk: platters, tracks, sectors and moving heads give direct access; used for OS, applications and user files; typical access is milliseconds.
  3. Magnetic tape: a sequential medium read from the beginning; very cheap per GB and ideal for backups and archival, but slow for random retrieval.
  4. Optical disk: laser reads pits/lands on CD, DVD or Blu-ray; ROM is read-only, R is write-once and RW is rewritable; good for software distribution and archives.
  5. Access time on disk: seek + rotational latency + transfer + controller overhead; Trot,avg=30/RPMT_{\text{rot,avg}}=30/\text{RPM} seconds.
  6. Comparison table:
Medium Access Speed Capacity Best use
Disk Direct ms TB Working storage
Tape Sequential s TB cartridge Backup
Optical Direct 100 ms GB Distribution/archive
  1. Conclusion: disks balance speed and capacity for online data, tapes minimise backup cost, and optical media offer portable, durable distribution.

Solved Q3 (2023-24 Sec B Q2d — 7 Marks)

Q: Give classification of memory based on the method of access. Also discuss construction and working of magnetic disk and various components of disk access time.

Solution:

  1. Random access: any word reached directly in constant time — RAM, ROM.
  2. Sequential access: data reached in a fixed order — magnetic tape.
  3. Direct access: address the track/sector then wait for rotation — magnetic disk.
  4. Associative access: content compared in parallel — cache/CAM.
  5. Disk construction: rotating platters divided into tracks and sectors; a head on an actuator arm reads/writes the selected track; same-radius tracks form a cylinder.
  6. Working: CPU/controller sends a logical block address; the arm seeks to the cylinder, the platter rotates until the sector arrives under the head, then the data block is transferred through the controller buffer.
  7. Access-time formula: Taccess=Tseek+30/RPM+(B/Ttransfer rate)+TcontrollerT_{\text{access}}=T_{\text{seek}}+30/\text{RPM}+(B/T_{\text{transfer rate}})+T_{\text{controller}}. Each term is a separate mark: seek, rotation, transfer, overhead.

Solved Q4 (2023-24 Sec C Q6a — 7 Marks | Numerical)

Q: Consider a cache (M1) and memory (M2) hierarchy with following characteristics:\n- M1 : 16K word, 50 ns Access time\n- M2 : 1M word, 400 ns Access time\nAssume 8-word cache blocks and set size 256 words with set associative mapping.\n(i) Show and explain the mapping between M2 and M1.\n(ii) Calculate the effective memory access time with cache hit ratio = 0.95.

Solution:

  1. Cache lines: 16K/8=2048=21116K/8=2048=2^{11} lines.
  2. Associativity: set size 256256 words =256/8=32=256/8=32 lines per set =25=2^5 ways.
  3. Number of sets: 2048/32=64=262048/32=64=2^6 sets.
  4. Address split: M2 has 1M=2201M=2^{20} words → 20-bit address; offset =log⁡28=3=\log_2 8=3 bits; set index =log⁡264=6=\log_2 64=6 bits; tag =20−6−3=11=20-6-3=\mathbf{11} bits. Format: tag(11) | set(6) | word(3).
  5. Mapping rule: block B=⌊A/8⌋B=\lfloor A/8\rfloor of M2 is placed in set B mod 64B\bmod 64; within that set any of the 32 ways may hold it; stored tag =⌊B/64⌋=\lfloor B/64\rfloor. On access, the 6-bit set selects a row of 32 tags, compared in parallel with the 11-bit tag.
  6. EAT (hierarchical): 0.95×50+0.05×(50+400)=47.5+22.5=70 ns0.95\times50+0.05\times(50+400)=47.5+22.5=\mathbf{70\ ns}.
  7. Alternative convention: if M2 is looked up in parallel with M1, the miss cost is 400 ns and EAT =47.5+20=67.5 ns=47.5+20=\mathbf{67.5\ ns}. State the assumption; the hierarchical value 70 ns is the usual answer.

Solved Q5 (2023-24 Sec C Q6b — 7 Marks | Numerical)

Q: Explain the direct mapping technique. Consider a digital computer has a memory unit of 64k×1664k \times 16 and cache memory of 1k words. The cache uses direct mapping with 4 block size of four words.\n(i) How many bits are there in the tag, block and word fields of the address format?\n(ii) How many blocks can the cache accommodate?

Solution:

  1. Direct mapping rule: block jj of main memory is stored only in cache line j mod Lj\bmod L; the tag stores j÷Lj\div L.
  2. Main-memory address: 64k=21664k=2^{16} words → 16-bit word address (word width 16 bits does not change the word-address bit count).
  3. Block/line count: cache =1k=210=1k=2^{10} words; block =4=22=4=2^2 words → L=210/22=28=256L=2^{10}/2^2=2^8=\mathbf{256} cache blocks.
  4. Word offset: log⁡24=2\log_2 4=\mathbf{2} bits select one of four words in the block.
  5. Block/index field: log⁡2256=8\log_2 256=\mathbf{8} bits select the cache line.
  6. Tag field: 16−8−2=616-8-2=\mathbf{6} bits.
  7. Address format: tag(6) | block(8) | word(2); answer (i) 6/8/2 bits, (ii) 256 blocks.

Solved Q6 (2025-26 Sec C Q4b — 7 Marks)

Q: Explain the memory hierarchy with diagram. A memory chip has a capacity of 64K×864K \times 8. (i) Find the number of address lines required. (ii) How many such chips are needed to design a 256K×16256K \times 16 memory system?

Solution:

  1. Hierarchy: registers → cache (SRAM) → main memory (DRAM) → disk → tape/optical; speed and cost per bit fall as capacity rises.
  2. Why it works: temporal locality keeps hot items near the CPU; spatial locality brings whole blocks into the higher level.
  3. Address lines: the chip holds 64K=21664K=2^{16} words, so log⁡2216=16\log_2 2^{16}=\mathbf{16} address lines are needed to select one word.
  4. Word expansion: 256K/64K=4256K/64K=4 chips are needed to reach 256K words.
  5. Bit expansion: 16/8=216/8=2 chips in parallel provide 16 data bits.
  6. Total: 4×2=84\times2=\mathbf{8} chips; four banks of two chips each, with bank selection using the two extra high-order address bits.
  7. Conclusion: the hierarchy gives near-cache speed with disk-like capacity; the chip calculation shows how word and bit expansion combine.

Solved Q7 (2025-26 Sec C Q5b — 7 Marks)

Q: Explain 2D and 212\frac{1}{2}D memory organization. Write their advantages and disadvantages.

Solution:

  1. 2D: cells form a 2k×m2^k\times m matrix; one row decoder selects one row and all mm bits leave through mm sense amplifiers.
  2. 2½D: the address is split into row and column parts; the row decoder activates a whole row but a column decoder/mux selects only the required mm-bit slice.
  3. Advantage of 2D: single decode step, fastest, simplest control.
  4. Disadvantage of 2D: needs mm sense amplifiers and very long rows for large memories, so it scales poorly.
  5. Advantage of 2½D: sense amplifiers are shared, reducing area and power; large arrays are practical.
  6. Disadvantage of 2½D: two decode steps add delay and the decoder/mux logic is more complex.
  7. Conclusion: 2D suits small fast memories (cache); 2½D suits large main memories.

Solved Q8 (2024-25 Sec C Q6a — 7 Marks)

Q: Design and explain the fundamental concept of computer memory hierarchy?

Solution:

  1. Fundamental idea: no single memory technology is simultaneously fastest, largest and cheapest; therefore several levels are combined.
  2. Design: place the smallest/fastest level closest to the CPU and progressively larger/slower/cheaper levels farther away.
  3. Levels: registers, cache (SRAM), main memory (DRAM), magnetic disk/SSD, tape/optical backup.
  4. Locality: temporal locality reuses recent words; spatial locality fetches neighbouring words into a block.
  5. Transfer unit: data moves between adjacent levels in blocks (cache lines, pages, file blocks).
  6. Performance: effective time =hTfast+(1−h)Tslow=hT_{\text{fast}}+(1-h)T_{\text{slow}}; a high hit ratio makes the average close to the fast level.
  7. Conclusion: the hierarchy hides the slowness of large storage while keeping cost per bit low — the central design concept of modern memory systems.

Solved Q9 (2024-25 Sec C Q6b — 7 Marks)

Q: Describe the architecture and operation of semiconductor RAM (Random Access Memory) memories such as DRAM (Dynamic RAM) and SRAM (Static RAM)?

Solution:

  1. SRAM cell: six transistors form a bistable latch; as long as power is applied, the stored bit is held without any refresh.
  2. SRAM operation: word line asserts, bit-line pair senses the latch state; write drivers overpower the latch to store a new value. Non-destructive read.
  3. DRAM cell: one transistor plus one capacitor (1T1C); charge on the capacitor represents the bit.
  4. DRAM operation: word line connects the capacitor to the bit line; a sense amplifier detects the small charge and restores it, so every read is a refresh-like operation.
  5. Refresh: all rows must be refreshed every 16–64 ms; refresh is internal and invisible to the CPU.
  6. Trade-off table:
Parameter SRAM DRAM
Cell / density 6T, low 1T1C, high
Refresh None Required
Speed Fast Slower
Cost per bit High Low
Use Cache Main memory
  1. Conclusion: SRAM buys speed with area, DRAM buys density with refresh overhead; modern machines use both in a hierarchy.

Solved Q10 (2-Mark Cluster — 2023-24 / 2024-25 / 2025-26 Sec A)

Q: Define 2122\frac{1}{2} D memory organization. / Explain the purpose of ROM memories in computer systems? / Write a short note on locality of reference.

Solution (short answers):

  • 2½D: a memory organisation with both row and column decoding; a row is activated and a column multiplexer selects the desired word, reducing the number of sense amplifiers.
  • ROM purpose: non-volatile read-mostly memory for boot firmware, microcode and fixed tables; it retains contents after power-off.
  • Locality: temporal = recently used items are reused; spatial = neighbouring addresses are used next. Together they justify keeping blocks in a cache.

Practice Questions (Self-Test)

  1. (2 Marks) Define memory hierarchy and name its five levels from fastest to slowest.
  2. (2 Marks) What is the difference between random, direct and sequential access? Give one example of each.
  3. (7 Marks) A cache has 8K words, 16-word blocks and 4-way set associativity. Find the tag, set and word field widths if the main memory is 1M words.
  4. (7 Marks) For a cache with hit ratio 0.9, cache time 10 ns and memory time 200 ns, compute EAT under both hierarchical and parallel-probe conventions.
  5. (7 Marks) Compare write-through and write-back policies with a diagram and one traffic example.
  6. (7 Marks) Explain SRAM and DRAM cell operation and tabulate four differences.
  7. (7 Marks) Draw and explain 2D and 2½D organisations; state one advantage and one disadvantage each.
  8. (7 Marks) List PROM, EPROM, EEPROM and flash with their programming and erasure methods.
  9. (7 Marks) A disk rotates at 10,000 RPM with average seek 6 ms and transfers 4 KB at 100 MB/s. Compute its average access time.
  10. (7 Marks) Explain virtual address translation with VPN, page table, TLB and page fault, and write the EAT formula with page-fault rate.