Quiz
SDP10 Final - Part II
Fragen in diesem Quiz (31)
1Given 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).

- ARichtig
- BFalsch
2The code (a && b) || (!a && !b) implements -
- AAdder
- BEquality
- CMUX
- DSet membership
3What is the difference between logical and bitwise operators. (for example && and &)
- AThe 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.
- B&& (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. - Cэто открытый вопрос, выше два примера как можно ответить (этот вариант отмечен как правильный)
- AThe logical and operator ‘&&’ expects its operands to be boolean expressions (either 1 or 0) and returns a boolean value.
4Initially 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?
- ANone of the above
- B3
- C0x25
- D0x23
5Choose the correct compilation of rax = (rbx ? rcx : rdx)?
- A

- B

- C

- D

- A
6This is an example of?

- ASerial processing
- BLinear processing
- CParallel processing
- Dnone of the above
7This is an example of?

- ASerial processing
- BLinear processing
- CParallel processing
- Dnone of the above
8Object files are:
- Aне вариантов
- Bне правильный вариант
9Thread (as with OpenMP) Which of the following is true?
- Aнет вариантов
- Bне правильный ответ
10______construct encloses code, forming a parallel region.
- Aparallel
- Bне правильный вариант
11____ is the default schedule type. Upon entering the loop, each thread independently decides which chunk of the loop they will process
- Astatic
- Bне правильный вариант
12OpenMP assigns one iteration to each thread. When the thread finishes, it will be assigned the next iteration that hasn’t been executed yet.
- AThis program can be greatly improved with a dynamic schedule.
- Bне правильный вариант
13The _____ directive causes threads encountering the barrier to wait until all the other threads in the same team have encountered the barrier.
- Abarrier
- Bне правильный вариант
14What is the value of the following C expression? x = 0xBC and y = 0x35 (x & !y)
- A0x0000
- B0x0001
- C0xFFF
- D0x1200
15We say that pipelining generally increases throughput. That statement means (select all that are part of the definition of “increases throughput”):
- AA entire programs take more time to complete
- BB entire programs take less time to complete
- CC each instruction takes less time to complete
- DD each instruction takes more time to complete
16Consider the following code. Which of the following memory errors does it have? Select all that apply.

- Aconfusing pointer and value sizes
- Breading uninitialized memory
- Coff-by-one memory access error
- Ddereferencing a value as if it were a pointer
- Ereturning references to nonexistent values
17What kind of locality does the following code benefit from? Assume that n and m are very large numbers.

- Aspatial locality
- Btemporal locality
- Cboth of the above
- Dnone of the above
18Given that a and b are each either 0 or 1, which one of the following is not always true?
- A(a ∧ b) == ((a - b) & 1)
- B(a ∧ b) == (a != b)
- C(a ∧ b) == ((a + b) >> 1)
- D(a ∧ b) == (a ? !b : b)
19What is a “caller-save” register?
- AA special register that saves who called the procedure
- BA program register that the called procedure may not modify
- CA program register that the called procedure may modify
- Dnone of the above
20A fully-associative cache is like a
- Adirect-mapped cache with only one set
- Bdirect-mapped cache with only one line per set
- Cset-associative cache with only one line per set
- Dset-associative cache with only one set
21Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?

- ABlock the accesses by nesting three or four for loops instead of just two
- BChange int** to int*
- CChange the for-j loop to count up from 0, not down from m-1
- DPut the for-i loop inside of the for-j loop instead of the other way around
22Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?

- AChange int** to int*
- BPut the for-i loop inside of the for-j loop instead of the other way around
- CChange the for-j loop to count up from 0, not down from m-1
- DBlock the accesses by nesting three or four for loops instead of just two
23In 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];
- A0x10002
- B0x10008
- C0x10004
- D8 plus the contents of location 0x10000
24Given unsigned int variables a and b, if a + b == a ^ b is true, then which of the following must also be true?
- Aa + b == a * b
- Ba + b == a | b
- Ca + b == a - b
- Da + b == a & b
25The 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?
- A1
- B5
- C4
- D3
- E2
26Consider 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?
- A0.0111
- B0.01111
- C0.111
- D1111
27Consider 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?
- A1
- B5, 6, or 7
- C8
- Dbetween 9 and 15
- E32
28Consider 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?- A1
- B0.1
- C0.0001
- D0
29Consider 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
- A1.01
- B−0.0001
- C11000
- D−111
- ENone of the above can be represented in this format
- FNone of the above because you can’t have a 5-bit IEEE-style floating point number with 3 exponent bits
30Y86 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
- Armmovl %eax, $1234 ; jmp $1234
- Bpushl %eax ; ret
- Crrmovl %eax, %PC
- DAll of the above work
- ENone of the above work
31Given int variables a and b, which of the following implements if (!a) b == 0;?
- Ab &= !!a;
- Bb &= !-a;
- Cb &= !a;
- Db &= a;
- Eb &= -a;
- Fb &= -!a;
- Gnone of the above
Informationen
- Beschreibung
- SDP10 Quiz am SDP10 Final - Part II, erstellt von Csse 1502 am 13/05/2018.
- Autor
- Csse 1502
- Sprache
- English
- Aufrufe
- 328
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz