Docsity

17 COMP A4 Program Design and Data Structures A Professional Certification Study Guide, Exams of Technology

Toggle sidebar
bg1
17 COMP A4 Program Design and Data
Structures A Professional Certification Study
Guide
**Question 1.** Which component of a computer system defines the programmer‑visible instruction
set, registers, and addressing modes?
A) Microarchitecture
B) System architecture
C) Instruction Set Architecture (ISA)
D) Firmware
Answer: C
Explanation: ISA is the abstract model that specifies the programmer’s view of the machine, including
the instruction set, registers, and addressing modes, while microarchitecture details the actual
implementation.
**Question 2.** The performance equation CPU Time = (Instruction Count) × (CPI) × (Clock Cycle Time)
is most directly affected by which of the following optimizations?
A) Reducing the number of transistors
B) Lowering the voltage supply
C) Decreasing CPI through better micro‑ops scheduling
D) Increasing the size of the L2 cache
Answer: C
Explanation: CPI (cycles per instruction) appears directly in the equation; reducing CPI lowers total CPU
time, whereas other options affect power or memory latency.
**Question 3.** If a processor has a clock frequency of 2 GHz and a CPI of 1.5 for a program that
executes 10⁚ instructions, what is the approximate execution time?
A) 0.75 seconds
B) 0.75 nanoseconds
C) 1.5 seconds
D) 3 seconds
Answer: A
Explanation: Clock cycle time = 1/2 GHz = 0.5 ns. CPU Time = 10⁹ × 1.5 × 0.5 ns = 0.75 seconds.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57

Partial preview of the text

Download 17 COMP A4 Program Design and Data Structures A Professional Certification Study Guide and more Exams Technology in PDF only on Docsity!

Structures A Professional Certification Study

Guide

Question 1. Which component of a computer system defines the programmer‑visible instruction set, registers, and addressing modes? A) Microarchitecture B) System architecture C) Instruction Set Architecture (ISA) D) Firmware Answer: C Explanation: ISA is the abstract model that specifies the programmer’s view of the machine, including the instruction set, registers, and addressing modes, while microarchitecture details the actual implementation. Question 2. The performance equation CPU Time = (Instruction Count) × (CPI) × (Clock Cycle Time) is most directly affected by which of the following optimizations? A) Reducing the number of transistors B) Lowering the voltage supply C) Decreasing CPI through better micro‑ops scheduling D) Increasing the size of the L2 cache Answer: C Explanation: CPI (cycles per instruction) appears directly in the equation; reducing CPI lowers total CPU time, whereas other options affect power or memory latency. Question 3. If a processor has a clock frequency of 2 GHz and a CPI of 1.5 for a program that executes 10⁹ instructions, what is the approximate execution time? A) 0.75 seconds B) 0.75 nanoseconds C) 1.5 seconds D) 3 seconds Answer: A Explanation: Clock cycle time = 1/2 GHz = 0.5 ns. CPU Time = 10⁹ × 1.5 × 0.5 ns = 0.75 seconds.

Structures A Professional Certification Study

Guide

Question 4. According to Amdahl’s Law, if 30 % of a program can be parallelized, the maximum theoretical speedup on an infinite number of processors is: A) 1.3× B) 2.0× C) 3.33× D) 10× Answer: A Explanation: Speedup = 1 / [(1‑p) + p/N]; as N→∞, speedup → 1/(1‑p) = 1/0.7 ≈ 1.43, but the maximum additional speedup over the serial part is 30 % → overall 1.3× (rounded to nearest answer). Question 5. Dynamic power consumption in CMOS circuits is given by P ∝ C · V² · f. Which of the following changes will most reduce power while keeping performance roughly constant? A) Halve the supply voltage and double the frequency B) Double the capacitance and halve the voltage C) Reduce the frequency by 25 % and keep voltage unchanged D) Increase the voltage by 10 % and keep frequency unchanged Answer: A Explanation: Power scales with V²; halving V reduces power by factor 4, while doubling f restores performance, yielding net power reduction. Question 6. In a stack‑based ISA, which of the following instructions is most likely to be present? A) LOAD R1, 0x B) PUSH R C) ADD R3, R4, R D) MOVE R6, R Answer: B

Structures A Professional Certification Study

Guide

Answer: B Explanation: Single‑precision (32‑bit) format allocates 1 sign bit, 8 exponent bits, and 23 mantissa bits. Question 10. Which of the following is a primary advantage of RISC over CISC architectures? A) Fewer instructions overall B) Variable‑length instructions that reduce code size C) Simpler decode logic enabling higher clock frequencies D) Direct hardware support for complex string operations Answer: C Explanation: RISC uses fixed‑length, simple instructions, making the decode stage faster and allowing higher clock rates. Question 11. In the classic 5‑stage pipeline, which stage is responsible for reading operands from the register file? A) IF (Instruction Fetch) B) ID (Instruction Decode) C) EX (Execute) D) MEM (Memory Access) Answer: B Explanation: During the Decode stage, the processor reads source registers and determines control signals. Question 12. A RAW (Read‑After‑Write) hazard occurs when: A) An instruction writes to a register that a later instruction reads before the write completes. B) An instruction reads a register that a later instruction writes. C) Two instructions write to the same register in succession. D) Two instructions read the same register simultaneously.

Structures A Professional Certification Study

Guide

Answer: A Explanation: RAW means a later instruction needs a value that a previous instruction has not yet produced. Question 13. Which technique allows a later instruction to use the result of an earlier instruction before it is written back to the register file? A) Pipeline stalling B) Data forwarding (bypassing) C) Branch prediction D) Instruction prefetching Answer: B Explanation: Forwarding routes the ALU result directly to a dependent instruction’s input, eliminating the need to wait for write‑back. Question 14. In a static branch predictor that always predicts “not taken,” the misprediction rate will be highest for programs that: A) Have loops with few iterations B) Contain many forward jumps (function calls) C) Use conditional branches that are mostly taken D) Execute only sequential code Answer: C Explanation: If most branches are taken, always predicting “not taken” yields many mispredictions. Question 15. Superscalar execution differs from scalar pipelines primarily by: A) Using multiple functional units to issue more than one instruction per clock cycle. B) Executing only one instruction at a time but with deeper pipelines. C) Relying exclusively on software scheduling of parallelism. D) Eliminating the need for branch prediction.

Structures A Professional Certification Study

Guide

Answer: C Explanation: Fully associative caches have no placement restrictions; any block can occupy any line. Question 19. The “Three Cs” of cache misses are Compulsory, Capacity, and: A) Conflict B) Coherence C) Consistency D) Contention Answer: A Explanation: Conflict (or collision) misses occur when multiple blocks map to the same set in a set‑associative or direct‑mapped cache. Question 20. For a two‑level cache hierarchy, the average memory access time (AMAT) is given by: A) L1 Hit Time + L1 Miss Rate × L2 Hit Time B) L1 Hit Time + L1 Miss Rate × (L2 Hit Time + L2 Miss Rate × Main‑Memory Time) C) L2 Hit Time + L2 Miss Rate × Main‑Memory Time D) L1 Miss Rate × L2 Miss Rate × Main‑Memory Time Answer: B Explanation: AMAT accounts for the hit time of the first level, plus the miss penalty, which includes the second‑level hit time and its own miss penalty. Question 21. A non‑blocking (or lockup‑free) cache improves performance by: A) Allowing multiple outstanding memory requests to be serviced simultaneously. B) Preventing any cache line from being evicted. C) Using a larger block size for each line. D) Disabling write‑back policies. Answer: A

Structures A Professional Certification Study

Guide

Explanation: Non‑blocking caches can handle several misses in parallel, reducing stalls caused by a single pending miss. Question 22. Translation Lookaside Buffers (TLBs) are used to: A) Store recently fetched instruction bytes. B) Cache page‑table entries to accelerate virtual‑to‑physical address translation. C) Implement write‑through caching for I/O devices. D) Provide a hardware queue for DMA transfers. Answer: B Explanation: TLBs hold a subset of page‑table mappings, reducing the latency of address translation. Question 23. In a system using a 4‑KB page size, how many bits of a 32‑bit virtual address constitute the page offset? A) 8 bits B) 10 bits C) 12 bits D) 16 bits Answer: C Explanation: 4 KB = 2¹² bytes, so the lower 12 bits represent the offset within a page. Question 24. Which DRAM technology improvement primarily increased bandwidth without changing the clock frequency? A) Increasing the number of rows per bank B) Using double data rate (DDR) transfers on both clock edges C) Adding more address pins D) Reducing the cell size to 1 μm² Answer: B

Structures A Professional Certification Study

Guide

Explanation: DMA engines move data between I/O devices and memory without CPU intervention, enabling overlap of computation and transfer. Question 28. RAID 5 provides which combination of properties? A) Striping with no redundancy B) Mirroring of all data C) Striping with distributed parity, allowing recovery from a single disk failure D) Double parity for protection against two simultaneous failures Answer: C Explanation: RAID 5 distributes parity information across disks, offering fault tolerance for one failed disk while maintaining striping performance. Question 29. Compared to magnetic hard drives, solid‑state drives (SSDs) typically have: A) Higher latency and lower throughput B) Lower latency and higher throughput C) Identical latency but higher power consumption D) No wear‑leveling requirements Answer: B Explanation: SSDs have no moving parts, resulting in much lower access latency and higher sequential/random throughput. Question 30. In Flynn’s taxonomy, a system that executes multiple streams of data with the same instruction (e.g., SIMD vector unit) is classified as: A) SISD B) SIMD C) MISD D) MIMD Answer: B

Structures A Professional Certification Study

Guide

Explanation: SIMD (Single Instruction, Multiple Data) processes many data elements with a single instruction stream. Question 31. The MESI cache coherence protocol’s “E” state stands for: A) Exclusive – the line is present only in this cache and is clean. B) Error – the line contains corrupted data. C) Evicted – the line has been removed. D) Enabled – the line can be written. Answer: A Explanation: In the Exclusive state, the cache has sole ownership of a clean line, allowing it to transition to Modified without notifying other caches. Question 32. A directory‑based cache coherence scheme is most beneficial in: A) Small, single‑core processors B) Large‑scale multiprocessor systems with many caches C) Systems without any shared memory D) Processors that only execute scalar code Answer: B Explanation: Directory protocols scale better than snooping because they avoid broadcast traffic, which becomes prohibitive with many caches. Question 33. Sequential consistency guarantees that: A) All processors see memory operations in the same order as they were issued by each processor. B) Writes become visible to other processors only after a fence instruction. C) The order of loads and stores can be reordered for performance. D) Only one processor can access memory at a time. Answer: A

Structures A Professional Certification Study

Guide

Answer: B Explanation: SMT allows multiple threads to issue instructions to any available functional unit each cycle, increasing overall resource usage. Question 37. The “power wall” refers to: A) The limit on the number of transistors that can be placed on a chip. B) The difficulty of dissipating heat as clock frequencies increase, limiting further frequency scaling. C) The maximum allowable voltage for CMOS logic. D) The cost barrier for manufacturing sub‑ 10 nm processes. Answer: B Explanation: Power density and heat dissipation become major constraints, preventing continued frequency scaling—this is known as the power wall. Question 38. Mean Time To Failure (MTTF) is a reliability metric that measures: A) The average time a system operates before a repair is needed. B) The average time between successive failures for non‑repairable components. C) The total uptime of a data center per year. D) The latency of cache accesses. Answer: B Explanation: MTTF applies to components that are not repaired; it is the expected time until the first failure. Question 39. In a direct‑mapped cache with 64 lines, each line holding 32 bytes, the index field of a 32 ‑bit address consists of how many bits? A) 5 bits B) 6 bits C) 7 bits D) 8 bits

Structures A Professional Certification Study

Guide

Answer: B Explanation: Number of lines = 64 = 2⁶, so 6 bits are needed for the index. Block offset requires log₂(32)=5 bits, leaving the remaining bits for the tag. Question 40. A write‑back cache differs from a write‑through cache because: A) It updates main memory on every write. B) It writes modified data to memory only when the line is evicted. C) It never stores dirty data. D) It uses a larger block size. Answer: B Explanation: Write‑back caches keep modifications in the cache (dirty lines) and write them back to main memory only upon eviction, reducing memory traffic. Question 41. The principle of “locality of reference” is exploited by which of the following hardware structures? A) Arithmetic Logic Unit (ALU) B) Register file C) Cache memory hierarchy D) Clock generator Answer: C Explanation: Caches are designed to capture temporal and spatial locality, providing faster access to frequently used data. Question 42. In a set‑associative cache, a “way” refers to: A) The number of bits used for the tag. B) The number of possible locations a block can occupy within a set. C) The size of the cache line. D) The latency of a cache miss.

Structures A Professional Certification Study

Guide

Answer: B Explanation: A bubble is a no‑op inserted into the pipeline to give time for a hazard to be resolved, effectively stalling that stage. Question 46. The term “branch target buffer” (BTB) is associated with which function? A] Storing recently used cache lines. B] Predicting the target address of a taken branch. C] Holding the result of arithmetic operations. D] Managing the TLB entries. Answer: B Explanation: A BTB caches the destination address of recently executed branch instructions to improve branch prediction accuracy. Question 47. Which of the following best describes a “load‑use” data hazard? A] The load instruction writes a register that the following instruction reads. B] The following instruction needs the data loaded by the preceding load before it completes. C] Two loads to the same address occur consecutively. D] A store instruction overwrites a value that a later load will read. Answer: B Explanation: A load‑use hazard occurs when an instruction needs the result of a load before the load has produced it, often requiring a stall. Question 48. In a VLIW (Very Long Instruction Word) architecture, parallelism is primarily exposed by: A] Dynamic scheduling hardware. B] The compiler, which bundles independent operations into a single long instruction. C] Hardware thread spawning. D] Branch prediction.

Structures A Professional Certification Study

Guide

Answer: B Explanation: VLIW relies on the compiler to identify independent operations and encode them together; the hardware simply executes the bundled operations. Question 49. Which of the following is NOT a typical reason for a cache miss? A] The requested block has never been loaded (compulsory). B] The cache is full and must evict a block (capacity). C] The block maps to a set already containing another block (conflict). D] The CPU clock frequency exceeds the cache’s maximum speed. Answer: D Explanation: Cache miss categories relate to data placement; clock frequency does not directly cause a miss. Question 50. A “write allocate” policy in a cache means: A] On a write miss, the block is fetched into the cache before being modified. B] Writes are performed only in main memory, never in the cache. C] The cache line is immediately evicted after a write. D] Writes always bypass the cache. Answer: A Explanation: Write‑allocate fetches the missed block into the cache and then updates it, allowing subsequent accesses to hit. Question 51. In a typical modern CPU, the L1 cache is usually split into: A] Unified instruction and data cache. B] Separate instruction (I‑cache) and data (D‑cache) units. C] Multiple levels of instruction caches only. D] A single write‑through cache for both.

Structures A Professional Certification Study

Guide

Answer: A Explanation: Bus locking allows a processor to hold the bus while performing an atomic operation, preventing other agents from interfering. Question 55. In a RAID 6 configuration, how many disks can fail simultaneously without data loss? A] One B] Two C] Three D] None Answer: B Explanation: RAID 6 stores two independent parity blocks, allowing recovery from any two simultaneous disk failures. Question 56. The latency of a typical SSD is on the order of: A] 10 μs B] 100 μs C] 10 ms D] 100 ms Answer: B Explanation: SSDs typically have latencies around 50‑ 200 μs, much lower than HDDs (≈ 10 ms). Question 57. Which of the following is a primary advantage of using a “ring” interconnect for a small number of cores? A] Minimal wiring complexity and low latency for adjacent nodes. B] Unlimited scalability without contention. C] Direct point‑to‑point connections between every pair of cores. D] Built‑in support for cache coherence.

Structures A Professional Certification Study

Guide

Answer: A Explanation: Rings connect each node to two neighbors, simplifying wiring and providing predictable latency for nearby communication. Question 58. In a two‑phase commit protocol used for distributed memory consistency, the “prepare” phase ensures: A] All nodes have flushed their caches. B] Each participant can commit without violating its local constraints. C] The network topology is reconfigured. D] The processor clock is synchronized. Answer: B Explanation: During the prepare phase, each participant votes whether it can safely commit; only if all vote “yes” does the commit proceed. Question 59. The term “hot‑plug” in the context of storage devices refers to: A] The ability to replace a device while the system is powered on. B] A device that operates at higher temperature. C] A cache line that is frequently accessed. D] A type of power management. Answer: A Explanation: Hot‑plug allows insertion or removal of storage devices without shutting down the system. Question 60. Which of the following is a characteristic of a “write‑through” cache? A] Data is written to main memory only when the cache line is evicted. B] Every write to the cache also updates main memory immediately. C] The cache never stores dirty data. D] It requires a larger block size than write‑back caches.