IITP · Semester ISummaries · Quizzes · Assignments

ECS 5102 — Foundations of Computer Systems

Quiz 1 — Question Bank (20 Q, full options)

Source: IITP\Sem-1\ECS5102-FCS\Quiz\quiz-1-question-bank.md

Topic: program loading & memory hierarchy · MAR/MDR · register write-back · PC/IR · process states · PID/PPID · stack vs heap · file syscalls · pipe/mmap · credentials · ALU · translation chain · instruction categories · register pressure · mnemonics vs machine code · flag register Source: class WhatsApp group (Chats/WhatsApp-Cheat-code/chat.md), 20-question FCS quiz (14 Nov 2026).

Verification: ✅ all 20 re-derived — all correct.

Group shortcut that was posted with it: "except Q5, the correct answers are usually the longest option" — true here (13 of 20), but do not rely on it; Q5 and the True/False items break the pattern.


Quick answer key

Q Ans Q Ans Q Ans Q Ans
1 C 6 C 11 B 16 A
2 C 7 C 12 C 17 B
3 A 8 A 13 A 18 C
4 C 9 C 14 D 19 C
5 B 10 B 15 A 20 C

Q1. Why can't the CPU execute a program directly from the SSD file?

A. The CPU can execute only after the entire SSD is copied into registers. B. The OS converts every instruction into a keyboard event. C. The SSD stores the executable permanently; execution requires instructions and working data to be brought through the memory hierarchy. D. The SSD cannot store executable instructions.

✅ C. The ISA defines memory operands, not storage-device operands — there is no "execute from SSD" instruction. The loader maps the executable into the address space, and pages are fetched on demand. Related: (D) is false — an SSD absolutely stores executables; it just is not directly addressable by the CPU.

Q2. Which register pair is most relevant to the conventional memory-read sequence?

A. PC and status/flags B. Stack pointer and PID C. MAR and MDR D. ISA and microarchitecture

✅ C. The address goes into the Memory Address Register, the fetched value comes back in the Memory Data Register. Related: PC/IR belong to instruction fetch; MAR/MDR belong to any memory access — which is exactly the distinction the question is testing.

Q3. The ALU produces the right value, but the destination register still holds its old value. Investigate?

A. Whether the result was transferred to and written into the intended destination register. B. Whether the OS assigned a different PID. C. Whether the monitor font is correct. D. Whether the app was installed on a larger SSD.

✅ A. Execution succeeded; the write-back stage failed (wrong destination select, write-enable not asserted, or a hazard). Related: this is the mirror of FCS Assignment 3 Q6 — there the operation was wrong with right operands; here the operation is right but the result is not committed.

Q4. One register identifies where the next instruction is; another holds the fetched instruction. Correct interpretation?

A. Both permanently store the same bytes. B. PC stores output; IR stores PID. C. The Program Counter identifies the fetch address, while the Instruction Register holds the fetched instruction for decoding. D. IR stores the next address; PC stores the instruction.

✅ C. PC → address; IR → the instruction word itself. Related: (D) swaps the two — the single most common confusion in this topic.

Q5. One process is runnable and waiting for CPU; another is waiting for disk data. Classify them.

A. Both Running B. First Ready, second Waiting/Blocked C. Both Terminated D. First Waiting, second Ready

✅ B. Ready = able to run, not currently on a CPU. Blocked/Waiting = cannot run until an event (I/O completion) occurs. Related: the run queue holds Ready processes; the wait queue holds Blocked ones.

Q6. Which information identifies a helper process and its creator?

A. opcode and destination register B. stack and heap size C. PID and PPID D. open-file list and CPU registers

✅ C. PID identifies the process; PPID identifies its parent. Related: this is what ps -o pid,ppid,cmd shows and how you reconstruct the process tree.

Q7. Dynamically created objects account for most of a growing process's memory. Which region?

A. PC B. code/text C. heap D. PID

✅ C — heap. malloc/new allocate there; the stack holds frames, locals and return addresses and does not grow with the object count. Related: brk()/sbrk() and mmap() extend the heap in Linux.

Q8. File-processing utility — basic file-system-call workflow?

A. open() → read() → write() → close() B. getpid() → uname() → fork() → exit() C. pipe() → socket() → wait() → exec() D. mmap() → brk() → getpid() → uname()

✅ A. Acquire (open), use (read/write), release (close). Related: leaking descriptors is exactly the bug described; each open() consumes a process-level slot.

Q9. Two processes on the same machine, one produces events, the other consumes them. Most direct mechanism?

A. brk() B. uname() C. pipe() D. getpid()

✅ C — pipe(). A unidirectional byte stream between related processes on the same host. Related: socket() is needed only across machines (or for unrelated processes); mmap() of a shared segment is the other local option.

Q10. Access a large file through a memory-mapped region so contents can be addressed through memory operations. Which syscall?

A. wait() B. mmap() C. getpid() D. uname()

✅ B — mmap(). It maps file pages into the process's virtual address space; brk() adjusts the data-segment break, which is a different thing. Related: after mapping you read/write with ordinary loads and stores; page faults bring the data in.

Q11. Read succeeds on a public file but access is denied on a restricted file. Which process information is relevant?

A. Stack return addresses B. The credentials — user/group identity and privileges C. The PC alone D. Heap size

✅ B. Permission checks use the process's effective UID/GID and capabilities. Related: this is why sudo (changing the effective UID) changes what is accessible, while copying the binary elsewhere does not.

Q12. Sensor → calculate → display. Which correction of "the CPU does everything" is right?

A. Sensor calculates, RAM displays, CPU stores B. SSD calculates, CPU just transfers C. I/O components acquire/communicate data, the CPU processes instructions, memory supports computation, output components present results D. The CPU does input, output, storage and processing alone

✅ C. The von Neumann decomposition: input, memory, processing, output — with the CPU as processor, not as everything.

Q13. A worker completes and terminates; the parent still needs to account for it. Which explanation fits?

A. The worker enters a terminated state; the OS handles resource cleanup, and the parent may need to collect the termination status. B. The PID becomes a file descriptor in the heap. C. The worker becomes a new parent. D. The worker stays Running forever.

✅ A. Until the parent calls wait()/waitpid() the entry stays as a zombie (terminated, status uncollected). Related: if the parent dies first, the child is reparented to init and reaped there.

Q14. Which component directly performs arithmetic and logical operations?

A. SSD B. Storage controller C. Display controller D. ALU

✅ D — the ALU, inside the CPU datapath.

Q15. Hardware upgraded, same app/OS; the app still works. Which conclusion captures hardware–software relation?

A. Hardware provides the mechanisms for computation; software specifies the operations and behaviour. B. Applications are merely stored data. C. Hardware understands the business requirements. D. Software is unnecessary given enough processing power.

✅ A.

Q16. Conceptual translation from a programmer's requirement to processor execution?

A. High-level program → lower-level operations, represented through assembly and machine instructions B. Assembly → requirement → storage → high-level C. Requirement → SSD sectors → cache → source code D. Machine instructions → requirement → assembly → high-level

✅ A. The tools go source → compiler → assembly → assembler → linker → loader → execution.

Q17. A value must be moved from one location to another without arithmetic. Which instruction category?

A. Control-flow B. Data-movement (load/store/move) C. Comparison D. Arithmetic

✅ B. Moving bits is not arithmetic; using ADD to move data also destroys the carry/overflow flags and is slower. Related: this is why ISAs have a dedicated MOV/LD/ST family.

Q18. More simultaneously live values than general-purpose registers. Appropriate response?

A. Remove the ISA and let the app pick physical register addresses B. Assume unlimited architectural registers C. Recognise the constraint and let the compiler manage values via register allocation and, where necessary, memory spills D. Store all intermediates permanently on SSD

✅ C — spilling. The allocator keeps the hottest values in registers and writes the rest to the stack frame. Related: spills are a major source of extra memory traffic; "register pressure" is the term.

Q19. A developer assumes an assembly mnemonic is the binary representation executed directly by the processor.

A. Mnemonics are interpreted directly by hardware B. Every mnemonic is already a complete machine instruction C. A mnemonic is a human-readable representation of an operation; an assembler translates it into the machine encoding D. Machine instructions contain only data, so opcodes are unnecessary

✅ C.

Q20. A comparison executes but the following conditional takes the wrong path; the status information does not reflect the expected condition. Investigate?

A. SSD capacity B. Monitor refresh rate C. The status/flag-register behaviour and how the conditional interprets those flags D. The executable's filename

✅ C. Conditionals branch on flags (Z, N, C, V); a wrong flag write-back or a wrong condition code sends execution down the wrong path. Related: on x86 this is the EFLAGS register; the mnemonic JZ tests ZF.