This page is for a prior offering of CS 3330. It is not up-to-date.
This page contains quizzes given Spring 2015. For other semesters see the main old quizzes page
: Which two of the following four binary number formats are used by modern computer hardware?
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
: Which of the following is true for all possible values of unsigned x?
|
If you have a floating-point number with a 2-bit exponent (bias 1) and a 3-bit fraction, which of the following numbers (shown in binary) is the largest finite number it can represent?
|
||||||||||||||||||||||||||
If you have a floating-point number with a 2-bit exponent (bias 1) and a 3-bit fraction, what is the smallest positive number (> 0) it can represent? Answers are shown in binary
|
||||||||||||||||||||||||||
x operator y, where x and y are each either int or unsigned int. For how many of these 8 operators will those bits differ depending on the singed/unsigned nature of x and y? Your answer should be a single digit between 0 and 8: |
How many total bytes of data can be stored in the (integer) IA32 program registers at one time? (a program register is one you can use as an operand when in programming in IA32 assembly)
|
||||||||||||||||||||||||||
The textbook uses ATT-format assembly, the default for most GNU tools. Some other tools use Intel-format assembly instead. Each of the following is true for only one of the two formats. Check those that are true of ATT-format assembly:
|
||||||||||||||||||||||||||
pushl %eax;is the same as
|
||||||||||||||||||||||||||
The imulinstruction has only one operand, as in imul $101;, but the multiplication operation is implements requires two operands. The second operand is
|
In Java, C++, etc, there are types: a String is not the same as a Scanner, and so on. Types are distinct from meaning: int x might mean your age and int y might mean your number of siblings, but the language doesn’t stop you from saying x = ybecause they are both type int. In assembly
|
||||||||||||||||||||||||||
IA32 (also called x86) is CISC, not RISC, because (check all that apply)
|
Two of the following are equivalent to the single-bit mux that the book denotes [ s : A; 1 : B; ], the other two are not equivalent to that mux. Mark the two that are:
|
||||||||||||||||||||||
Consider the instruction subl %edx, %ebxpassing through the five stages Fetch, Decode, Execute, Memory, Writeback. In which stage does the hardware retrieve the value stored in register %edx?
|
||||||||||||||||||||||
Consider the instruction subl %edx, %ebxpassing through the five stages Fetch, Decode, Execute, Memory, Writeback. In which stage does the hardware decide where the result will be stored?
|
||||||||||||||||||||||
Not all stages are invovled in executing all instructions. Consider the instruction subl %edx, %ebxpassing through the five stages Fetch, Decode, Execute, Memory, Writeback. Which (if any) stages are not involved in handling this instruction? Check any that apply
|
Which of the following operations read a value from memory? Check all that apply
|
||||||||||||||||||||||||||||||||||||||||||||||
Which of the following operations write a value to memory? Check all that apply
|
||||||||||||||||||||||||||||||||||||||||||||||
Which of the following operations write a value to a program register? Check all that apply
|
||||||||||||||||||||||||||||||||||||||||||||||
Which of the following operations read a value from a program register? Check all that apply
|
||||||||||||||||||||||||||||||||||||||||||||||
The book discusses using the ALU just to forward values for some operations (e.g., their irmovl has the ALU compute 0 + valC) and to do math for other operations. The forwarding is just a design choice and could have been done otherwise, but the math is intrinsic to the operation of Y86. Which of the following operations use the ALU to do math?
|
||||||||||||||||||||||||||||||||||||||||||||||
When building a chip, we can pick any clock speed we want; the goal is to make it as fast as we can while still being slow enough that no register grabs onto a value before that value has stabilized. Which of the following instructions would be most likely to determine the SEQ clock speed?
|
In general, pipelining
|
||||||||||||||||||||||||||
Nonuniform partitioning happens when
|
||||||||||||||||||||||||||
Suppose instruction A is followed by instruction B in the assembled code. There is a hazard between A and B if (check all that apply)
|
||||||||||||||||||||||||||
In the five-stage pipeline (F, D, E, M, W) we want E to have a second cycle to run its work. Assume there is a pipeline register before each stage (one before F, one before D, etc). How many of those 5 pipeline registers do we need to send the stallsignal?
|
||||||||||||||||||||||||||
In the five-stage pipeline (F, D, E, M, W) we want E to have a second cycle to run its work. Assume there is a pipeline register before each stage (one before F, one before D, etc). How many of those 5 pipeline registers do we need to send the bubblesignal?
|
Which of the following is orders from slowest to fastest?
|
||||||||||||||||||||||||||
Data can be stored in program registers, memory, or disk. Which of the following technologies (if any) is/are most commonly associated with memory? Check all that apply
|
||||||||||||||||||||||||||
Which of the following needs to be read and then re-written periodically in order to retain its storage? Check all that apply
|
||||||||||||||||||||||||||
Which of the following needs power in order to retain its storage? Check all that apply
|
Code has good spatial locality if
|
||||||||||||||||||||||||||||||
Code has good temporal locality if
|
||||||||||||||||||||||||||||||
Which of the following describes the kind of caching that the memory hierarchy implements?
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
In a set-associative cache, which of the following can be determined from the memory address and cache organization alone (i.e., without knowing the cache contents)? Check all that apply.
|
Quiz 10 was not given
Which of the following is expected to run fastest? Assume N and M are large numbers.
|
||||||||||||||||||||||||||
Which of the following is expected to run fastest? Assume N is a large number.
|
||||||||||||||||||||||||||
Which of the following are not tips for optimizing memory accesses given in the textbook? Check all that apply
|
We want to loop over all i, j, and k (between 0 and 10240) and run the following: a[i][j] = b[i][k] * c[k][j] In order to maximize cache locality, in what order should the loops be placed?
|
||||||||||||||||||||||||||||||
Which of the following is describes the situations in which you should optimize your code for cache locality?
|
||||||||||||||||||||||||||||||
Using a #define IDX (like those shown in class) and a 1D array instead of a 2D array is done because
|
Suppose function A is O(n) and for n=1 takes 100ms; function B is O(n^2) and for n=1 takes 1ms. Which of the following n do you expect to be the smallest for which A is faster than B?
|
||||||||||||||||||||||||||||||
Register spilling is when
|
||||||||||||||||||||||||||||||
Which of the following would you expect to be fastest? Assume we compile with the -O1 flag (i.e., the compiler stores variables in registers, but not fancier optimizations).
|
||||||||||||||||||||||||||||||
Which of the following would you expect to be fastest? Assume we compile with the -O1 flag (i.e., the compiler stores variables in registers, but not fancier optimizations).
|
If a virtual page is allocated and in physical memory, how do we discover the physical page number?
|
||||||||||||||||||||||
If a virtual page is allocated but is not in physical memory, how do we discover the physical page number?
|
||||||||||||||||||||||
If a virtual page is not allocated, how do we discover the physical page number?
|
Page tables are stored in
|
||||||||||||||||||||||
If you have a single-level page table, the amount of space it requires varies based on how many pages are in use.
|
||||||||||||||||||||||
If you have a multi-level page table, the amount of space it requires varies based on how many pages are in use.
|
||||||||||||||||||||||
If your program uses 100% of the virtual address space (even the parts normally not used), having a multi-level page table requires
|
||||||||||||||||||||||
If your program uses only a small fraction of the virtual address space, having a multi-level page table requires
|
Section 9.7.2 talks about how linux keeps track of memory regions with regard to read/write/execute permissions and shared memory. That information is also in the page table entries. Why should there be vm_area_structs if the same information is in the page table?
|
||||||||||||||||||||||||||||||
Section 9.9 reviews how malloc and free work. One implementation of malloc and free has free do nothing and malloc simply keep a single pointer it increments each time it is called. This implementation has
|
||||||||||||||||||||||||||||||
Section 9.10 discusses garbage collector. These often perform reachability analysis, tracing all pointers recursively to find what parts of allocated memory are actually usable. The reachability analysis starts assuming that what is reachable?
|
A cache maps an address to a value. Virtual memory maps an address to another address. Which kind of cache is virtual memory (i.e., page tables, not the TLB) organized the most like?
|
||||||||||||||||||||||||||
Let V be the size of the virtual address space and P be the size of the physical memory. Which of the following is true?
|
||||||||||||||||||||||||||
A page table entry contains some permission information and some type of pointer. If our program is trying to dereference a 32-bit integer value stored in memory, page tables accessed along the way could point to (select all that apply)
|
Which type of exception does not use the exception table?
|
||||||||||||||||||||||
Which type of exception can occur without any particular instruction being the cause of the exception?
|
||||||||||||||||||||||
Which type of exception has an instruction that always causes it?
|
||||||||||||||||||||||
Which type of exception has an instruction that sometimes causes it and sometimes runs without causing it?
|