CS704 – Advanced Computer Architecture: Midterm Important MCQs (49 Solved Questions)
Virtual University of Pakistan • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS704 Course Page · CS704 Subjective Pack (27 Q&As)
-
CPU execution time of a program is given by:
Topic: Performance Measurement
- Execution time = Instruction count × CPI × Clock cycle time ✓ Correct answer
- Execution time = Instruction count × Clock rate × CPI
- Execution time = Instruction count / (CPI × Clock cycle time)
- Execution time = CPI / (Instruction count × Clock cycle time)
-
Machine A executes a program of 5 × 10⁹ instructions in 2 seconds. The instruction execution rate of machine A is:
Topic: Performance Measurement
- 2.5 × 10⁹ instructions per second ✓ Correct answer
- 4 × 10⁹ instructions per second
- 1 × 10¹⁰ instructions per second
- 2.5 × 10⁶ instructions per second
-
Machine B executes the same program with 6 × 10⁹ instructions in 1.5 seconds. The instruction execution rate of machine B is:
Topic: Performance Measurement
- 2.5 × 10⁹ instructions per second
- 4 × 10⁹ instructions per second ✓ Correct answer
- 9 × 10⁹ instructions per second
- 4.5 × 10⁹ instructions per second
-
Computer A has a clock cycle time of 250 ps and a CPI of 2.0. Computer B has a clock cycle time of 500 ps and a CPI of 1.2 for the same program. Which computer is faster, and by how much?
Topic: Performance Measurement
- B is 1.2 times faster than A
- A and B are equally fast
- A is 1.2 times faster than B ✓ Correct answer
- B is 2 times faster than A
-
For program 1, machine M1 has an execution time of 2.0 s, a clock rate of 3 × 10⁹ Hz and an instruction count of 5 × 10⁹. The CPI of M1 for this program is:
Topic: Performance Measurement
- 1.25
- 0.83
- 2.4
- 1.2 ✓ Correct answer
-
A program section has an instruction count of 7.5 × 10⁹, a CPI of 1.2 and runs on a machine with a clock rate of 5 × 10⁹ Hz. Its CPU execution time is:
Topic: Performance Measurement
- 1.8 seconds ✓ Correct answer
- 0.6 seconds
- 3.0 seconds
- 45 seconds
-
Speedup obtained from an enhancement is defined as:
Topic: Performance Measurement
- Execution time with the enhancement / Execution time without the enhancement
- Execution time without the enhancement / Execution time with the enhancement ✓ Correct answer
- Clock rate with the enhancement / Clock rate without the enhancement
- CPI without the enhancement / CPI with the enhancement
-
A processor die has an area of 380 mm² (3.8 cm²), the defect rate is 0.75 per cm² and α = 4. Using Yield = (1 + Defects per area × Die area / α)^(−α), the die yield is approximately:
Topic: Performance Measurement
- 0.50
- 0.036
- 0.116 ✓ Correct answer
- 0.85
-
For the die of the previous question, the average number of defects per die is:
Topic: Performance Measurement
- 2.85 ✓ Correct answer
- 0.75
- 285
- 1.9
-
For the expression C = A + B, the total code size on a stack architecture (Push A = 72 bits, Push B = 72 bits, Add = 8 bits, Pop C = 72 bits) is:
Topic: Instruction Set Design
- 216 bits
- 248 bits
- 224 bits ✓ Correct answer
- 320 bits
-
For the expression C = A + B, the total code size on an accumulator architecture (Load A = 72, Add B = 72, Store C = 72 bits) is:
Topic: Instruction Set Design
- 216 bits ✓ Correct answer
- 224 bits
- 248 bits
- 320 bits
-
For the expression C = A + B, the total code size on a register–register (load-store) architecture, with each instruction of 80 bits and four instructions needed, is:
Topic: Instruction Set Design
- 248 bits
- 216 bits
- 224 bits
- 320 bits ✓ Correct answer
-
A disadvantage of the register–register architecture is:
Topic: Instruction Set Design
- Operands are not equivalent, so a source operand is destroyed
- Higher instruction count than memory-reference architectures, giving larger programs ✓ Correct answer
- A memory bottleneck caused by all operands coming from memory
- Large variation in instruction size
-
A disadvantage of the memory–memory architecture is:
Topic: Instruction Set Design
- Simple, fixed-length instruction decoding
- It wastes registers for temporary storage
- Large variation in instruction size and in work per instruction, with a memory bottleneck ✓ Correct answer
- Code generation is very complex
-
An instruction format has a 5-bit opcode field (bits 9 to 13). The maximum number of basic opcodes available is:
Topic: Instruction Set Design
- 32 ✓ Correct answer
- 25
- 64
- 16
-
In the same format, when the operand 2 field is all zeros each opcode takes a new meaning, the mode field is 2 bits and the w/b field is 1 bit. The total number of possible opcodes is:
Topic: Instruction Set Design
- 256
- 512 ✓ Correct answer
- 768
- 1024
-
Applying the same escape technique to operand 1 (operand 1 may not use register R15; the all-ones pattern gives every opcode a further new meaning) increases the total number of opcodes to:
Topic: Instruction Set Design
- 512
- 640
- 1024
- 768 ✓ Correct answer
-
Pipelining is best defined as:
Topic: Pipelining Basics
- Executing one instruction completely before starting the next
- A technique in which several instructions are overlapped in execution, each at a different processing stage ✓ Correct answer
- Executing the same instruction on many data items at once
- Predicting the outcome of branches before they execute
-
The instruction cycle (fetch–decode–execute cycle) is the process by which a computer:
Topic: Pipelining Basics
- Transfers data between main memory and cache
- Compiles a high-level program into machine code
- Retrieves an instruction from memory, determines the actions it requires, and carries out those actions ✓ Correct answer
- Schedules processes on the CPU
-
A single-stage non-pipelined machine has a cycle time of 5 ns. A pipelined version has 5 stages with a cycle time of 1 ns. Assuming no stalls, the speedup of the pipelined machine is:
Topic: Pipelining Basics
- 5 ✓ Correct answer
- 25
- 1
- 4
-
If the 5-stage pipelined machine stalls 1 cycle for 40% of the instructions, the speedup over the single-stage machine becomes:
Topic: Pipelining Basics
- 5.0
- 4.2
- 3.58 ✓ Correct answer
- 2.5
-
The speedup of a pipeline accounting for stalls is given by:
Topic: Pipelining Basics
- Pipeline depth × (1 + stall cycles per instruction)
- 1 / (Pipeline depth + stall cycles per instruction)
- Pipeline depth / (1 + stall cycles per instruction) ✓ Correct answer
- (1 + stall cycles per instruction) / Pipeline depth
-
For a load instruction, the stage delays are: instruction fetch 150 ps, decode 70 ps, register read 60 ps, ALU 200 ps, memory read 60 ps and register write 150 ps. The clock cycle length of the single-cycle datapath is:
Topic: Pipelining Basics
- 540 ps
- 690 ps ✓ Correct answer
- 480 ps
- 200 ps
-
The clock frequency of the single-cycle processor with a 690 ps clock cycle is approximately:
Topic: Pipelining Basics
- 5 GHz
- 1.45 GHz ✓ Correct answer
- 0.69 GHz
- 2.9 GHz
-
In a 5-stage pipelined datapath whose slowest stage takes 200 ps, the fastest possible clock cycle and clock frequency are:
Topic: Pipelining Basics
- 690 ps and 1.45 GHz
- 60 ps and 16.7 GHz
- 200 ps and 5 GHz ✓ Correct answer
- 1000 ps and 1 GHz
-
Compared with the single-cycle datapath (690 ps), the 5-stage pipelined datapath with a 200 ps cycle is faster by a factor of:
Topic: Pipelining Basics
- 5.0
- 3.45 ✓ Correct answer
- 1.45
- 2.0
-
The purpose of a branch predictor in a pipelined processor is to:
Topic: Branch Prediction
- Execute both paths of a branch simultaneously
- Guess which way a branch will go before it is known for sure, improving the flow of the instruction pipeline ✓ Correct answer
- Remove branch instructions from the program
- Increase the size of the branch target buffer
-
In the static branch prediction scheme used in the ARM11 MPCore processor:
Topic: Branch Prediction
- All branches are predicted taken
- The prediction is based on the branch history table
- Forward conditional branches are predicted not taken and backward branches are predicted taken ✓ Correct answer
- Branches are never predicted
-
Dynamic branch prediction is based on:
Topic: Branch Prediction
- Caching previously seen branches (e.g. in a BTAC/BTB) and using their past behaviour ✓ Correct answer
- The direction of the branch offset only
- Compiler hints inserted in the code
- Executing the branch at fetch time
-
A branch has the outcome pattern T–N–T–N–T–N over one execution of a program core. The accuracy of an 'always taken' predictor for this branch is:
Topic: Branch Prediction
- 100%
- 0%
- 67%
- 50% ✓ Correct answer
-
Five branches have outcome patterns T-T-T, N-N-N-N, T-N-T-N-T-N, T-T-T-N-T and T-T-N-T-T-N-T. The overall accuracy of an 'always taken' predictor over all 25 outcomes is:
Topic: Branch Prediction
- 60% ✓ Correct answer
- 72%
- 50%
- 80%
-
A 2-bit predictor initialised to 'weakly predict taken' predicts the branch with outcomes N–N–N–N with an accuracy of:
Topic: Branch Prediction
- 0%
- 50%
- 75% ✓ Correct answer
- 100%
-
The main advantage of a 2-bit predictor over a 1-bit predictor is that:
Topic: Branch Prediction
- It uses no buffer space
- A branch must be mispredicted twice in a row before the prediction direction changes, so one unusual outcome does not flip the prediction ✓ Correct answer
- It always predicts correctly
- It predicts the branch target as well as the direction
-
If a branch target buffer (BTB) stores the target instruction of an unconditional branch and there is a BTB hit in instruction fetch, the branch penalty becomes:
Topic: Branch Prediction
- 2 cycles
- 0 cycles
- −1 cycle (a gain of one cycle) ✓ Correct answer
- 1 cycle
-
For branch folding with unconditional branches forming 5% of instructions and a 2-cycle miss penalty, the BTB hit rate at which storing the target instruction just breaks even is:
Topic: Branch Prediction
- 90%
- 50%
- 10%
- 20% ✓ Correct answer
-
What is the impact of increasing the size of the branch-prediction buffer on two branches in a program?
Topic: Branch Prediction
- It has no significant effect, because a single predictor serving one branch is generally more accurate, and with a larger buffer two branches are less likely to share one predictor ✓ Correct answer
- It doubles the accuracy of both branches
- It makes both branches share one predictor
- It removes all mispredictions of the two branches
-
The key difference between a branch instruction and a jump instruction is:
Topic: Branch Prediction
- Branches are unconditional while jumps are conditional
- Jumps modify the program counter to a specified address, while branches are relative to the current program counter and may be conditional ✓ Correct answer
- Branches change the program counter while jumps do not
- There is no difference
-
An anti-dependence (WAR) exists between two instructions when:
Topic: Dependences and Compiler Scheduling
- The first instruction writes a location that the second reads
- An instruction reads a register or memory location and a subsequent instruction writes a new value to the same location ✓ Correct answer
- Both instructions write the same location
- Both instructions read the same location
-
In the code: ADD R3, R1, R2 / SW R3, 12(R0) / LW R4, 0(R0) / ADD R5, R1, R4 — the true (RAW) dependences are:
Topic: Dependences and Compiler Scheduling
- SW depends on LW through R0
- ADD R3 → SW through R3, and LW → ADD R5 through R4 ✓ Correct answer
- ADD R5 depends on ADD R3 through R1
- There are no dependences
-
An array index is called affine if it can be written in the form:
Topic: Dependences and Compiler Scheduling
- a × i + b, where a and b are constants and i is the loop index ✓ Correct answer
- i² + b
- a × i × j, with two loop indices
- Any expression involving an array name
-
In the GCD dependence test for two affine references a·i + b and c·i + d, a dependence may exist only if:
Topic: Dependences and Compiler Scheduling
- GCD(a, c) divides (d − b) ✓ Correct answer
- a equals c
- (d − b) is greater than GCD(a, c)
- The loop is first normalised
-
Static scheduling differs from dynamic scheduling in that:
Topic: Dependences and Compiler Scheduling
- Static scheduling is done by the hardware at run time
- In static scheduling the compiler arranges instructions to avoid stalls, while in dynamic scheduling the hardware decides the order of execution at run time ✓ Correct answer
- Dynamic scheduling is done by the compiler before execution
- Static scheduling allows instructions to execute out of order
-
With dynamic scheduling, when an instruction stalls:
Topic: Dependences and Compiler Scheduling
- All following instructions must also stop
- The whole pipeline is flushed
- Following instructions can still issue if they create no structural hazards or dependences ✓ Correct answer
- The compiler reschedules the code
-
An exception is called precise if:
Topic: Advanced Topics
- It is detected in the same cycle in which it occurs
- The machine state is exactly as if the instructions had executed sequentially, with all instructions before the excepting one completed and none after it having taken effect ✓ Correct answer
- It never occurs during multiply and divide instructions
- It is handled entirely by software
-
A finite state machine (FSM) is:
Topic: Advanced Topics
- A machine with an infinite number of states
- An abstract machine that can be in exactly one of a finite number of states at any time ✓ Correct answer
- A type of cache memory
- A scheduling algorithm for processes
-
In SIMD (single instruction, multiple data) multimedia operations, a partitioned add on 16-bit data within a 64-bit ALU performs:
Topic: Advanced Topics
- One 64-bit addition
- Two 32-bit additions only
- Four 16-bit additions in a single clock cycle, with carries between the partitions prevented ✓ Correct answer
- Sixteen 4-bit additions
-
A pixel in graphics processing is typically 32 bits, consisting of:
Topic: Advanced Topics
- Two 16-bit channels
- Four 8-bit channels: R (red), G (green), B (blue) and A (attribute/transparency) ✓ Correct answer
- One 32-bit floating-point value
- Eight 4-bit channels
-
In MIPS floating-point instructions, MOV.S and MOV.D respectively copy:
Topic: Advanced Topics
- A single-precision register and a double-precision register to another register of the same type ✓ Correct answer
- Memory to a register and a register to memory
- An integer register and a floating-point register
- Two single-precision registers at the same time
-
A vertex, a common 3D data type in graphics applications, consists of:
Topic: Advanced Topics
- A single 64-bit integer
- Four components (x, y, z) and w, usually 32-bit floating-point values ✓ Correct answer
- Four 8-bit colour channels
- Two components (x, y) only