✅ 1. CACHE MAPPING NUMERICAL (Direct Mapping)
Q1.
A computer has:
-
Main memory = 4K words
-
Cache = 128 words
-
Block size = 4 words
Find:
-
No. of blocks in main memory
-
No. of lines in cache
-
Mapping of memory block 205 to cache line.
Solution
1) Blocks in main memory
Main memory size = 4K = 4096 words
Block size = 4 words
2) Cache lines
Cache size = 128 words
Block size = 4 words
3) Mapping of block 205
✔ Answer:
Block 205 maps to cache line 13.
✅ 2. SET-ASSOCIATIVE CACHE NUMERICAL
Q2.
8 KB cache, block size = 64 bytes, 4-way set associative.
Find number of sets.
Solution
Cache size = 8 KB = 8192 bytes
Block size = 64 bytes
1 set has 4 blocks (because 4-way).
Total blocks =
No. of sets =
✔ Answer:
32 sets
✅ 3. MEMORY INTERLEAVING
Q3.
A system has 4 memory banks using lower-order interleaving.
Words are stored starting from address 0.
Find the bank number for address: 37.
Solution
Lower-order interleaving:
Here:
37 mod 4 = 1
✔ Answer:
Address 37 is in Bank 1.
✅ 4. EFFECTIVE ACCESS TIME (EAT)
Q4.
Hit ratio = 90%
Cache access time = 10 ns
Main memory access = 100 ns
Find EAT.
Solution
Hit ratio = 0.9
Miss ratio = 1 – 0.9 = 0.1
✔ Answer:
19 ns
✅ 5. PIPELINE THROUGHPUT
Q5.
A pipeline has 5 stages, each taking 20 ns.
Calculate time to execute 10 instructions.
Solution
k = stages = 5
T = 20 ns
n = instructions = 10
✔ Answer:
280 ns
✅ 6. BINARY → EXCESS-3 NUMERICAL
Q6.
Convert 75 (decimal) into Excess-3 code.
Solution
Digits: 7 and 5
Step 1 → Convert to BCD:
7 → 0111
5 → 0101
Step 2 → Add 3 (0011) to each:
✔ Answer:
75 = 1010 1000 (Excess-3)
✅ 7. BINARY MULTIPLICATION (Booth’s Algorithm)
Q7.
Multiply: (+7) × (−3) using Booth’s algorithm.
(Short exam-style solution.)
Solution Summary
7 = 0111
−3 = 1101 (2’s complement)
Perform Booth steps → final answer:
✔ Answer:
(+7) × (−3) = −21
Binary result: 1010 1011
✅ 8. ADDRESSING MODE NUMERICAL
Q8.
Effective address = ?
Instruction: MOV A, M
HL register pair = 2050H
Solution
Indirect addressing:
Address = content of HL.
✔ Answer:
EA = 2050H
✅ 9. MEMORY SIZE CALCULATION
Q9.
How many bytes in a memory with 16-bit address bus?
Solution
No. of addressable locations =
Each location stores 1 byte.
✔ Answer:
64 KB
✅ 10. CACHE TAG CALCULATION
Q10.
Find tag, set, and block offset for:
-
Cache = 4 KB
-
Block size = 32 bytes
-
2-way associative
-
16-bit address
Solution Steps
-
Cache size = 4096 bytes
Block size = 32 →
Blocks = 4096 / 32 = 128 blocks -
2-way set associative →
Sets = 128 / 2 = 64 sets -
Set bits = log₂(64) = 6 bits
-
Offset bits = log₂(32) = 5 bits
-
Tag bits = 16 – (6 + 5) = 5 bits
✔ Final Answer:
-
Tag = 5 bits
-
Set = 6 bits
Offset = 5 bits