Purdue CS 250 Final Exam

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/162

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

163 Terms

1
New cards

The 32-bit 2’s complement integer 0x01234567 is stored in little endian memory. When reading bytes from lowest to highest address, what is the third byte read?

0x23

2
New cards

Why must a C language compiler be given the identity of the target processor?

To identify the intended machine instruction and ISA

3
New cards

Which assembly language instruction must appear in a snippet implementing a high-level language for loop?

Branch instruction

4
New cards

Improving latency for both SRAM and DRAM in a two-level memory hierarchy would reduce Average Memory Access Time by improving which factors?

Hit time and miss time

5
New cards

Using buffered I/O reduces the number of system calls by a factor of:

The number of data objects in the buffer

6
New cards

A C language compiler needs to know the target processor for what reasons?

To optimize the utilization of the instruction set, and to customize the machine code generated

7
New cards

Which statement is FALSE regarding the properties of pipelining and virtual memory in a computer system?

a) Pipelining increases instruction throughput

b) Multiple virtual memory spaces can exist simultaneously

c) Pipelining reduces the execution time of each instruction

d) An application program can request a device interrupt at any time

c) Pipelining reduces the execution time of each instruction

8
New cards

Which branch prediction method is static, not changing during the runtime of a program?

a) Predict not taken

b) Predict using a 1-bit history

c) Use a branch target buffer

d) Dynamic branch prediction

a) Predict not taken

9
New cards

What changes must an application programmer make to a high-level language program before compiling it for a pipelined processor?

No changes are necessary

10
New cards

Which of the following is part of forwarding in a high-performance pipelined processor?

a) Comparison of operand addresses

b) Utilization of demultiplexers

c) Handling of branch instructions

d) Data cache access

a) Comparison of operand addresses

11
New cards

Which of the following techniques reduces the number of instructions that must be executed for a given high-level language application program?

a) Loop unrolling

b) Instruction scheduling by the compiler

c) Performance benchmarking

d) Effective branch prediction

a) Loop unrolling

12
New cards

The meaning of a bit string in a computer system is determined by:

The representation scheme it follows

13
New cards

What is the primary purpose of using a branch target buffer in dynamic branch prediction?

To cache the target addresses of branch instructions

14
New cards

What is the effect of setting a dirty bit in a write-allocate cache?

It signals that the cache line has been modified

15
New cards

What aspect of a cache’s operation is most directly affected by its write policy?

The decision on when to update main memory

16
New cards

Which of the following scenarios is most likely to see the greatest performance improvement from the use of dynamic branch prediction over static branch prediction?

a) A loop with a large number of iterations

b) A highly predictable set of conditional operations

c) Code segments where branch instructions occur infrequently

d) Code with deep nested conditional branches

d) Code with deep nested conditional branches

17
New cards

What does it mean when a CPU is described as having a Harvard architecture?

It has separate memory storage areas for data and instructions

18
New cards

A 64-bit architecture primarily benefits long-term performance in what way?

It enables larger amounts of virtual memory addressing

19
New cards

What type of cache miss is reduced by increasing the associativity of a cache?

Conflict misses

20
New cards

For a superscalar processor, what is the primary benefit of having multiple instruction dispatch ports?

Enables it to execute multiple instructions in parallel

21
New cards

In what situation can a directly mapped cache with MRU replacement policy outperform the LRU replacement policy?

a) When the workload exhibits strong temporal locality

b) When the workload shows looping behavior with loop size smaller than the cache size

c) When the access pattern regularly switches between two sets of data larger than the cache

d) When sequential memory blocks are frequently accessed

c) When the access pattern regularly switches between two sets of data larger than the cache

22
New cards

What feature of virtual memory allows for the execution of programs larger than the physical memory?

Demand paging

23
New cards

In a multiprocessor system, what is the role of the coherence protocol?

To ensure that all processors see the same memory value

24
New cards

What is the effect of increasing the block size in a cache memory?

Reduces compulsory misses but may increase capacity misses

25
New cards

What does the principle of locality refer to in the context of program execution?

Programs tend to reuse data and instructions they have recently used

26
New cards

What is the primary purpose of the Translation Lookaside Buffer (TLB) in a computer system?

To decrease the latency of page translations

27
New cards

What component is critical for handling interrupts in a computer system?

Interrupt service routine (ISR)

28
New cards

In a pipelined processor, forwarding is used to:

Reduce data hazards

29
New cards

In a 5-stage pipelined processor, which of the following stages is responsible for reading register operands?

a) Instruction fetch

b) Instruction decode

c) Execute

d) Memory

e) Write back

b) Instruction decode

30
New cards

Which of the following is an example of a control hazard in pipelined processors?

a) Data dependence

b) Resource conflict

c) Branch instructions

d) Exceptions

c) Branch instructions

31
New cards

In a virtual memory system with a page size of 4KB and a 32-bit virtual address space, how many bits are used for the page offset?

12

32
New cards

Which of the following is an example of a data hazard that can be resolved using forwarding?

a) Read after write (RAW)

b) Write after read (WAR)

c) Write after write (WAW)

d) Control dependence

a) Read after write (RAW)

33
New cards

A processor has a 64KB direct-mapped cache with a block size of 32 bytes. How many bits are used for the cache index?

11

34
New cards

In a pipelined processor, which of the following can cause a control hazard?

a) Branch instructions

b) Data dependencies

c) Structural hazards

d) Exceptions

a) Branch instructions

35
New cards

In a set-associative cache, which of the following determines the set to which a memory block is mapped?

a) The tag bits

b) The block offset bits

c) The index bits

d) The valid bit

c) The index bits

36
New cards

Which of the following is true about the difference between a write-through and a write-back cache?

a) A write-through cache updates main memory on every write, while a write-back cache updates main memory only when a block is replaced

b) A write-back cache updates main memory on every write, while a write-through cache updates main memory only when a block is replaced

c) A write-through cache has a lower miss penalty than a write-back cache

d) A write-back cache has a lower hit time than a write-through cache

a) A write-through cache updates main memory on every write, while a write-back cache updates main memory only when a block is replaced

37
New cards

(T/F) The output depends on the previous state of the circuit for a combinational logic circuit.

True

38
New cards

(T/F) The output can be expressed as a Boolean function of the inputs for a combinational logic circuit.

False

39
New cards

Which of the following is true about the one’s complement representation of negative numbers?

a) It has two representations for zero

b) It is asymmetric around zero

c) It is the most commonly used representation in modern computers

d) It requires a separate sign bit

a) It has two representations for zero

40
New cards

In a pipelined processor, which of the following is true about data forwarding?

a) It eliminates all data hazards

b) It reduces the number of stalls caused by data hazards

c) It increases the latency of the pipeline

d) It is only used in out-of-order execution

b) It reduces the number of stalls caused by data hazards

41
New cards

In a virtually indexed, physically tagged cache, what is the virtual address used to access?

The virtual address is used to access both the cache tags and the data

42
New cards

(T/F) Stalling the processor is a common technique for handling cache misses.

True

43
New cards

(T/F) Dropping the memory request is a common technique for handling cache misses.

False

44
New cards

In a demand-paged virtual memory system, what is true about the page fault rate?

It decreases as the locality of reference in the program increases

45
New cards

Which of the following is a common technique for improving the performance of a branch predictor?

a) Increasing the size of the BHT

b) Increasing the size of the BTB

c) Using a more sophisticated prediction algorithm

d) All of the above

d) All of the above

46
New cards

What is the primary function of the Arithmetic Logic Unit (ALU) in a CPU?

To perform arithmetic and logical operations

47
New cards

What does the term “pipelining” refer to in a CPU architecture?

Executing multiple instructions simultaneously

48
New cards

What is a “superscalar” processor capable of?

Executing more than one instruction during a single clock cycle

49
New cards

In a multi-level cache architecture, where is the Level 1 (L1) cache located?

Within the CPU, closest to the ALU

50
New cards

What is the primary advantage of using DRAM over SRAM?

Higher cost-effectiveness

51
New cards

What type of memory is used to implement the cache memory in a computer system?

Static RAM (SRAM)

52
New cards

How does a branch predictor improve CPU performance?

By guessing the outcomes of conditional operations

53
New cards

What role does the control unit play in a CPU?

It directs the operation of the processor

54
New cards

What best describes the function of a multiplexer?

It selects one of many data sources to send to the output

55
New cards

Which component of a computer system is responsible for carrying out the instructions of a computer program?

The central processing unit (CPU)

56
New cards

What role does speculative execution play in modern CPUs?

It executes code paths that might not be needed to fill idle CPU cycles and it predicts the outcome of branches to speed up execution/

57
New cards

Which of the following changes the mode of execution of a processor from a mode with low privilege to a mode with high privilege?

a) Execution of a branch instruction

b) A cache hit

c) Fetch of the default next instruction

d) Receipt of an interrupt during execution of a user application

e) None of the above

d) Receipt of an interrupt during execution of a user application

58
New cards

A cache has a dirty bit for each block. Which statement about this cache is true?

a) This cache is an L1 cache

b) This cache has one fewer bit in the tag field than if there were no dirty bit

c) This cache is a data cache

d) This cache is half as large as it would be if there were no dirty bit

e) None of the other answers is a true statement

c) This cache is a data cache

59
New cards

A computer has 64-bit virtual memory addresses and 1 Kibibyte pages. Page tables for this computer are implemented using three levels. What is the logarithm base two of the size of a table in the multi-level tree page table structure?

18

60
New cards

Which of the following is not a requirement for main memory?

a) Adequate capacity

b) Low access latency

c) Non-volatile

d) Low cost

e) Non-ROM

c) Non-volatile

61
New cards

Over time, as hardware becomes less and less expensive, what is an increasingly good design choice?

Interrupt-driven I/O

62
New cards

What is the main advantage of buffered I/O?

Reduction in the number of system calls to perform I/O

63
New cards

The equation, Time = max(t1, t2), is an appropriate model for execution time by an:

MIMD computer of an if-else statement

64
New cards

What does loop unrolling reduce?

It reduces the number of overhead machine instructions only

65
New cards

An L1 cache circuit is direct mapped, has 1024 sets, receives 64-bit addresses from the processor, and receives 32-byte blocks from the memory hierarchy. What question do you need to ask and have answered before having enough information to compute the total number of overhead SRAM memory cell circuits for this cache?

Is this a write-back cache? (extra dirty bit is needed if write-back)

66
New cards

Reacting to an L1 cache miss by immediately loading the block containing the missed item means that caching policy is focused on:

Spatial locality

67
New cards

How many two-input NAND gates are necessary to build one two-input OR gate with active high inputs and active high output?

Three (two are used to invert the inputs)

68
New cards

Which branch prediction method is considered dynamic?

a) Predict taken

b) Predict not taken

c) 1-bit history

d) Branch target buffer (BTB)

e) None of the above

c) 1-bit history

69
New cards

What pipeline enhancement allows a register operand to be obtained from various locations in the pipeline?

Forwarding

70
New cards

What is a disadvantage of using branch prediction in a processor’s pipeline?

Increased complexity of the control unit

71
New cards

What does a miss penalty in the context of cache memory indicate?

The extra time required to service a cache miss

72
New cards

Which operation is performed by the ALU when executing the instruction “sub r1, r2, r3”?

r1 = r2 - r3

73
New cards

What does the term “write-through” refer to in a caching system?

Data is written to both the cache and backing store simultaneously

74
New cards

What is the primary function of a translation lookaside buffer (TLB)?

To store the recent address translations between virtual and physical addresses

75
New cards

An assembly language program snippet implements a high level language “for loop” control flow construct. Which assembly language instruction must appear in the snippet?

Whenever a condition is true, fetch the next instruction from a location having a name

76
New cards

A performance model for a two-level memory hierarchy of SRAM and DRAM is Average Memory Access Time = Hit Rate x Hit Time + (1 – Hit Rate) x Miss Time Improving latency for both SRAM and DRAM would reduce Average Memory Access Time by improving:

Hit time and miss time

77
New cards

Measurements of computer system performance should:

a) Be reproducible

b) Be similar to actual workloads

c) Be portable among many computer systems

d) Measure time

e) Each of the other answers is correct

e) Each of the other answers is correct

78
New cards

(T/F) Pipelining increases machine instruction processing latency.

True

79
New cards

(T/F) The register file is accessed by two stages of the classic 5-stage pipelined processor.

True

80
New cards

(T/F) Multiple virtual memory spaces may exist at the same time in a computer.

True

81
New cards

(T/F) An application program can request an output device to interrupt the processor on or during the next clock cycle.

False

82
New cards

(T/F) A multiplexer ignores an input bus.

True

83
New cards

A program requests to read information from an I/O device and no devices respond. The type of bus event that has occurred is:

An unassigned address error

84
New cards

What function used to implement an I/O buffer may have no effect when called?

Flush

85
New cards

What must be making use of instruction level parallelism?

Pipelined processor

86
New cards

What technique reduces the number of instructions that must be executed for a given HLL application program?

Loop unrolling

87
New cards

Which part of a virtual address is not stored in a single-level page table?

Offset (it is used to address within a page, not in the page table)

88
New cards

What digital logic circuit is used to select a single ALU function unit output based on the opcode?

Multiplexer

89
New cards

What performance impact does increasing the size of a CPU’s branch predictor table have?

Improves accuracy of prediction, potentially increasing performance

90
New cards

What is the result of a successful cache hit?

Data is retrieved from the cache

91
New cards

What occurs when an interrupt is raised while the CPU is in the middle of executing another interrupt service routine?

Depends on the priority of the new interrupt; if it’s higher, it may pre-empt the current routine

92
New cards

What is the primary benefit of pipelining in a computer processor?

Increases the number of instructions completed per unit time by overlapping execution stages

93
New cards

What is George Adams’ favorite pastime?

Torturing students

94
New cards

(T/F) There may exist multiple virtual memory address spaces at the same time in a running computer.

True

95
New cards

(T/F) A bus error occurs when two or more interfaces respond to an address.

True

96
New cards

(T/F) Special purpose hardware is faster and uses less energy than does the same function implemented in software executed by a general purpose CPU.

True

97
New cards

If any one of the inputs a to a binary full adder circuit is changed to the other logic level, then after the worst case propagation delay for the full adder:

the Sum output has changed

98
New cards

What circuit implements the pointing function?

Decoder

99
New cards

Because a processor circuit performs the fetch-execute cycle when it is supplied with electrical power, software must ensure that there:

Is always a next instruction

100
New cards

Control flow in a machine language program is:

Managed by computation of a pointer