Computer Architecture Expert

1 / 123

What does Moore's Law actually state conceptually, and is it still relevant today?

Select the correct answer

1

Memory capacity per dollar always halves every two years; this economic law still guides all chip design.

2

Transistor count on a chip roughly doubles every two years; scaling has slowed but remains relevant.

3

CPU clock speed roughly doubles every two years; this has fully held and continues without any slowdown.

4

Processor performance exactly doubles every eighteen months; it stopped being true right after year 2000.

What does it mean for a processor to be '64-bit'? Specifically, what hardware resources are actually 64 bits wide?

Select the correct answer

1

General-purpose registers and the ALU/address paths are 64 bits wide, so integers and pointers are 64-bit.

2

The floating-point registers alone are 64 bits wide, so only double-precision math uses the full word size.

3

The instruction encodings are all 64 bits wide, so each machine instruction occupies a full 64-bit word.

4

The system memory bus and every cache line are 64 bits wide, so each fetch moves exactly 64 bits of data.

What is the stored-program concept, and why was it a foundational idea in computer architecture?

Select the correct answer

1

Instructions are hardwired into circuits while only data is kept in main memory.

2

Instructions and data share one memory, so code can be loaded and modified freely.

3

Each program keeps its instructions in a separate read-only memory from its data.

4

Programs run directly from external storage without ever loading into main memory.

What is an Instruction Set Architecture, and why is it described as the contract between hardware and software?

Select the correct answer

1

It is the operating system layer that translates programs into signals for the hardware.

2

It describes the wiring of the memory bus so peripherals can communicate with the CPU.

3

It defines the instructions and registers software uses and hardware must implement.

4

It specifies the exact transistor layout that every compatible processor chip contains.

Give an overview of the memory hierarchy from registers to secondary storage and explain the latency/capacity/cost trade-offs at each level.

Select the correct answer

1

Moving from registers to disk, both capacity and speed increase while cost per byte rises.

2

Moving from registers to disk, capacity grows while speed rises and cost per byte rises.

3

Moving from registers to disk, capacity shrinks while speed rises and cost per byte falls.

4

Moving from registers to disk, capacity grows while speed and cost per byte both fall.

What is a word in computer architecture, and how does word size relate to the ALU, registers, and data bus width?

Select the correct answer

1

A word is the CPU's natural data unit, usually matching register, ALU, and bus width.

2

A word is always eight bits regardless of the register, ALU, or data-bus width used.

3

A word is the width of the address bus, which sets how much memory can be used.

4

A word is the smallest addressable memory cell, unrelated to register or bus width.

What is the primary difference between RISC and CISC? Why has the industry largely shifted toward RISC-like internals even for CISC ISAs like x86?

Select the correct answer

1

RISC always uses fewer registers; x86 adopted this to simplify its backward-compatible assembly.

2

RISC has more instructions overall; x86 chips now emulate them fully in a dedicated microcode ROM.

3

RISC uses simple fixed-length instructions; x86 decodes complex instructions into simpler internal micro-ops.

4

RISC runs at higher clock speeds; x86 shifted internally to reduce total transistor count and cost.

Explain the von Neumann bottleneck. How do modern CPU features like caches and prefetching attempt to mitigate it?

Select the correct answer

1

The mismatch between CPU and disk speeds stalls programs; caches and prefetching hide this latency fully.

2

The fixed instruction width wastes memory bandwidth badly; caches and prefetching compress the code stream.

3

The single shared path between CPU and memory limits throughput; caches and prefetching cut accesses.

4

The limited number of CPU registers forces spills to memory; caches and prefetching add register banks.

Explain the difference between von Neumann and Harvard architectures. Why do modern high-performance CPUs often use a 'Modified Harvard' approach?

Select the correct answer

1

Harvard uses one memory for everything faster; Modified Harvard adds a second slower memory for backups.

2

Von Neumann needs two clocks per access always; Modified Harvard runs both instruction fetches in parallel.

3

Von Neumann shares one memory for code and data; Modified Harvard splits caches but shares main memory.

4

Von Neumann splits code and data buses; Modified Harvard merges them to reduce total pin count needs.

What is the conceptual difference between Instruction Set Architecture (ISA) and Microarchitecture (Organization)? Why can two different processors run the same software but have different performance?

Select the correct answer

1

ISA is the physical chip layout; microarchitecture is the abstract model, so the same code runs slowly.

2

ISA is the instruction contract; microarchitecture is how it's built, so implementations differ in speed.

3

ISA defines clock frequency limits; microarchitecture defines the software, so performance varies by compiler.

4

ISA is the operating system layer; microarchitecture is the transistor process, so newer nodes run faster.

Beyond just 'more memory,' what are the architectural advantages of a 64-bit ISA over a 32-bit ISA (e.g., register pressure, instruction capabilities)?

Select the correct answer

1

64-bit ISAs guarantee out-of-order execution support, mainly improving branch prediction accuracy overall.

2

64-bit ISAs expose more and wider registers, easing register pressure and enabling larger operations.

3

64-bit ISAs double the clock rate and cache size, mainly cutting the number of pipeline stall cycles.

4

64-bit ISAs add fixed-length instructions and remove microcode, mainly simplifying the instruction decoder.

What are the fundamental philosophy differences between RISC (like ARM/RISC-V) and CISC (like x86), and why has the industry shifted toward RISC for mobile and increasingly for servers?

Select the correct answer

1

CISC favors simple uniform instructions and lower power, so it dominates the small mobile device market.

2

RISC favors complex multi-step instructions and compatibility, so servers keep choosing it for raw speed.

3

RISC favors variable-length dense encoding and legacy support, giving it a clear edge in energy per task.

4

RISC favors simple uniform instructions and power efficiency, winning in mobile and now dense servers.

What are the main categories of instructions in a typical ISA (arithmetic/logic, data movement, control flow)?

Select the correct answer

1

Register access, cache control, and interrupt handling routines.

2

Arithmetic/logic, data movement, and control flow operations.

3

Integer math, floating math, and vector processing operations.

4

Fetch, decode, and execute stages of the processor pipeline.

What does it mean for an architecture to be 'Load-Store', and how does this differ from an architecture that allows memory operands in arithmetic instructions?

Select the correct answer

1

Every arithmetic instruction reads and writes memory without using any registers at all.

2

Arithmetic instructions may read memory operands directly but cannot write to memory.

3

Only load and store instructions touch memory; arithmetic works purely on registers.

4

Loads and stores are combined with arithmetic into single instructions for operands.

Explain the difference between a register-based architecture and a stack-based architecture. Which one do modern physical CPUs typically use and why?

Select the correct answer

1

Stack machines address operands explicitly; modern CPUs use them for simpler compact code.

2

Stack machines keep operands in named registers; modern CPUs prefer them for easy decoding.

3

Register machines push operands onto a stack; modern CPUs avoid them due to complexity.

4

Register machines address operands explicitly; modern CPUs use them for speed and reordering.

How is an instruction encoded into fields like opcode and operands, and why does encoding design matter?

Select the correct answer

1

Opcode names the operation, operand fields name the data; encoding sets code density and decode speed.

2

Opcode names the register, operand fields name the address; encoding sets cache hit rates and latency.

3

Opcode names the pipeline stage, operand fields name the ports; encoding sets clock frequency and power.

4

Opcode names the data type, operand fields name the offsets; encoding sets branch prediction accuracy.

How does the hardware stack support procedure calls and returns, and what is a calling convention?

Select the correct answer

1

The stack saves return addresses and registers; a calling convention defines argument and register rules.

2

The stack saves cache lines and page tables; a calling convention defines interrupt and priority rules.

3

The stack saves opcode fields and flags; a calling convention defines memory alignment and paging rules.

4

The stack saves branch targets and counters; a calling convention defines pipeline and hazard rules.

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.

Explain the difference between Big-Endian and Little-Endian. In what scenario would a software engineer need to be explicitly aware of the underlying hardware's endianness?

Select the correct answer

1

Big-endian stores the least significant byte first; endianness matters when allocating dynamic heap memory locally.

2

Big-endian stores the parity byte first; endianness matters when translating virtual addresses inside the CPU.

3

Big-endian stores the sign bit byte first; endianness matters when performing floating-point rounding in registers.

4

Big-endian stores the most significant byte first; endianness matters when exchanging binary data across systems.

What is Two's Complement, and why is it preferred over Sign-Magnitude for representing signed integers in hardware?

Select the correct answer

1

Shift bits left by one for negatives; it gives one zero but needs separate subtract hardware.

2

Flip only the sign bit for negatives; it gives two zeros but unifies add/subtract hardware.

3

Add a bias constant for negatives; it gives two zeros and needs separate compare hardware.

4

Invert bits and add one for negatives; it gives one zero and unifies add/subtract hardware.

What is integer overflow, and what happens at the hardware level when a signed integer addition overflows?

Select the correct answer

1

The extra high bits are placed in a separate register so the full wide result can still be recovered.

2

The result saturates at the maximum representable value and the carry flag is left unchanged.

3

The result wraps around modulo 2^n, and the overflow flag is set when the sign bit comes out wrong.

4

The CPU raises a hardware exception that halts the program before any incorrect value can be stored.

What is the difference between one's complement and two's complement representations?

Select the correct answer

1

Two's complement uses a sign-magnitude form, whereas one's complement adds a fixed bias to shift the value range.

2

One's complement negates by inverting bits and adding one, while two's complement only inverts, yielding a single zero.

3

Two's complement negates by inverting bits and adding one, giving one zero; one's complement just inverts, giving two zeros.

4

Both invert all bits, but two's complement stores the sign in a separate flag and one's complement does not do that.

Explain why 0.1 + 0.2 does not equal 0.3 in most systems. How does the IEEE-754 standard represent a floating-point number (sign, exponent, mantissa)?

Select the correct answer

1

They round toward zero by default, so bias occurs; IEEE-754 stores flag, magnitude, and length fields.

2

They lack an exact binary form, so rounding occurs; IEEE-754 stores sign, exponent, and mantissa.

3

They exceed the register width limit, so truncation occurs; IEEE-754 stores base, offset, and remainder.

4

They use decimal not binary encoding, so overflow occurs; IEEE-754 stores digit, scale, and precision.

How does hardware distinguish between signed and unsigned integers, and how does that affect comparison and arithmetic instructions?

Select the correct answer

1

Signed values reserve an extra bit outside the word, so they occupy a wider register than unsigned values do.

2

The ALU tags every value with a type at load time, and each unit reads that tag before it operates on it.

3

A dedicated sign flag inside each register marks whether the value stored there should be treated as signed.

4

The bits are identical; the chosen instructions (signed vs unsigned compares, sign vs zero extension) fix the interpretation.

How does IEEE-754 represent special values like NaN, positive/negative infinity, and denormalized (subnormal) numbers?

Select the correct answer

1

NaN is max exponent with zero mantissa; infinity is max exponent with nonzero mantissa; subnormals use a max exponent field throughout.

2

Infinity is zero exponent with max mantissa; NaN is zero exponent with zero mantissa; subnormals are encoded using only the sign bit.

3

Subnormals are max exponent with zero mantissa; infinity uses a zero exponent; NaN is any value whose sign bit has been set to one.

4

Infinity is max exponent with zero mantissa; NaN is max exponent with nonzero mantissa; subnormals are zero exponent with nonzero mantissa.

What is the exponent bias in IEEE-754, and why is a biased representation used for the exponent?

Select the correct answer

1

The exponent is stored in two's complement, and the bias corrects the sign so the hardware can add exponents faster.

2

A fixed constant is added to the exponent so it is stored unsigned, letting plain integer comparison order floats correctly.

3

A fixed constant is subtracted from the mantissa so that very small numbers can be encoded without losing precision bits.

4

A scaling factor multiplies the exponent so that one shared encoding can cover both single and double precision formats.

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.

What is the conceptual difference between throughput and latency, and why can optimizing one hurt the other?

Select the correct answer

1

Latency is the queue length and throughput is the queue depth; reducing either just requires adding parallel execution units.

2

Latency is time per single task; throughput is tasks per unit time; batching or pipelining can raise one while hurting the other.

3

Latency measures memory bandwidth while throughput measures clock speed; tuning cache size trades one against the other.

4

Latency is tasks completed per unit time; throughput is the time per single task; the two always improve together in hardware.

What is the difference between combinational and sequential logic circuits?

Select the correct answer

1

Combinational circuits use a clock signal, while sequential circuits are purely asynchronous and hold no internal state.

2

Combinational output depends on stored state, while sequential output depends only on the present inputs at each moment.

3

Combinational circuits contain flip-flops for memory, whereas sequential circuits are built only from gates and wires.

4

Combinational output depends only on current inputs; sequential output also depends on stored state, so it has memory.

What is a multiplexer, and how is it used in a CPU datapath?

Select the correct answer

1

A circuit that adds several inputs into one output value, used to combine partial sums in the adder

2

A circuit that stores selected inputs across clock cycles, used to buffer operands entering the pipeline

3

A circuit that splits one input into several outputs by address, used to fan control signals through logic

4

A circuit that selects one of several inputs based on select lines, used to route sources into a datapath

What is an ALU, and what basic operations does it perform in the datapath?

Select the correct answer

1

A memory unit fetching operands from locations such as caches, registers, stacks, and buffers

2

A combinational unit performing arithmetic and logic operations such as add, subtract, AND, and OR

3

A sequential unit storing intermediate results such as flags, carries, operands, and pending writes

4

A control unit decoding instructions into signals such as reads, writes, jumps, and stalls

What is a register file, and how is it accessed during instruction execution?

Select the correct answer

1

A stack of return values read through the top pointer and written through push logic during calls

2

An array of registers read through source ports and written through a destination port during execution

3

A block of cached memory read through the address bus and written through the data bus during fetch

4

A set of status flags read through the control unit and written through the ALU during decode

What is the difference between a latch and a flip-flop, and why do synchronous designs prefer flip-flops?

Select the correct answer

1

A latch is level-sensitive while a flip-flop is edge-triggered, so flip-flops sample data at defined clock edges

2

A latch is asynchronous while a flip-flop is combinational, so flip-flops react faster to input changes

3

A latch is edge-triggered while a flip-flop is level-sensitive, so flip-flops hold data during clock pulses

4

A latch stores multiple bits while a flip-flop stores one bit, so flip-flops save area in register files

What is propagation delay, and how does it determine the maximum clock frequency of a circuit?

Select the correct answer

1

The time a register needs to reset its state; the total gate count sets the achievable clock period

2

The time a signal stays stable at a gate; the shortest such path sets the maximum clock period

3

The time between two consecutive clock edges; the average path length sets the usable clock period

4

The time for a signal to travel through logic; the longest such path sets the minimum clock period

What role does the clock signal play in a synchronous processor, and what is clock skew?

Select the correct answer

1

It synchronizes state updates across elements; skew is the difference in clock arrival times between them

2

It selects which instruction executes next in order; skew is the delay added by a mispredicted branch path

3

It counts the cycles used by each executed instruction; skew is the gap between issued and retired counts

4

It supplies operating power to the logic elements; skew is the variation in voltage delivered to each one

What is the difference between a hardwired control unit and a microprogrammed (microcode) control unit?

Select the correct answer

1

Hardwired executes only reduced instructions directly; microprogrammed executes only complex ones in software

2

Hardwired decodes instructions during compilation; microprogrammed decodes them entirely at runtime instead

3

Hardwired generates control signals with fixed logic gates; microprogrammed reads them from control memory

4

Hardwired reads control signals from stored memory; microprogrammed generates them with fixed logic gates

What is the difference between a single-cycle and a multi-cycle datapath, and what are the trade-offs?

Select the correct answer

1

Single-cycle overlaps several instructions per cycle; multi-cycle issues only one instruction across many cycles

2

Single-cycle runs each instruction in one long cycle; multi-cycle splits work into shorter cycles reusing units

3

Single-cycle uses microcode for each cycle step; multi-cycle uses hardwired logic to finish in one fixed cycle

4

Single-cycle splits work into shorter cycles reusing units; multi-cycle runs each instruction in one long cycle

Walk through the classic 5-stage RISC pipeline (Fetch, Decode, Execute, Memory, Write-back). What happens at each stage?

Select the correct answer

1

Fetch reads the instruction, Decode reads registers, Execute runs the ALU, Memory accesses data, Write-back stores the result.

2

Fetch reads registers, Decode runs the ALU, Execute reads the instruction, Memory writes back, Write-back accesses data memory.

3

Fetch runs the ALU, Decode accesses data memory, Execute reads registers, Memory writes back, Write-back reads instructions.

4

Fetch decodes the opcode, Decode accesses memory, Execute writes registers, Memory fetches data, Write-back runs the ALU.

What are the three types of pipeline hazards? Provide a specific example of a 'Data Hazard' and how the hardware resolves it using 'Forwarding' (Bypassing).

Select the correct answer

1

Data, control, and cache hazards; forwarding flushes the pipeline and refetches the stalled dependent instruction from main memory.

2

Structural, logical, and input/output hazards; forwarding duplicates the register file so two stages can read one value.

3

Timing, memory, and branch hazards; forwarding delays the dependent instruction until the register file has finally been updated.

4

Structural, data, and control hazards; forwarding routes an execution result directly to a later instruction's input before write-back.

Explain the concept of instruction pipelining. How does it improve throughput without necessarily decreasing latency?

Select the correct answer

1

Running independent instructions on separate cores in parallel raises throughput while the single-core latency of each instruction is unchanged.

2

Caching recently used results lets instructions skip stages, which increases throughput and simultaneously lowers each instruction's latency.

3

Overlapping stages of multiple instructions raises completed-instructions-per-cycle while each instruction's own end-to-end latency stays roughly the same.

4

Executing each instruction faster shortens its latency, and the faster instructions naturally raise the overall throughput of the pipeline.

How does 'forwarding' (or bypassing) resolve a Read-After-Write (RAW) data hazard?

Select the correct answer

1

It renames the destination register so the reader and writer no longer share a name and can run in either order.

2

It stalls the dependent instruction for several cycles until the produced value is safely committed into the register file.

3

It reorders the two instructions so the reading instruction executes fully before the writing instruction ever enters the pipeline.

4

It routes a result from a later pipeline stage straight to a dependent instruction's input, avoiding the wait for write-back.

If you increase the number of pipeline stages, how does it typically affect instruction latency versus instruction throughput?

Select the correct answer

1

Per-instruction latency usually rises slightly while throughput improves thanks to a higher achievable clock frequency.

2

Latency stays fixed while throughput falls because deeper pipelines suffer many more structural resource hazards.

3

Per-instruction latency falls sharply while throughput drops because each stage now performs far less useful work.

4

Both latency and throughput improve equally since more stages mean more instructions finish in every clock cycle.

What is a 'Pipeline Bubble' (Stall), and what are the performance trade-offs of stalling versus using branch prediction?

Select the correct answer

1

A bubble is a mispredicted branch that flushes the pipeline; stalling avoids all penalties while prediction guarantees maximum throughput.

2

A bubble is an injected no-op that stalls flow; stalling wastes cycles reliably while prediction risks a costly flush when it is wrong.

3

A bubble is an extra execution stage added for hazards; stalling raises the clock rate while prediction lowers it and adds complexity.

4

A bubble is a cache miss that halts fetch; stalling always beats prediction because prediction can never recover the lost cycles at all.

What is the difference between a simple pipelined processor and a superscalar processor?

Select the correct answer

1

A superscalar issues multiple instructions per cycle via duplicated units, while a simple pipeline issues one per cycle

2

A superscalar always executes strictly in order, while a simple pipeline reorders instructions to fill more slots per cycle

3

A superscalar runs at a much higher clock rate, while a simple pipeline compensates by widening its data path per cycle

4

A superscalar removes the pipeline stages entirely, while a simple pipeline overlaps stages of one instruction per cycle

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

Explain the Principle of Locality. How do Temporal and Spatial locality influence the design of CPU caches?

Select the correct answer

1

Distant data is reused (temporal) and recent data is skipped (spatial), so caches prefetch only widely scattered addresses

2

Future data is predicted (temporal) and past data is dropped (spatial), so caches speculatively load unrelated memory pages

3

Recently used data is reused (temporal) and nearby data is used soon (spatial), so caches keep lines and fetch blocks

4

Random data is reused (temporal) and single bytes are used (spatial), so caches store one word per entry to save space

What is a cache line, and why is it usually 64 bytes rather than just a single word?

Select the correct answer

1

A single tagged word held per set; the 64 bytes are extra parity bits added to protect against memory bit errors

2

The smallest addressable unit in the cache; large lines exist mainly to match the CPU register width on each read

3

A page-sized region of memory; large lines let the TLB and cache share the same index bits to save silicon area

4

A fixed block transferred as a unit; larger lines exploit spatial locality and amortize tag and transfer overhead

What is the difference between a Write-Through and a Write-Back cache policy? When would you choose one over the other?

Select the correct answer

1

Write-through skips the cache completely; write-back stores data twice to guarantee memory always stays consistent

2

Write-through updates memory on every write; write-back defers writes until eviction, reducing memory traffic

3

Write-through updates only the cache line; write-back copies the entire cache to memory on every single store

4

Write-through buffers writes until a flush; write-back writes to memory immediately for maximum data durability

Compare Direct-Mapped, Fully-Associative, and Set-Associative caches. What are the trade-offs regarding hit time and miss rate?

Select the correct answer

1

Direct-mapped has slow hits but few misses; fully-associative raises misses but is faster; set-associative worsens both

2

Direct-mapped has fast hits but more misses; fully-associative lowers misses but is slower; set-associative balances both

3

Direct-mapped has slow hits and many misses; fully-associative fixes both; set-associative offers no real advantage at all

4

Direct-mapped has fast hits and few misses; fully-associative also has fast hits; set-associative is slower on every access

Explain the '3 C's' of cache misses (Compulsory, Capacity, Conflict). How can a software engineer reduce conflict misses?

Select the correct answer

1

Compulsory misses occur on first access to a block; increasing associativity fully eliminates them from the cache

2

Capacity misses occur when the working set fits; shrinking the block size lets more distinct lines coexist in it

3

Conflict misses occur from a cold cache at startup; prefetching every block ahead of time removes each of them

4

Conflict misses occur when too many blocks map to one set; adjusting data layout or padding spreads accesses out

What is Average Memory Access Time (AMAT), and how do you compute it across a multi-level cache hierarchy?

Select the correct answer

1

AMAT = hit time + miss rate × miss penalty, where each level's miss penalty is the AMAT of the next lower level

2

AMAT = miss rate × (hit time + miss penalty), computed independently per level and then averaged across every level

3

AMAT = hit time + miss penalty − miss rate, where the miss penalty stays fixed as the main memory latency throughout

4

AMAT = hit time × miss rate + miss penalty, summed once over all levels using only the last level's global miss rate

Compare cache replacement policies like LRU, FIFO, and random. What are the trade-offs of implementing true LRU in hardware?

Select the correct answer

1

True LRU is trivial in hardware since only one counter per cache is needed, so it is always chosen over random

2

FIFO always outperforms LRU on real workloads, so true LRU is avoided purely because of its worse hit rates

3

True LRU must track full recency order per set, costing bits and logic, so hardware uses cheaper approximations

4

Random needs the most storage of the three, so designers pick true LRU to save area despite the timing penalty

What is the difference between write-allocate and no-write-allocate policies on a write miss?

Select the correct answer

1

Write-allocate applies only to read misses; no-write-allocate applies only to write hits within a write-back cache line

2

Write-allocate flushes the whole set on a miss; no-write-allocate keeps the set intact and stalls the pipeline instead

3

Write-allocate loads the block into the cache on a miss; no-write-allocate writes straight to memory without loading

4

Write-allocate writes only to memory on a miss; no-write-allocate loads the block first then updates it in the cache

What is the difference between a split cache and a unified cache, and why are L1 caches often split into instruction and data caches?

Select the correct answer

1

A unified cache holds only data, and L1 splits so instructions can bypass coherence traffic between the core caches

2

A split cache keeps instructions and data separate, letting fetch and load happen at once without structural hazards

3

A split cache uses one large port shared by both, and L1 splits so the tag array can be indexed with fewer bits

4

A split cache stores both streams together, and L1 splits it mainly to double the total capacity of the fast cache

Explain how a physical address is broken into tag, index, and offset fields for a set-associative cache.

Select the correct answer

1

The offset selects the set to probe, the index identifies the block, and the tag selects a byte inside that one block

2

The tag selects a byte within a block, the offset selects the set, and the index identifies the block within that set

3

The index selects a byte within a block, the tag selects the set, and the offset identifies the block within that set

4

The offset selects a byte within a block, the index selects the set, and the tag identifies the block within that set

What are prefetching and hardware prefetchers, and how do they help hide memory latency?

Select the correct answer

1

They compress cache lines on the fly; hardware prefetchers detect duplicate blocks so more data fits near the core

2

They evict stale data ahead of time; hardware prefetchers scan the tag array to free sets before a miss can occur

3

They reorder memory writes for locality; hardware prefetchers batch stores together to reduce total bus transactions

4

They fetch data before it is requested; hardware prefetchers detect access patterns to overlap fetches with compute

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 the role of the TLB in the memory hierarchy? What happens during a TLB miss versus a Page Fault?

Select the correct answer

1

It caches recent memory blocks; a miss triggers a page-table walk, while a page fault means the page is not in RAM

2

It caches address translations; a miss means the page is not in RAM, while a page fault triggers a page-table walk

3

It buffers pending writes; a miss stalls the CPU, while a page fault evicts a line from the L2 cache entirely

4

It caches address translations; a miss triggers a page-table walk, while a page fault means the page is not in RAM

What is a Page Fault? Walk through what happens at the hardware level when one occurs.

Select the correct answer

1

The TLB fetches the missing page from disk automatically without any operating-system involvement

2

The MMU raises a trap, and the OS handler loads the page from disk and updates the page table

3

The MMU flushes the TLB, evicts a cache line, and the branch predictor reroutes the pipeline flow

4

The CPU invalidates its caches and keeps retrying the instruction until the page appears in memory

How does the MMU use a Page Table to translate a virtual address to a physical address?

Select the correct answer

1

It splits the address into a tag and index, looks up the cache, then appends the remaining offset bits

2

It compares the virtual address against every table entry until a matching physical frame is located

3

It hashes the whole virtual address into the page table to directly obtain the final physical address

4

It splits the address into a page number and offset, indexes the table for a frame, then adds the offset

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 are the differences between ROM, PROM, EPROM, EEPROM, and flash memory?

Select the correct answer

1

ROM is fixed when made, PROM is written once, EPROM erases with UV light, EEPROM erases electrically per byte, flash erases in blocks.

2

ROM is fixed when made, PROM erases with UV light, EPROM is written once, EEPROM erases in blocks, flash erases electrically per byte.

3

ROM is written once by the user, PROM is fixed when made, EPROM erases in blocks, EEPROM erases with UV light, flash erases per byte.

4

ROM erases electrically, PROM erases with UV light, EPROM is written once, EEPROM is fixed when made, flash is programmed at the factory.

What is the 'Memory Wall,' and why is the gap between CPU speed and DRAM latency a major bottleneck in modern architecture?

Select the correct answer

1

It is the physical limit on how many transistors can be packed onto a single memory chip die

2

It is the growing gap between disk bandwidth and DRAM capacity, forcing frequent swapping to disk

3

It is the growing gap between fast CPU speeds and slower DRAM latency, forcing the CPU to stall

4

It is the point where adding more cache no longer improves the hit rate for any given workload

What is memory alignment, and why do processors often require data to be aligned to specific byte boundaries? What is the performance penalty of an unaligned access?

Select the correct answer

1

Aligned data uses less memory overall; unaligned access wastes cache space but runs at the same speed

2

Aligned data can be encrypted faster; unaligned access needs extra padding bytes added by the compiler

3

Aligned data avoids cache misses; unaligned access always causes a page fault that the OS must handle

4

Aligned data can be read in one access; unaligned access may need multiple accesses, slowing it down

Why do we use SRAM for caches but DRAM for main memory? Explain the physical/architectural difference (transistors vs. capacitors).

Select the correct answer

1

SRAM and DRAM both use capacitors, but SRAM adds sense amplifiers that make cache lookups faster than main memory.

2

SRAM uses charge on capacitors that leaks away, while DRAM uses stable transistor latches that never require any refresh.

3

SRAM stores each bit in a capacitor cell, so it is dense; DRAM uses transistor flip-flops, so it is faster to read.

4

SRAM stores each bit in a transistor flip-flop, so it is fast; DRAM uses one transistor and a capacitor, so it is denser.

What is structure padding, and how does the compiler add padding to satisfy alignment requirements?

Select the correct answer

1

Unused bytes the compiler removes from members so the whole structure packs tightly into the fewest possible bytes.

2

Extra bytes the linker appends after each member so pointer arithmetic between structures always lands on a page boundary.

3

Extra bytes the CPU inserts at runtime near each member so misaligned accesses can be split across two machine words.

4

Unused bytes the compiler inserts between members so each starts at an address that is a multiple of its alignment.

Why does DRAM require periodic refresh, and how does this affect memory performance and power?

Select the correct answer

1

DRAM cells lose charge to heat, so they must be periodically cooled; refresh uses power and permanently reduces overall bandwidth.

2

DRAM cells store bits as charge that leaks, so they must be periodically rewritten; refresh uses power and briefly stalls access.

3

DRAM transistors drift over time, so they must be periodically recalibrated; refresh uses power and slightly lowers the clock speed.

4

DRAM capacitors overcharge on writes, so they must be periodically drained; refresh uses power and doubles the effective access latency.

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.

What is the system bus, and what are the roles of the address bus, data bus, and control bus?

Select the correct answer

1

The address bus carries the data, the data bus selects locations, and the control bus stores the clock rate value

2

The address bus transfers data values, the data bus carries control signals, and the control bus holds the addresses

3

The address bus carries memory locations, the data bus transfers the actual data, and the control bus carries command and timing signals

4

The address bus and data bus both move data, while the control bus alone determines the processor clock frequency

What is DMA (Direct Memory Access)? Why is it more efficient than 'Programmed I/O' for transferring large blocks of data?

Select the correct answer

1

The CPU moves data with a faster instruction, so each word transfers to memory without waiting on the device to respond.

2

A controller moves data between two devices directly through cache, so the CPU can copy each word faster than via memory.

3

A controller moves data between device and memory directly, so the CPU is freed instead of copying each word itself.

4

A controller compresses data between device and memory during transfer, so the CPU handles fewer total words per block.

What are the trade-offs between using interrupts vs. polling for I/O operations, and in what specific hardware scenario would polling be more efficient?

Select the correct answer

1

Polling wins when a device is fast and almost always ready, so interrupt overhead would exceed the cost of just checking.

2

Interrupts win when a device is fast and always ready, so polling overhead would exceed the cost of servicing each event.

3

Polling wins when many devices share one line, so the CPU can prioritize each interrupt instead of checking registers.

4

Polling wins when a device is slow and rarely ready, so the CPU avoids wasting cycles on frequent unnecessary interrupts.

What is the difference between Memory-Mapped I/O and Port-Mapped I/O? How does the CPU distinguish an I/O access from a memory access in MMIO?

Select the correct answer

1

MMIO maps device registers into the cache using normal load/store; a status flag tells the CPU each access targets a device.

2

MMIO uses a separate I/O address space with special IN/OUT instructions; the opcode tells the CPU each access targets a device.

3

PMIO maps device registers into the memory address space using normal load/store; a control line routes those ranges to devices.

4

MMIO maps device registers into the memory address space using normal load/store; address decoding routes those ranges to devices.

What is the difference between a Trap, an Interrupt, and an Exception from the perspective of the CPU?

Select the correct answer

1

A trap is a synchronous intentional request, an exception is a synchronous error, and an interrupt is asynchronous from hardware

2

A trap and an interrupt are synchronous errors, while an exception is an intentional deliberate system call

3

All three are asynchronous events raised by external devices that request immediate CPU service handling

4

A trap is asynchronous from hardware, an exception is intentional, and an interrupt is a synchronous instruction fault

What is bus arbitration, and why is it needed when multiple devices want to use a shared bus?

Select the correct answer

1

A mechanism that converts each device address into data so that memory can be read faster on the bus

2

A mechanism that encrypts bus traffic so that competing devices cannot read each other's transferred data blocks

3

A mechanism that decides which device gets control of the shared bus, preventing conflicts when several masters request it

4

A mechanism that widens the shared bus so every device can transmit at the exact same instant without waiting

What is interrupt vectoring, and how does the CPU find the correct handler when an interrupt occurs?

Select the correct answer

1

The scheduler queues the interrupt with a priority and later dispatches its handler during a normal context switch

2

The handler address is permanently fixed in hardware, so all interrupts always run the same single routine directly

3

The CPU polls every attached device in sequence until it finds the one that actually raised the interrupt signal

4

The interrupt supplies an identifier used to index a vector table holding the handler address, so the CPU jumps to it

Briefly explain the four classifications in Flynn's Taxonomy (SISD, SIMD, MISD, MIMD).

Select the correct answer

1

SISD: many instructions, one data; SIMD: many instructions, many data; MISD: one instruction, one data; MIMD: one instruction, many data

2

SISD: one instruction, many data; SIMD: one instruction, one data; MISD: many instructions, many data; MIMD: many instructions, one data

3

SISD: one instruction, one data; SIMD: many instructions, one data; MISD: one instruction, many data; MIMD: many instructions, many data

4

SISD: one instruction, one data; SIMD: one instruction, many data; MISD: many instructions, one data; MIMD: many instructions, many data

What is the difference between a multicore processor and a multiprocessor (multi-socket) system?

Select the correct answer

1

A multicore has several cores on one physical chip, while a multiprocessor uses multiple separate CPU chips in different sockets.

2

A multicore runs one thread per core in turn, while a multiprocessor guarantees every thread runs simultaneously across all chips.

3

A multicore never shares cache across its cores, while a multiprocessor always shares one unified last-level cache between sockets.

4

A multicore places multiple chips into one socket, while a multiprocessor puts several cores onto a single shared processor die.

What is Simultaneous Multithreading (Hyper-threading)? How does it differ from having two physical CPU cores?

Select the correct answer

1

Threads are time-sliced by the operating system scheduler alone, so the hardware treats them just like two cores

2

Two logical threads each get a private cache and pipeline, giving the same throughput as two separate physical cores

3

One physical core runs multiple threads by fully duplicating its execution units, so it exactly equals two physical cores

4

One physical core runs multiple threads by sharing its execution units, whereas two physical cores duplicate all execution resources

Explain Flynn’s Taxonomy. What is the difference between SIMD and MIMD, and where is each typically used?

Select the correct answer

1

SIMD runs independent instructions on independent data (multicore), while MIMD applies one instruction to many data elements (vector units)

2

SIMD and MIMD both apply one shared instruction stream, differing only in how many separate memory banks the cores can access

3

SIMD executes multiple instructions on a single data item, while MIMD executes a single instruction stream on one data item only

4

SIMD applies one instruction to many data elements (GPUs, vectors), while MIMD runs independent instructions on independent data (multicore)

Explain SIMD (Single Instruction, Multiple Data). How does it differ from standard multithreading, and what kind of software tasks benefit most from it?

Select the correct answer

1

SIMD processes one data item with many instructions per thread, unlike multithreading, and best suits sequential input-output work

2

SIMD runs one instruction across many data lanes in one thread, unlike multithreading's separate streams, aiding data-parallel tasks

3

SIMD and multithreading are identical mechanisms, both spawning threads, and both benefit unpredictable pointer-chasing workloads most

4

SIMD runs many independent instruction streams on separate cores, unlike multithreading, and mainly helps branch-heavy control tasks

What is the difference between shared-memory and distributed-memory parallel architectures?

Select the correct answer

1

In shared memory processors are limited to a single core each; in distributed memory processors can contain many independent cores per node.

2

In shared memory communication always uses a network switch; in distributed memory communication happens only through a shared system bus.

3

In shared memory all processors access one common address space; in distributed memory each has private memory and communicates by messages.

4

In shared memory each processor keeps private memory accessed by messages; in distributed memory all cores read one common global address space.

How does a GPU achieve high throughput through massive parallelism, and how does its architecture differ from a CPU?

Select the correct answer

1

GPUs execute one thread at very high frequency per core, while CPUs split each instruction across many lanes for wide vector throughput.

2

GPUs rely on very large per-core caches to avoid stalls, while CPUs rely on massive thread counts to keep all execution units busy at once.

3

GPUs use thousands of simple cores running in SIMT fashion to hide latency, while CPUs use few complex cores tuned for low-latency serial work.

4

GPUs use a few high-clock cores optimized for branching, while CPUs use thousands of simple cores designed for streaming throughput tasks.

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 is the difference between privileged (kernel) mode and user mode at the CPU level, and how do protection rings enforce it?

Select the correct answer

1

Both modes run the same instructions but rings merely change the virtual address space layout

2

User mode can run any instruction but rings block only direct memory writes into the kernel area

3

Kernel mode disables paging entirely while rings decide which cores may enter that mode at all

4

Kernel mode can run privileged instructions; protection rings restrict access by privilege level

What hardware state must be saved and restored during a context switch?

Select the correct answer

1

Only the general-purpose registers are saved since the scheduler regenerates everything else later

2

The CPU registers, program counter, stack pointer, and status flags must be saved and restored

3

The program's heap, stack, and code segments are copied into a reserved kernel save area first

4

The entire cache and TLB contents must be flushed and copied into the process control block

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 role of the Program Counter and the Instruction Register during the fetch-decode-execute cycle.

Select the correct answer

1

The PC holds the currently executing instruction, while the IR stores the address of the next instruction to be fetched from memory

2

The PC holds the address of the next instruction to fetch, while the IR holds the fetched instruction while it is decoded

3

The PC stores the decoded control signals, while the IR increments automatically to point at the following instruction in the sequence

4

The PC counts elapsed clock cycles, while the IR temporarily buffers operands read from registers before the ALU executes them

What are the mechanical and performance differences between an HDD and an SSD?

Select the correct answer

1

An HDD uses volatile memory cells refreshed constantly; an SSD uses optical disks read by lasers with slightly lower latency.

2

An HDD uses solid-state cells and needs no seek time; an SSD uses rotating platters and offers greater sequential speed.

3

An HDD uses spinning platters and moving heads with higher latency; an SSD uses flash with no moving parts and is faster.

4

An HDD uses flash chips with moving controllers and low latency; an SSD uses magnetic tape that is denser but far slower.

What is a parity bit, and how does it differ from a checksum for error detection?

Select the correct answer

1

A parity bit sums all data bytes modulo 256; a checksum is a single bit appended to every transmitted data word.

2

A parity bit corrects flipped bits automatically; a checksum only signals that data was altered somewhere in transit.

3

A parity bit is one bit tracking odd/even count of 1s; a checksum is a wider sum catching more error patterns.

4

A parity bit encrypts the message before sending; a checksum verifies the sender's identity rather than the data.

State Amdahl's Law. If 10% of your code is strictly serial, what is the theoretical maximum speedup you can achieve by adding an infinite number of processor cores?

Select the correct answer

1

Speedup is bounded by the parallel fraction, giving a maximum of about 90× overall

2

Speedup grows linearly with cores, so infinite cores give effectively unbounded speedup

3

Speedup equals the number of cores divided by ten, so it keeps rising with no fixed limit

4

Speedup is bounded by 1/(serial fraction), giving a maximum of 10×

Why are branches (if/else) expensive for a pipelined processor? Explain how a branch predictor works and what a 'pipeline flush' is.

Select the correct answer

1

The predictor stalls the pipeline until the condition resolves, and a flush is when cache lines holding the branch target are evicted to RAM

2

The predictor guesses the branch outcome to keep fetching; on a wrong guess the wrongly-fetched instructions are discarded in a flush

3

The predictor caches recent branch results in registers, and a flush is when the operating system forces a context switch mid-instruction

4

The predictor computes the branch target early using the ALU, and a flush occurs whenever two instructions need the same register at once

Explain the difference between 'Immediate', 'Register Indirect', and 'Displacement' addressing modes. Which one is most commonly used for accessing array elements?

Select the correct answer

1

Immediate embeds a constant, register indirect uses a register as a pointer, and displacement adds an offset to a register, best for arrays

2

Immediate uses a register value, register indirect embeds a constant, and displacement dereferences a pointer twice, the last is ideal for arrays

3

Immediate reads from a fixed address, register indirect adds two registers, and displacement stores a pointer in memory, best used for arrays

4

Immediate points to the stack, register indirect adds a scaled index, and displacement holds an absolute address, displacement suits arrays best

Explain the CPU Performance Equation. If you decrease the CPI but increase the clock cycle time, under what conditions does the overall performance improve?

Select the correct answer

1

Time = Instructions × cycle time ÷ CPI; performance improves whenever cycle time grows, because larger cycles do more work per step

2

Time = Instructions × CPI ÷ cycle time; performance improves whenever CPI drops, since a lower CPI always dominates the final result

3

Time = Instructions × CPI × cycle time; performance improves only if the CPI reduction outweighs the longer cycle time

4

Time = Instructions ÷ CPI × cycle time; performance improves only if instruction count also falls to offset the slower clock rate

Explain PC-relative and indexed addressing modes and when each is useful.

Select the correct answer

1

PC-relative selects registers by numeric offset, aiding loops; indexed scales a constant by operand width, aiding struct fields.

2

PC-relative loads absolute targets stored near the code, aiding jumps; indexed reads pointers from a fixed table, aiding arrays.

3

PC-relative dereferences a pointer held in a register, aiding calls; indexed embeds the full target in the instruction, aiding data.

4

PC-relative adds an offset to the program counter, aiding branches; indexed adds a register to a base, aiding arrays.

Why can metrics like MIPS and FLOPS be misleading when comparing processor performance?

Select the correct answer

1

They count raw operations without reflecting instruction complexity, ISA differences, or real workload behavior.

2

They rely on peak theoretical rates that programs rarely hit, plus they say nothing about work done per operation.

3

They only measure how fast the clock runs and ignore the memory hierarchy and pipeline stalls in the system.

4

They are computed differently by every vendor, so no two chips can ever be compared on the same numeric basis.

What is the difference between clock speed and IPC, and why can a processor with a lower clock frequency outperform one with a higher clock?

Select the correct answer

1

Clock is the bus rate, IPC is the memory latency; a lower clock outperforms when its instruction set is far simpler.

2

Clock is instructions per second, IPC is cycles per second; a slower clock wins by using shorter pipeline stages.

3

Clock counts cache hits, IPC counts branch predictions; lower clocks win because they generate far less heat overall.

4

Clock is cycles per second, IPC is instructions per cycle; higher IPC can beat a faster clock doing less.

Explain the common RAID levels (0, 1, 5, 10) and their trade-offs in performance and redundancy.

Select the correct answer

1

RAID 0 mirrors for safety; RAID 1 stripes for speed; RAID 5 duplicates all data twice; RAID 10 uses dedicated parity disks.

2

RAID 0 stripes with no redundancy; RAID 1 mirrors; RAID 5 stripes with distributed parity; RAID 10 mirrors then stripes.

3

RAID 0 uses parity blocks; RAID 1 stripes across drives; RAID 5 mirrors every disk; RAID 10 stripes without any redundancy.

4

RAID 0 stores dual parity; RAID 1 stripes with checksums; RAID 5 mirrors pairs of disks; RAID 10 keeps a single hot spare.

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