This page is for a prior offering of CS 3330. It is not up-to-date.
This page contains quizzes given Spring 2016. For other semesters see the main old quizzes page
|
||||||||||||||||||
Some of the tools we use in this class use strict ANSI-compliant C. You can get this version by running |
||||||||||||||||||
Suppose you have a variable declared as an array (e.g., int y[32]) and another declared as a pointer (e.g., “int *z“). In what way do the two variable differ? |
||||||||||||||||||
|
Suppose a process spends 1 second doing task A, then 3 doing B, then 6 doing C. Which of the following will give the biggest speedup?
|
||||||||||||
Given some type T (where sizeof(T) ≠ 1) and a variable declared “T *x , which of the following is equivalent tox[3]“? |
||||||||||||
Suppose I have a type declared “typedef struct range_t { int length; int *ptr; } range;" and a function declared range foo()that returns a range with length=8 and an 8-element heap-allocated array pointed to by ptr. How much heap memory does foo need to use? Select all that apply (i.e., the answer should be the sum of the options you pick). |
||||||||||||
3330in C? Answer as an integer number of bytes (expressed in the usual base-10 format with no leading zeros). Ignore alignment and other nuances of memory that we have not discussed. |
|
|
|
While can be converted to assembly either as jump-to-middle or as guarded-do, the latter of which the book describes as enabling other optimizations. Without those extra optimizations, which one involves executing more instructions?
|
||||||||||||||||
The text discusses stack usage with call and ret, but this is mostly convention, not forced behavior. Which of the following jumps to an address that is stored in a register?
|
||||||||||||||||
Y86-64 has the following features. Select all that suggest Y86-64 is a RISC architecture:
|
||||||||||||||||
In a little-endian machine, select all that apply:
|
Suppose we were creating an instruction ipushq that moves from an immediate to the stack. Figures 4.18 and 4.20 in the textbook describe irmovq (which moves from an immediate) and pushq (which moves to the stack). Using them as a reference, answer the following questions about how we would describe the behaviour of ipushq. Suggestion: write out a full description of ipushq on paper and then answer the questions below.
|
Section 4.3.3 SEQ Timingemphasizes that (1) no stage depends on the results of a later stage and (2) no instruction reads a register or memory value after writing it. Which of the following would violate one of these two rules? |
||||||||||
irmovq moves from an immediate value (which can be found in valC) to the register file, but neither figure 4.23 nor the up-close view of memory in figure 4.28 has an arrow from valC to the register file. Why not?
|
|
||||||||||||||||||||||||||||||||||||||||||
A generic register has two inputs: a single-bit clock and several-bit data input; it also has one output, a several-bit data output.
|
In the context of chapter 4, a hazard is a characteristic of which of the following?
|
||||||||||||||
In the context of chapter 4, a dependency is a characteristic of which of the following?
|
||||||||||||||
Suppose we are executing a program containing instructions: i1, i2, i3, i4, … etc. Assume all of the instructions run in order and without jumps, stalls, dependencies, or hazards. Assume the five-stage pipeline discussed in the textbook. |
||||||||||||||
Suppose we are executing a program containing instructions: i1, i2, i3, i4, … etc. Assume all of the instructions run in order and without jumps or stalls. Assume the five-stage pipeline discussed in the textbook. |
||||||||||||||
Suppose we are executing a program containing instructions: i1, i2, i3, i4, … etc. Assume all of the instructions run in order and without jumps or forwarding. Assume the five-stage pipeline discussed in the textbook. |
If power is lost for 1 millisecond and then restored, which kind of RAM will still have its contents?
|
||||||||||
Which of the following has the best temporal locality? Consider only data accesses, not instructions.
|
||||||||||
Which of the following has the best spatial locality? Consider only data accesses, not instructions.
|
||||||||||
|
||||||||||
|
|
||||||||||||
|
||||||||||||
Suppose two set-associative caches (A and B) have the same total data capacity, same address size, and same block size, but cache A has twice as many lines per set as cache B. Which of the following is true?
|
||||||||||||
In a set-associative cache, which of the following does not impact the way an address is split into tag, index, and offset?
|
For each code snippet below, assume that p and q each points to an array containing the first nine prime numbers (2, 3, …, 23). Select the answer(s) if and only if the code behaves the same both when p and q are aliases and when they are not aliases.
|
||||||||||||
Which of the following best describes the intent of eliminating loop inefficiencies? |
||||||||||||
Function inlining (described in an aside in section 5.1) is the ultimate solution to reducing procedure calls. In non-recursive code, it is possible to inline all procedures and have no procedure call overhead at all. Doing this is a bad idea because (select all that apply)
|
||||||||||||
Which of the following does NOT appear to have an unneeded memory reference? Assume the program does some work between the two address accesses.
|
|
||||||||||
Multiple Accumulatorsis listed under Parallelism,meaning pipeline parallelism.They help because |
||||||||||
|
||||||||||
|
||||||||||
|
||||||||||
|
|
||||||||||||||
|
Consider two processes A and B. Which of the following is equivalent to the statement A and B are executing concurrently? |
||||||||||
Consider two processes A and B. Which of the following is equivalent to the statement A and B are executing in parallel? |
||||||||||
|
||||||||||
|
||||||||||
|
|
||||||||||||||||
If each PTE is 8 bytes and each page is 4 KB, how large is a single-level page table for 30-bit addresses?
|
||||||||||||||||
A page table’s conceptual datatype (implemented by both single- and multi-level page tables) is
|
||||||||||||||||
A page table entry in a multi-level page table stores metadata (such as a valid bit) and
|
||||||||||||||||
To look up an address (not to access the data at the address, just to perform the address translation) using a three-level page table, the MMU needs to access memory
|
|
||||||||||||||
The set index of an address going to a cache is like the _____ of a virtual address going to a page table
|
||||||||||||||
Virtual memory can be thought of as using RAM as a cache for disk. Thought of in this way, virtual memory is
|
||||||||||||||
Some page faults generate SIGSEGV (a.k.a. segfault) and others are handled without any problems. Which of the following can be handled without a SGISEGV? |
Compare and contrast memory caching (where slow RAM and fast L# caches interact to provide the illusion of a large, fast memory) and virtual memory (where slow disk and fast RAM interact to provide the illusion of large, fast memory). Several questions refer to The table below summarizes the paragraph above:
Anywhere it matters, assume the cache is set-associative and the virtual memory uses multi-level page tables
|