Questão 1
Questão
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).
Questão 2
Questão
The code (a && b) || (!a && !b) implements -
Responda
-
Adder
-
Equality
-
MUX
-
Set membership
Questão 3
Questão
What is the difference between logical and bitwise operators. (for example && and &)
Responda
-
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.
-
это открытый вопрос, выше два примера как можно ответить (этот вариант отмечен как правильный)
Questão 4
Questão
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?
Responda
-
None of the above
-
3
-
0x25
-
0x23
Questão 5
Questão
Choose the correct compilation of rax = (rbx ? rcx : rdx)?
Questão 6
Questão
This is an example of?
Responda
-
Serial processing
-
Linear processing
-
Parallel processing
-
none of the above
Questão 7
Questão
This is an example of?
Responda
-
Serial processing
-
Linear processing
-
Parallel processing
-
none of the above
Questão 8
Questão
Object files are:
Responda
-
не вариантов
-
не правильный вариант
Questão 9
Questão
Thread (as with OpenMP) Which of the following is true?
Responda
-
нет вариантов
-
не правильный ответ
Questão 10
Questão
______construct encloses code, forming a parallel region.
Responda
-
parallel
-
не правильный вариант
Questão 11
Questão
____ is the default schedule type. Upon entering the loop, each thread independently decides which chunk of the loop they will process
Responda
-
static
-
не правильный вариант
Questão 12
Questão
OpenMP assigns one iteration to each thread. When the thread finishes, it will be assigned the next iteration that hasn’t been executed yet.
Questão 13
Questão
The _____ directive causes threads encountering the barrier to wait until all the other threads in the same team have encountered the barrier.
Responda
-
barrier
-
не правильный вариант
Questão 14
Questão
What is the value of the following C expression? x = 0xBC and y = 0x35 (x & !y)
Responda
-
0x0000
-
0x0001
-
0xFFF
-
0x1200
Questão 15
Questão
We say that pipelining generally increases throughput. That statement means (select all that are part of the definition of “increases throughput”):
Responda
-
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
Questão 16
Questão
Consider the following code. Which of the following memory errors does it have? Select all that apply.
Responda
-
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
Questão 17
Questão
What kind of locality does the following code benefit from? Assume that n and m are very large numbers.
Responda
-
spatial locality
-
temporal locality
-
both of the above
-
none of the above
Questão 18
Questão
Given that a and b are each either 0 or 1, which one of the following is not always true?
Questão 19
Questão
What is a “caller-save” register?
Responda
-
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
Questão 20
Questão
A fully-associative cache is like a
Responda
-
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
Questão 21
Questão
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Responda
-
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
Questão 22
Questão
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Responda
-
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
Questão 23
Questão
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];
Questão 24
Questão
Given unsigned int variables a and b, if a + b == a ^ b is true, then which of the following must also be true?
Responda
-
a + b == a * b
-
a + b == a | b
-
a + b == a - b
-
a + b == a & b
Questão 25
Questão
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?
Questão 26
Questão
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?
Responda
-
0.0111
-
0.01111
-
0.111
-
1111
Questão 27
Questão
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?
Responda
-
1
-
5, 6, or 7
-
8
-
between 9 and 15
-
32
Questão 28
Questão
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?
Questão 29
Questão
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
Questão 30
Questão
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
Questão 31
Questão
Given int variables a and b, which of the following implements if (!a) b == 0;?
Responda
-
b &= !!a;
-
b &= !-a;
-
b &= !a;
-
b &= a;
-
b &= -a;
-
b &= -!a;
-
none of the above