Computer Architecture Mid

1 / 63

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 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.

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.

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

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

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 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 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 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

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.

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

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.