Computer Architecture Senior

1 / 34

What are the trade-offs between fixed-length and variable-length instruction sets regarding decoding complexity and code density?

Select the correct answer

1

Both fixed and variable length decode identically, differing only in the memory they use.

2

Fixed length improves code density while variable length is simpler and faster to decode.

3

Variable length eases pipelining while fixed length always yields the most compact code.

4

Fixed length eases decoding but wastes space; variable length packs code but decodes slower.

What is microcode, and why do modern x86 processors translate complex instructions into micro-operations?

Select the correct answer

1

Microcode breaks complex instructions into simple micro-ops the core executes efficiently.

2

Microcode is firmware on disk that boots the processor before any instructions can run.

3

Microcode is a cache layer that stores decoded instructions to skip fetching them again.

4

Microcode is the compiler pass that converts source code into machine instructions for x86.

What is VLIW architecture, and how does it differ from superscalar out-of-order execution in exploiting instruction-level parallelism?

Select the correct answer

1

VLIW schedules parallel operations in hardware, while superscalar finds parallelism in the compiler.

2

VLIW executes one operation per cycle strictly, while superscalar runs several threads concurrently.

3

VLIW reorders memory accesses dynamically, while superscalar issues instructions strictly in order.

4

VLIW schedules parallel operations in the compiler, while superscalar finds parallelism in hardware.

When would you use fixed-point arithmetic instead of floating-point, and what are the hardware-level trade-offs in terms of complexity and speed?

Select the correct answer

1

Use fixed-point for wider dynamic range and cheaper storage, trading away deterministic rounding behavior.

2

Use fixed-point for larger exponent handling and speed, trading away compact operand encoding widths.

3

Use fixed-point for automatic scaling and higher accuracy, trading away simpler integer arithmetic units.

4

Use fixed-point for deterministic precision and simpler, faster arithmetic, trading away dynamic range.

What are the different IEEE-754 rounding modes, and why does rounding matter for numerical accuracy?

Select the correct answer

1

Nearest (ties to even), toward zero, toward +∞, and toward −∞; the mode controls how much error accumulates.

2

Nearest, floor, ceiling, and modulo rounding; the mode mainly affects arithmetic speed rather than accuracy.

3

Truncate, round half up, round half down, and random rounding; choosing a mode forces the total error to zero.

4

Banker's, statistical, exact, and lossless rounding; picking one guarantees results identical to real arithmetic.

Explain the role of the Reorder Buffer (ROB) in an Out-of-Order processor. How does the CPU ensure that instructions commit in the correct program order even if they execute out of order?

Select the correct answer

1

The ROB schedules ready instructions to execution units out of order and lets each one commit immediately as soon as it finishes.

2

The ROB holds finished instructions in program order and commits their results in that order even though they executed out of order.

3

The ROB stores branch predictions in order and discards them once the correct execution path through the program has been resolved.

4

The ROB caches memory operands in program order so that load and store instructions can bypass the slower data cache entirely.

Why do modern CPUs use Register Renaming? How does it help eliminate False Dependencies (WAR/WAW hazards)?

Select the correct answer

1

It maps architectural registers onto a larger physical set, so name-reuse WAR/WAW dependencies vanish and more instructions run in parallel.

2

It reorders instructions that share a register name at compile time, so the WAR/WAW pairs never appear together inside the pipeline.

3

It stalls instructions that reuse a register name until the prior writer commits, so the WAR/WAW ordering is preserved and made safe.

4

It forwards each result directly between stages, so the reused register name is never read early and every WAR/WAW hazard is bypassed.

What is the difference between 'In-Order' and 'Out-of-Order' execution? What hardware structures (like the Reorder Buffer) are required for Out-of-Order execution?

Select the correct answer

1

Out-of-order skips stalled instructions permanently, using a write buffer to discard results that arrive later than expected

2

Out-of-order fetches instructions backwards from memory, using a branch predictor to reorder the whole instruction stream

3

Out-of-order runs ready instructions early despite program order, using a reorder buffer to retire results in order

4

Out-of-order runs instructions on multiple cores at once, using a shared cache to keep every result globally consistent

What is the goal of Out-of-Order execution, and how does the CPU ensure that the final result is the same as if the instructions ran in order?

Select the correct answer

1

It hides latency by executing independent work early, while in-order retirement commits results and exceptions in program order

2

It saves power by pausing idle units early, while the memory controller replays each store to restore its correct ordering

3

It boosts throughput by duplicating registers early, while the compiler inserts barriers that force results back into order

4

It raises clock speed by shortening pipeline stages, while a checksum unit verifies that outputs match the original ordering

How does Tomasulo's algorithm (or a scoreboard) enable dynamic scheduling of instructions?

Select the correct answer

1

The compiler statically orders instructions so hardware never needs to stall waiting on any pending operand values

2

Reservation stations track operands and register renaming removes false dependencies so instructions issue when ready

3

A lookahead unit precomputes all branch targets so dependent instructions can be dispatched together far ahead of time

4

A central queue forces every instruction to wait for the previous one to fully commit before its operands are read

What is the difference between an inclusive and an exclusive cache hierarchy?

Select the correct answer

1

Inclusive stores each line in only a single level; exclusive duplicates every line across all levels to speed up coherence

2

Inclusive allows only read data to be cached; exclusive allows only writes, splitting the hierarchy strictly by access type

3

Inclusive keeps lower-level data duplicated in higher levels; exclusive holds each line in only one level to save capacity

4

Inclusive bypasses the last-level cache entirely; exclusive routes all data through it to keep every level fully synchronized

What is a TLB, and how does it interact with the L1 cache (e.g., VIPT vs. PIPT)?

Select the correct answer

1

The TLB sits after the L1 cache, so both VIPT and PIPT tag the cache with virtual addresses

2

VIPT waits for the TLB to finish translating before it can index and compare the cache tags

3

PIPT indexes with virtual bits while the TLB translates in parallel, then compares virtual tags

4

VIPT indexes with virtual bits while the TLB translates in parallel, then compares physical tags

When a TLB miss occurs, how does the hardware (MMU) find the correct physical address? Explain the concept of a multi-level page table.

Select the correct answer

1

It walks the multi-level page table, using address bits to index each level down to the final frame

2

It searches the L2 cache for the translation, using address bits to locate the matching frame entry

3

It walks the multi-level page table, storing every possible entry so no memory is ever left unused

4

It interrupts the OS, which linearly scans a single flat table to find the correct frame number

Explain the difference between Virtually Indexed, Physically Tagged (VIPT) and Physically Indexed, Physically Tagged (PIPT) caches. Why does this matter for speed?

Select the correct answer

1

Both translate the address first, but VIPT is faster because it stores larger cache line blocks

2

PIPT overlaps cache indexing with TLB translation, while VIPT must translate before it can index

3

VIPT overlaps cache indexing with TLB translation, while PIPT must translate before it can index

4

VIPT and PIPT both index after translation; the difference is only in how the tags are stored

What is memory interleaving, and how do multiple channels and banks improve memory bandwidth?

Select the correct answer

1

Consecutive addresses are compressed before storage across banks and channels so more data fits, increasing the usable bandwidth.

2

Consecutive addresses are duplicated across multiple banks and channels so failed reads can retry elsewhere, improving reliability.

3

Consecutive addresses are grouped into one bank and channel so accesses stay local, reducing latency but limiting total bandwidth.

4

Consecutive addresses are spread across multiple banks and channels so accesses overlap in parallel, raising effective bandwidth.

Explain the difference between UMA and NUMA architectures. How does NUMA affect software performance in large-scale server environments?

Select the correct answer

1

UMA scales better for large servers because remote access is free, while NUMA forces every access to go through one shared controller

2

UMA and NUMA both provide uniform latency, but NUMA simply adds more channels, so data placement never affects performance at all

3

UMA gives each processor its own local memory bank, while NUMA shares one uniform memory pool with equal latency for all cores

4

UMA gives all processors uniform memory latency, while NUMA has faster local memory, so software should keep data near the accessing CPU

Explain the MESI protocol. Why is it necessary for maintaining cache coherence in multi-core processors?

Select the correct answer

1

MESI marks each line Managed, Exclusive, Stored, or Idle so multiple cores can freely write the same line while hardware merges the written results.

2

MESI copies every write immediately to all caches at once so every core keeps an identical full duplicate of the shared main memory contents.

3

MESI locks the entire cache during any write so that no other core can read memory until the writing core has fully flushed its pending changes.

4

MESI marks each line Modified, Exclusive, Shared, or Invalid so only one core writes a line and others always observe consistent, non-stale data.

What is 'False Sharing' in a multicore system? How does it occur at the hardware level and how can software be optimized to avoid it?

Select the correct answer

1

Independent variables placed on the same cache line cause cross-core invalidations on writes; align or pad data to separate lines to prevent it.

2

Two cores read the same shared variable and stall on its lock; assign each core its own private copy of the variable to remove the contention.

3

A cache line is evicted too early because of limited capacity; increase the cache associativity so that hot lines are retained longer for reuse.

4

One core writes memory another has cached as valid data; disable the cache entirely on that region so all accesses go straight to main RAM.

What is a memory barrier (or fence) at the hardware level, and why is it necessary for correct synchronization in weakly-ordered memory models?

Select the correct answer

1

It pauses all other cores until the current core completes, ensuring that only one memory operation is ever in flight at any given moment.

2

It enforces an ordering constraint on memory operations, stopping hardware or compiler from reordering loads and stores across the barrier.

3

It flushes the entire cache hierarchy back to main memory, guaranteeing every core immediately sees a fully coherent global view of memory.

4

It converts weakly-ordered accesses into atomic transactions, so that grouped reads and writes always commit together as one indivisible unit.

What is the difference between snooping-based and directory-based cache coherence, and when is each appropriate?

Select the correct answer

1

Snooping stores data only in main memory and suits small systems; directory-based caches everything locally and suits very large-scale systems.

2

Snooping keeps a central table of all sharers and suits large systems; directory-based broadcasts on a shared bus and suits only smaller systems.

3

Snooping broadcasts coherence traffic on a shared bus and suits small systems; directory-based tracks sharers in a directory and scales larger.

4

Snooping requires software to manage coherence and suits small systems; directory-based lets hardware manage it and suits many-core systems best.

How does the MOESI protocol extend MESI, and what does the 'Owned' state add?

Select the correct answer

1

Owned forces an immediate writeback to memory whenever any core reads that shared cache line

2

Owned lets one cache hold dirty data and supply it to others without writing back to memory

3

Owned marks a line as exclusive and clean so writes proceed with no bus transaction at all

4

Owned allows two separate caches to both write the same line at once via a locked bus cycle

How do hardware atomic operations like compare-and-swap work, and why are they needed for lock-free synchronization?

Select the correct answer

1

CAS spins in software rereading a value until two consecutive reads return identical results

2

CAS disables all interrupts while it reads then writes a value, so no other core can interfere

3

CAS locks the whole cache line permanently until the owning thread explicitly releases it

4

CAS atomically compares a location to an expected value and updates it only if they match

What is a hardware memory consistency model, and how does sequential consistency differ from relaxed/weak ordering?

Select the correct answer

1

Sequential consistency permits any reordering while relaxed models strictly forbid all reordering

2

Sequential consistency preserves program order globally; relaxed models let loads and stores reorder

3

Sequential consistency requires atomics whereas relaxed ordering by itself guarantees cache coherence

4

Sequential consistency applies only to caches while relaxed models apply only to main memory access

What hardware support enables efficient virtualization, such as Intel VT-x / AMD-V?

Select the correct answer

1

They encrypt all guest memory pages transparently to isolate virtual machines from one another

2

They emulate privileged instructions in microcode so the hypervisor never has to intervene at all

3

They provide extra general-purpose registers dedicated to storing each guest operating system

4

They add a new CPU execution mode that traps privileged guest instructions to the hypervisor

What is an IOMMU, and why is it important for device passthrough and DMA protection in virtualized systems?

Select the correct answer

1

It assigns interrupt priorities to devices so passthrough guests receive their events in fair order

2

It remaps and restricts device DMA addresses, isolating devices and enabling safe passthrough

3

It translates virtual addresses for the CPU cores while devices access physical memory directly

4

It caches device I/O requests in a buffer to speed up repeated DMA transfers into memory

Explain the 'Power Wall.' Why did CPU manufacturers stop aggressively increasing clock speeds around 2005 and move toward multicore designs instead?

Select the correct answer

1

Operating systems could not schedule threads fast enough, so hardware vendors offloaded that work onto multiple parallel cores

2

Memory latency stopped improving, so extra cores were added purely to hide the growing gap between CPU and RAM speeds

3

Silicon transistors reached their absolute physical size limit, making any further single-core frequency gains impossible to achieve

4

Power and heat scale steeply with frequency and voltage, so adding cores became more efficient than pushing clocks higher

Explain the concept of speculative execution. How can this architectural optimization lead to security vulnerabilities like Spectre or Meltdown?

Select the correct answer

1

The CPU runs untrusted code with elevated kernel privileges, allowing that code to directly read protected memory regions without any checks

2

The CPU predicts branches wrongly and permanently corrupts register state, which attackers then read out through timing measurements on the bus

3

The CPU executes instructions ahead of a branch, and side effects on the cache can leak data even after the results are discarded

4

The CPU reorders memory writes so that stale values remain visible, letting one process silently overwrite another process's private data

How does the physical architecture of an SSD (NAND flash) lead to the 'Write Amplification' effect compared to an HDD?

Select the correct answer

1

Flash can only erase in large blocks, so updating small data forces rewriting whole blocks, causing more physical writes than requested

2

Flash lacks a spinning platter, so the controller must recompute parity for every logical page and store multiple redundant copies of it

3

Flash cells slow down as they wear, so the controller duplicates each write across several chips to preserve data before the cells fail

4

Flash reads are destructive, so every read operation triggers an immediate rewrite of the same page back into the original memory location

In the context of modern AI workloads like LLMs, explain why a model might be 'Memory-Bandwidth Bound' rather than 'Compute Bound'.

Select the correct answer

1

Inference must stream huge weight tensors from memory per token, so the GPU idles waiting on data rather than saturating its compute units

2

The batch size is too large for cache, so the GPU repeatedly recomputes activations rather than fetching them from the slower main memory

3

The model has so many layers that the GPU runs out of arithmetic units, so extra weights must queue in memory until compute frees up again

4

Floating-point precision is too high, so the GPU spends most cycles converting formats instead of moving the weight tensors through its cores

What is Gustafson's Law, and how does it offer a more optimistic view of parallel scalability than Amdahl's Law?

Select the correct answer

1

It assumes problem size grows with processors, so the parallel share expands and speedup scales nearly linearly.

2

It assumes communication overhead is negligible, so a fixed workload can be split among unlimited processors freely.

3

It assumes each processor runs at higher clock speed, so total throughput rises faster than Amdahl's fixed model.

4

It assumes the serial fraction shrinks to zero with more processors, so speedup grows without any practical bound.

How does ECC memory detect and correct errors, and what is the idea behind a Hamming code?

Select the correct answer

1

It uses a single parity bit per word that flags any error and then rereads the location until the value stabilizes.

2

It stores a running checksum per word and, when it differs, recomputes the entire block from surrounding cells.

3

It duplicates every stored byte and compares copies, so any mismatch is rewritten from the known-good backup copy.

4

It adds redundant parity bits whose syndrome pinpoints a flipped bit's position, correcting single-bit errors.

What is Dennard scaling, and how did its breakdown contribute to the end of clock-speed scaling?

Select the correct answer

1

Chip cost halves as transistors shrink; its breakdown raised fabrication expense, so vendors froze clock frequency

2

Transistor count doubles as transistors shrink; its breakdown ended density gains, forcing lower clock frequency

3

Cache latency stays constant as transistors shrink; its breakdown slowed memory, limiting achievable clock frequency

4

Power density stays constant as transistors shrink; its breakdown made power per area climb, capping frequency

How does a 2-bit saturating counter branch predictor work, and why is it better than a 1-bit predictor?

Select the correct answer

1

A four-state counter flips on every outcome, so a single anomalous branch is corrected faster than a slow 1-bit scheme

2

A four-state counter stores two target addresses, so a single anomalous branch still finds a cached path without stalling

3

A four-state counter averages the last two outcomes, so a single anomalous branch is smoothed out into one steady guess

4

A four-state counter needs two consecutive misses to flip, so a single anomalous branch does not cause two mispredicts

What is a Branch Target Buffer (BTB), and what problem does it solve in the fetch stage?

Select the correct answer

1

A table mapping targets to counters, letting fetch bias toward the most frequently taken path before decoding

2

A queue holding recently fetched instructions, letting fetch replay them quickly when a branch resolves as taken

3

A cache mapping branch addresses to targets, giving the next fetch address early before the branch is decoded

4

A cache mapping branch addresses to outcomes, telling fetch whether a branch will be taken before it is decoded

Computer Architecture Senior Quiz | TechPrep