Pregunta 1
Pregunta
Given the declaration int A[10][20]; in C, the following assembly code implements A[i][j] = 1; (assuming A, i, and j are all global variables).
Pregunta 2
Pregunta
The code (a && b) || (!a && !b) implements -
Respuesta
-
Adder
-
Equality
-
MUX
-
Set membership
Pregunta 3
Pregunta
What is the difference between logical and bitwise operators. (for example && and &)
Respuesta
-
The logical and operator ‘&&’ expects its operands to be boolean expressions (either 1 or 0) and returns a boolean value.
The bitwise and operator ‘&’ works on Integral (short, int, unsigned, char, bool, unsigned char, long) values and return Integral value.
If an integral value is used as an operand for ‘&&’ which is supposed to work on boolean values, following rule is used in C.
…..A zero is considered as false and non-zero is considered as true.
For example in the following program x and y are considered as 1.
The ‘&&’ operator doesn’t evaluate second operand if first operand becomes false. Similarly ‘||’ doesn’t evaluate second operand when first operand becomes true. The bitwise ‘&’ and ‘|’ operators always evaluate their operands.
-
&& (logical and operator) - The left and right operands are boolean expressions. If both the operands are non-zero, then the condition becomes true.
>
& (bitwise and operator) - The left and right operands are integral types. Binary AND Operator copies a bit to the result if it exists in both operands.
-
это открытый вопрос, выше два примера как можно ответить (этот вариант отмечен как правильный)
Pregunta 4
Pregunta
Initially byte i of memory is i + 0x20 (mod 256), %eax contains the number 3, and %ebx contains the number 5. What is in %ebx after running x86 movl (%eax), %ebx?
Respuesta
-
None of the above
-
3
-
0x25
-
0x23
Pregunta 5
Pregunta
Choose the correct compilation of rax = (rbx ? rcx : rdx)?
Pregunta 6
Pregunta
This is an example of?
Respuesta
-
Serial processing
-
Linear processing
-
Parallel processing
-
none of the above
Pregunta 7
Pregunta
This is an example of?
Respuesta
-
Serial processing
-
Linear processing
-
Parallel processing
-
none of the above
Pregunta 8
Pregunta
Object files are:
Respuesta
-
не вариантов
-
не правильный вариант
Pregunta 9
Pregunta
Thread (as with OpenMP) Which of the following is true?
Respuesta
-
нет вариантов
-
не правильный ответ
Pregunta 10
Pregunta
______construct encloses code, forming a parallel region.
Respuesta
-
parallel
-
не правильный вариант
Pregunta 11
Pregunta
____ is the default schedule type. Upon entering the loop, each thread independently decides which chunk of the loop they will process
Respuesta
-
static
-
не правильный вариант
Pregunta 12
Pregunta
OpenMP assigns one iteration to each thread. When the thread finishes, it will be assigned the next iteration that hasn’t been executed yet.
Pregunta 13
Pregunta
The _____ directive causes threads encountering the barrier to wait until all the other threads in the same team have encountered the barrier.
Respuesta
-
barrier
-
не правильный вариант
Pregunta 14
Pregunta
What is the value of the following C expression? x = 0xBC and y = 0x35 (x & !y)
Respuesta
-
0x0000
-
0x0001
-
0xFFF
-
0x1200
Pregunta 15
Pregunta
We say that pipelining generally increases throughput. That statement means (select all that are part of the definition of “increases throughput”):
Respuesta
-
A entire programs take more time to complete
-
B entire programs take less time to complete
-
C each instruction takes less time to complete
-
D each instruction takes more time to complete
Pregunta 16
Pregunta
Consider the following code. Which of the following memory errors does it have? Select all that apply.
Respuesta
-
confusing pointer and value sizes
-
reading uninitialized memory
-
off-by-one memory access error
-
dereferencing a value as if it were a pointer
-
returning references to nonexistent values
Pregunta 17
Pregunta
What kind of locality does the following code benefit from? Assume that n and m are very large numbers.
Respuesta
-
spatial locality
-
temporal locality
-
both of the above
-
none of the above
Pregunta 18
Pregunta
Given that a and b are each either 0 or 1, which one of the following is not always true?
Pregunta 19
Pregunta
What is a “caller-save” register?
Respuesta
-
A special register that saves who called the procedure
-
A program register that the called procedure may not modify
-
A program register that the called procedure may modify
-
none of the above
Pregunta 20
Pregunta
A fully-associative cache is like a
Respuesta
-
direct-mapped cache with only one set
-
direct-mapped cache with only one line per set
-
set-associative cache with only one line per set
-
set-associative cache with only one set
Pregunta 21
Pregunta
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Respuesta
-
Block the accesses by nesting three or four for loops instead of just two
-
Change int** to int*
-
Change the for-j loop to count up from 0, not down from m-1
-
Put the for-i loop inside of the for-j loop instead of the other way around
Pregunta 22
Pregunta
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Respuesta
-
Change int** to int*
-
Put the for-i loop inside of the for-j loop instead of the other way around
-
Change the for-j loop to count up from 0, not down from m-1
-
Block the accesses by nesting three or four for loops instead of just two
Pregunta 23
Pregunta
In C, assuming that an int takes 4 bytes, if array a is declared as follows and a has the value 0x10000, what is the value of the expression a + 2? int a[12];
Pregunta 24
Pregunta
Given unsigned int variables a and b, if a + b == a ^ b is true, then which of the following must also be true?
Respuesta
-
a + b == a * b
-
a + b == a | b
-
a + b == a - b
-
a + b == a & b
Pregunta 25
Pregunta
The bias of any IEEE-style floating point number is 2e−1 − 1, where e is the number of exponent bits. Suppose 010010 is a six-bit IEEE-style floating point number that represents the decimal value 2.5. How many exponent bits does the number have?
Pregunta 26
Pregunta
Consider a six-bit IEEE-style floating-point number with 1 sign, 2 exponent, and 3 fraction bits. Assume the bias is 1. Answers are written in binary. What is the largest denormalized value?
Respuesta
-
0.0111
-
0.01111
-
0.111
-
1111
Pregunta 27
Pregunta
Consider a six-bit IEEE-style floating-point number with 1 sign, 2 exponent, and 3 fraction bits. Assume the bias is 1. Answers are written in binary. How many of the 26 bit patters in this format are NaNs?
Respuesta
-
1
-
5, 6, or 7
-
8
-
between 9 and 15
-
32
Pregunta 28
Pregunta
Consider a six-bit IEEE-style floating-point number with 1 sign, 2 exponent, and 3 fraction bits. Assume the bias is 1. Answers are written in binary.EEE
What is the smallest non-negative normalized value?
Pregunta 29
Pregunta
Consider a 5-bit IEEE-style floating point number with 3 exponent bits (bias 3). Which of the following can be expressed in this format? Options are written in binary
Pregunta 30
Pregunta
Y86 does not have an instruction for jumping to an address stored in a register location; instead the conceptual action jmp %eax can be implemented by
Pregunta 31
Pregunta
Given int variables a and b, which of the following implements if (!a) b == 0;?
Respuesta
-
b &= !!a;
-
b &= !-a;
-
b &= !a;
-
b &= a;
-
b &= -a;
-
b &= -!a;
-
none of the above