Consider a system with a processor and a 4 KB direct mapped cache with block size
of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S
are accessed by the processor in the same order 10 times. That is, there are a total
of 40 memory references in the sequence P, Q, R, S, P, Q, R, S,…
Assume that the cache memory is initially empty. The physical addresses of the
words are given below (1 word =1 byte).
P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32
Which of the following statements is/are true?
Note: 1K=210 and 1M=220
We have a 4 KB direct mapped cache with a 16-byte block size, sitting in front of a 16 MB (\(2^{24}\) byte) physical memory. We need to decode the address of each variable into its tag, line index and block offset, then trace the repeating access pattern P, Q, R, S.
Step 1: Work out the field widths
Number of cache lines = 4096 / 16 = 256 lines.
Offset bits = \(\log_2 16 = 4\) bits (selects a byte inside a 16-byte block).
Index bits = \(\log_2 256 = 8\) bits (selects one of 256 lines).
Tag bits = \(24 - 8 - 4 = 12\) bits (since the address space is 16 MB = \(2^{24}\)).
Step 2: Decode each address
Because each hex digit equals exactly 4 bits, the last hex digit of a 6-digit address is the offset, the next two hex digits form the index, and the remaining three hex digits form the tag.
P = 0x845B32 gives tag = 0x845, index = 0xB3 (179 in decimal), offset = 2.
Q = 0x845B26 gives tag = 0x845, index = 0xB2 (178 in decimal), offset = 6.
R = 0x845B36 gives tag = 0x845, index = 0xB3 (179 in decimal), offset = 6.
S = 0x846B32 gives tag = 0x846, index = 0xB3 (179 in decimal), offset = 2.
Step 3: The key structural observation
P and R have the identical tag (0x845) and identical index (179), so they actually live inside the same 16-byte block, just at different byte offsets (2 and 6). Q lives alone on line 178, which no other variable ever touches. S also maps to line 179 (same index as P and R) but with a different tag (0x846), so S constantly fights with P/R for that one line.
Step 4: Trace the repeating cycle P, Q, R, S
P: In every cycle, S was the access immediately before P (from the previous cycle, or nothing before the very first P). Since S always leaves line 179 holding tag 0x846, when P arrives it never finds its own tag 0x845 there - so P reloads the line every single time. Every access to P is a miss.
R: R always comes immediately after P in the sequence. P has just loaded line 179 with tag 0x845, and R needs that exact tag and index (they are in the same block). So R always finds its data already resident. Every access to R is a hit.
Q: The very first access to Q is a compulsory miss (cache starts empty). After that, since no other variable ever maps to line 178, Q keeps finding its own block there on every later access. So Q is a miss only once, not on every access.
S: S is accessed right after R in each cycle. R access has just re-confirmed that line 179 holds tag 0x845 (P and R's block), so when S (tag 0x846) arrives, it always mismatches and misses - not just on the first access, but every time, because P immediately evicts S's block again on the next cycle.
Step 5: Evaluate the options
Option 1 (every access to P is a miss) - True.
Option 2 (every access to R is a hit) - True.
Option 3 (every access to Q is a miss) - False, only the first access misses.
Option 4 (except the first access, all S accesses hit) - False, every S access is a miss.
Final Answer: Options 1 and 2 are correct, i.e. \[\text{Every access to P is a miss, and every access to R is a hit.}\]
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

Match each addressing mode in List I with a data element or an element of a data
structure (in a high-level language) in List II:
List I
List II
P. Immediate
1. Element of an array
Q. Indirect
2. Pointer
R. Base with index
3. Element of a record
S. Base with offset/displacement 4. Constant
Consider the 8-bit signed integers 𝑋, 𝑌 and 𝑍 represented using the sign-magnitude
form. The binary representations of 𝑋 and 𝑌 are as follows:
𝑋: 10110100 𝑌: 01001100
Which of the following operations to compute 𝑍 result(s) in an arithmetic
overflow?
In a system, numbers are represented using 4-bit two’s complement form. Consider
four numbers 𝑁1 =1011, 𝑁2 =1101, 𝑁3 =1010 and 𝑁4 =1001 in the system.
Which of the following operations will result in arithmetic overflow?
The 32-bit IEEE 754 single precision representation of a number is 0xC2710000.
The number in decimal representation is ________. (rounded off to two decimal
places)
Consider the following two statements about interrupt handling mechanisms in a
CPU.
S1: In non-vectored interrupt mechanism, it usually takes more time to start the
Interrupt Service Routine (ISR) when compared to that in a vectored interrupt
mechanism.
S2: In daisy-chain interrupt mechanism, the CPU polls all the input devices
individually to determine the source of the interrupt.
Which one of the following options is correct with respect to S1 and S2 ?