SDP10 Final - Part II

Beschreibung

SDP10 Quiz am SDP10 Final - Part II, erstellt von Csse 1502 am 13/05/2018.
Csse 1502
Quiz von Csse 1502, aktualisiert more than 1 year ago
Csse 1502
Erstellt von Csse 1502 vor mehr als 6 Jahre
266
3

Zusammenfassung der Ressource

Frage 1

Frage
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).
Antworten
  • True
  • False

Frage 2

Frage
The code (a && b) || (!a && !b) implements -
Antworten
  • Adder
  • Equality
  • MUX
  • Set membership

Frage 3

Frage
What is the difference between logical and bitwise operators. (for example && and &)
Antworten
  • 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.
  • это открытый вопрос, выше два примера как можно ответить (этот вариант отмечен как правильный)

Frage 4

Frage
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?
Antworten
  • None of the above
  • 3
  • 0x25
  • 0x23

Frage 5

Frage
Choose the correct compilation of rax = (rbx ? rcx : rdx)?

Frage 6

Antworten
  • Serial processing
  • Linear processing
  • Parallel processing
  • none of the above

Frage 7

Antworten
  • Serial processing
  • Linear processing
  • Parallel processing
  • none of the above

Frage 8

Frage
Object files are:
Antworten
  • не вариантов
  • не правильный вариант

Frage 9

Frage
Thread (as with OpenMP) Which of the following is true?
Antworten
  • нет вариантов
  • не правильный ответ

Frage 10

Frage
______construct encloses code, forming a parallel region.
Antworten
  • parallel
  • не правильный вариант

Frage 11

Frage
____ is the default schedule type. Upon entering the loop, each thread independently decides which chunk of the loop they will process
Antworten
  • static
  • не правильный вариант

Frage 12

Frage
OpenMP assigns one iteration to each thread. When the thread finishes, it will be assigned the next iteration that hasn’t been executed yet.
Antworten
  • This program can be greatly improved with a dynamic schedule. 
  • не правильный вариант

Frage 13

Frage
The _____ directive causes threads encountering the barrier to wait until all the other threads in the same team have encountered the barrier.
Antworten
  • barrier
  • не правильный вариант

Frage 14

Frage
What is the value of the following C expression? x = 0xBC and y = 0x35 (x & !y)
Antworten
  • 0x0000
  • 0x0001
  • 0xFFF
  • 0x1200

Frage 15

Frage
We say that pipelining generally increases throughput. That statement means (select all that are part of the definition of “increases throughput”):
Antworten
  • 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

Frage 16

Frage
Consider the following code. Which of the following memory errors does it have? Select all that apply.
Antworten
  • 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

Frage 17

Frage
What kind of locality does the following code benefit from? Assume that n and m are very large numbers.
Antworten
  • spatial locality
  • temporal locality
  • both of the above
  • none of the above

Frage 18

Frage
Given that a and b are each either 0 or 1, which one of the following is not always true?
Antworten
  • (a ∧ b) == ((a - b) & 1)
  • (a ∧ b) == (a != b)
  • (a ∧ b) == ((a + b) >> 1)
  • (a ∧ b) == (a ? !b : b)

Frage 19

Frage
What is a “caller-save” register?
Antworten
  • 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

Frage 20

Frage
A fully-associative cache is like a
Antworten
  • 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

Frage 21

Frage
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Antworten
  • 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

Frage 22

Frage
Consider the following code. Which of the following changes would make the largest positive impact on its cache locality?
Antworten
  • 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

Frage 23

Frage
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];
Antworten
  • 0x10002
  • 0x10008
  • 0x10004
  • 8 plus the contents of location 0x10000

Frage 24

Frage
Given unsigned int variables a and b, if a + b == a ^ b is true, then which of the following must also be true?
Antworten
  • a + b == a * b
  • a + b == a | b
  • a + b == a - b
  • a + b == a & b

Frage 25

Frage
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?
Antworten
  • 1
  • 5
  • 4
  • 3
  • 2

Frage 26

Frage
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?
Antworten
  • 0.0111
  • 0.01111
  • 0.111
  • 1111

Frage 27

Frage
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?
Antworten
  • 1
  • 5, 6, or 7
  • 8
  • between 9 and 15
  • 32

Frage 28

Frage
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?
Antworten
  • 1
  • 0.1
  • 0.0001
  • 0

Frage 29

Frage
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
Antworten
  • 1.01
  • −0.0001
  • 11000
  • −111
  • None of the above can be represented in this format
  • None of the above because you can’t have a 5-bit IEEE-style floating point number with 3 exponent bits

Frage 30

Frage
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
Antworten
  • rmmovl %eax, $1234 ; jmp $1234
  • pushl %eax ; ret
  • rrmovl %eax, %PC
  • All of the above work
  • None of the above work

Frage 31

Frage
Given int variables a and b, which of the following implements if (!a) b == 0;?
Antworten
  • b &= !!a;
  • b &= !-a;
  • b &= !a;
  • b &= a;
  • b &= -a;
  • b &= -!a;
  • none of the above
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Thermodynamik I/II
K G
Netzwerktechnik
DFairy
Klinische Psychologie Teil 1
Lisa Mariá Hchil
Reformation - Absolutismus
Isabell Ilmer
PR / WS17 18
publizistik - bakk ..
Österreichische Geschichte ll Mesner (ÖG 2)
Selma Tahirovic
Vetie Chirurgie 2018
Johanna Müller
MS-1.3 Foliensatz 6-7
Markus Voßmann
Vetie Para Morphologie Virtuelles Mikroskop
Kristin E
Vetie Spezielle Pathologie 2020
Fioras Hu
Vetie: Geflügelkrankheiten Der Graupapagei
Björn Sake