IITP · Semester ISummaries · Quizzes · Assignments

ECS 5102 — Foundations of Computer Systems

Assignment 3 — Full Question Bank (20 Q, complete options)

Source: IITP\Sem-1\ECS5102-FCS\assignments\assignment-3.md

Topic: layered machine model · priority scheduling & aging · abstraction interfaces · instruction formats · toolchain/assembly · ALU control · datapath conflicts · system-call errors · kernel protection · threading models Questions: 20 (10 MCQ + 10 True/False), full option text Source: class WhatsApp group (Chats/WhatsApp-Cheat-code/chat.md) — posted twice: once as "FCS assignments 3" with only option letters and shuffled options, and once as "Foundations of Computer Systems (FCS) — Complete Question Bank – 20 Questions" with the full text. The two copies are the same 20 questions; the letters differ only because the options were shuffled.

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

If your paper letters differ: answer by option text, not by letter. The copy in the group ("FCS assignments 3") uses C/D/B… where this file uses D/A/…, so a letter-only key will look wrong.


Quick answer key

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

Q1. Layered-Machine Model

A company upgrades its application framework. The new version runs on the same hardware and OS, but its performance changes. The infrastructure team suspects the hardware must have changed.

A. Hardware behaviour can change only when the physical processor is replaced. B. An OS guarantees identical application performance regardless of software changes. C. The application framework executes independently of the OS and all lower layers. D. Software layers can change how system resources are used, even when the underlying hardware remains unchanged.

✅ D. The layered-machine model: each layer offers services to the layer above, so a new framework changes the access pattern to the untouched hardware (more syscalls, more I/O, worse locality). Related: "hardware changed" is the tempting wrong inference — the hardware is a constant here, so the change must be in a software layer.

Q2. Priority Scheduling and Aging

A background reconciliation job starves because higher-priority work keeps arriving. The business needs it to progress eventually while still favouring urgent work.

A. Apply aging by gradually improving the effective priority of work that has waited for a long time. B. Permanently assign the reconciliation job the lowest priority. C. Disable preemption for every process. D. Increase the CPU clock frequency without changing scheduling behaviour.

✅ A — aging. Waiting processes gain priority until they must run. Related: (B) makes starvation permanent; (D) only shortens every wait proportionally and cannot guarantee anything.

Q3. Abstraction Interfaces

An application uses documented OS interfaces rather than hardware registers; it is moved to a different platform with a compatible software environment.

A. Using abstraction interfaces that separate application logic from hardware-specific implementation details. B. Eliminating the OS so the application can talk to every device. C. Hardcoding physical memory addresses throughout the application. D. Requiring every component to implement its own disk controller.

✅ A. The interface is the contract; the platform-specific implementation lives below it. Related: this is the same portability argument as AML Assignment 4 Q2 / FCS Assignment 4 Q2 — abstraction gives source portability, not binary portability.

Q4. Instruction Format

An instruction holds an opcode, register identifiers and a limited operand field; some operations need more information than fits.

A. The instruction format must allocate bits among opcode and operand fields, balancing encoding requirements against available instruction length. B. Every instruction must use all bits to represent a memory address. C. The OS should assign a PID to every operand field. D. The instruction format is determined by the monitor's resolution.

✅ A. Bit-budget trade-off: fixed-length instructions force a split between how many opcodes, how many registers and how large an immediate/displacement can be encoded. Related: this is exactly why x86 has variable-length instructions and RISC-V has fixed 32-bit formats with a small immediate.

Q5. High-Level Language and Machine Code

A developer edits high-level source and submits the text directly to the processor's machine-code interface, without compilation or assembly.

A. The appropriate translation toolchain must convert the source into an executable machine-code representation, with assembly involved where applicable. B. An assembler only manages files. C. The source must be stored on an SSD of a specific capacity first. D. The processor automatically translates high-level source during every instruction fetch.

✅ A. Source → (compiler) → assembly → (assembler) → object code → (linker) → executable. Related: a CPU executes only its ISA's machine encoding; it has no notion of C or Python.

Q6. ALU Control Signals

The ALU receives the correct two operands but performs a logical operation when addition is required.

A. The OS's PID allocation. B. The monitor's refresh frequency. C. The persistent-storage capacity. D. The control signals that select the ALU operation.

✅ D. Operands correct + wrong operation ⇒ the select lines are wrong, i.e. the control unit decoded/asserted the wrong ALU op. Related: the diagnostic split is "data path right, control wrong" — data errors show up as wrong values, control errors as wrong operations on right values.

Q7. Datapath Resource Conflicts

Two independent control paths are allowed to drive the same shared internal resource simultaneously, with no arbitration defined.

A. The instruction set will increase the number of physical CPUs. B. Conflicting control signals may cause an invalid or ambiguous data transfer; the datapath needs coordinated control and resource selection. C. Every register will become permanent storage. D. The OS will be unable to assign PIDs.

✅ B. A shared bus/port needs a single driver at a time — otherwise you get contention, bus fights or an undefined value. Related: this is why real datapaths have multiplexers and a central control unit, and why multi-master buses need arbitration.

Q8. System Call Error Handling

A Linux service fails to open a configuration file but continues as if it had succeeded.

A. Check the system call's return value, handle the error, and avoid using a resource that was not successfully acquired. B. Ignore the return value because system calls always succeed. C. Replace every system call with a CPU instruction. D. Restart the CPU whenever a file operation fails.

✅ A. open() returns −1 and sets errno; using the returned descriptor without checking is undefined behaviour. Related: this is the C-level version of "always check the return value" — the same reasoning as FCS Assignment 4's Q about syscall error handling.

Q9. Operating-System Protection

An application tries to change protected OS state directly instead of using a kernel interface.

A. User applications should use authorized system-call interfaces so the kernel can enforce access controls and protect resources. B. Every application should get unrestricted kernel privileges. C. Use the PID as a replacement for access-control checks. D. Bypass the OS whenever shared resources must be modified.

✅ A. The user/kernel mode boundary is what makes protection enforceable. Related: (B) removes the mechanism entirely; (C) confuses an identifier with a permission.

Q10. Many-to-One Threading Model

Many user threads are mapped onto a single kernel-scheduled entity; one thread blocks and the others stall.

A. The scheduler will promote every user thread to a separate process. B. All user threads necessarily run simultaneously on separate cores. C. In a many-to-one model, a blocking operation that blocks the single underlying kernel entity can prevent the other mapped user threads from progressing. D. The process must have lost its address space.

✅ C. Because the kernel sees only one schedulable entity, a blocking syscall in one user thread blocks all of them. Related: that is why the one-to-one model (each user thread = one kernel thread) is the default on Linux/Windows today.

Q11. Software Component Interface

A lower-level component's implementation is replaced while the interface contract is preserved; the application may keep working without source changes.

✅ True. That is the point of an interface contract.

Q12. CPU Utilisation and Performance

CPU utilisation dropped after a deployment, so the application must be faster and more responsive.

✅ False. Lower CPU use may mean the app is now waiting more — on I/O, locks, or a network dependency. Utilisation is not latency. This is the classic "idle CPU but slow app" case.

Q13. Instruction Set Architecture

Two processors implement the same ISA and comply with the same architectural requirements; a correctly compiled binary for that ISA should be compatible with both, given compatible execution environments and required features.

✅ True. The ISA is the binary contract. Related: same ISA but missing an optional extension (e.g. AVX-512, or a newer instruction) can still fail — hence "required features".

Q14. Assembly Instructions and Clock Cycles

Two assembly instructions have different mnemonics, so one must always take more clock cycles on every processor implementing the same ISA.

✅ False. Cycle counts are microarchitectural, not architectural. The same instruction takes different cycles on different implementations (and even on cache hits vs misses).

Q15. CPU Datapath and Control Logic

Registers, ALU and data paths alone determine every instruction's behaviour, so control logic is unnecessary.

✅ False. The datapath can move and combine values; the control unit decides which operation, which registers, and when. Without it every component would act simultaneously and unconditionally.

Q16. Register-Based Instructions

An instruction operates exclusively on values already in registers; an engineer claims it must access main memory to retrieve its operands.

✅ False. Register operands are read from the register file inside the datapath; no memory access is involved. (Same reasoning as FCS Assignment 4 Q7.)

Q17. Operating-System Interfaces

Using documented OS interfaces instead of manipulating kernel data structures makes an application easier to maintain across compatible OS environments.

✅ True. The documented ABI is stable; internal structures change between versions.

Q18. Linux System Calls

Every failed file-related system call automatically terminates the calling process.

✅ False. Ordinary failures return an error code (−1 + errno); the process decides what to do. Only signals (e.g. SIGSEGV) or an explicit exit() terminate it.

Q19. Multithreading and Shared Memory

Threads of one process update a shared configuration object; the team assumes sharing an address space automatically guarantees safe access.

✅ False. Sharing an address space is exactly why synchronisation is needed — atomicity and memory-visibility are not provided by sharing. (Same as FCS Assignment 4 Q10.)

Q20. Round Robin Scheduling

The team assumes a smaller time quantum will always improve overall system performance.

✅ False. A smaller quantum improves responsiveness but increases context-switch overhead; below a point, throughput falls. There is an optimum.