CSE220 Combined

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/117

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:18 PM on 12/11/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

118 Terms

1
New cards

Virtual addresses and physical addresses might be different addressses, but are in the same address space.

False

2
New cards

A processor may have as few as one atomic instruction.

True

3
New cards

Which stages of the toolchain know about the C programming language?

Compiler

4
New cards

The key concept in the effectiveness of caching is _________.

Locality

5
New cards

What are the three types of cache miss?

1) Conflict

2) Cold

3) Capacity

6
New cards

Calling functions can prevent certain optimizations.

True

7
New cards

A single process can contain multiple threads.

True

8
New cards

The wait operation on a condition variable should always be called in a loop that checks the condition.

True

9
New cards

Which stage of the toolchain allows you to eliminate code entirely based on conditions?

Preprocessor

10
New cards

The ______ function creates a POSIX thread. (Name only)

pthread_create

11
New cards

Course evaluations are open, and I should provide honest feedback on my course evaluation to help improve CSE 220 and provide the information needed to secure necessary resources and make curricular changes to improve the value of my UB degree.

True

12
New cards

Exceptions provide a safe way to change protection domains in an operating system.

True

13
New cards

One of the ways that paging is efficient is that it prevents ________ fragmentation entirely in the memory mapping.

External

14
New cards

The kernel does not operate under the same dedicated machine model as our processes because it runs in _____________. (Two words)

Supervisor mode

15
New cards

Layers in the cache hierarchy that are closer to the CPU are ____________ than layers that are farther from the CPU.

Smaller and faster

16
New cards

Linear address spaces are convenient because:

1) Each location in the address space has a unique address.

2) Each address represents a unique location in the address space.

17
New cards

In the following code, in which section is the variable x located?

int x = 42;

int main(int argc, char *argv[]) {

printf("%d\n", x);

return 0;

}

Data section

18
New cards

What is a logical control flow?

The instructions run by a processor while running a program

19
New cards

The Memory Management Unit (MMU) is _______ that _______.

A) Hardware

B) Translates addresses

20
New cards

Memory used by the allocator that is not used directly to serve user allocation is called _____________.

overhead

21
New cards

A system can use either multithreading or multiprocessing, but not both.

False

22
New cards

Mutexes and mutual exclusion map almost directly to the race condition-related concept of the _________________

Critical sections

23
New cards

The addresses near 0 in the system are ______ so that NULL is an invalid address.

unmapped

24
New cards

Optimizing sequential computations may involve both code motion and reduction in strength.

True

25
New cards

Every address on a single virtual page must map to the same physical page.

True

26
New cards

Paper was once used as nonvolatile storage for computers.

True

27
New cards

The C preprocessor knows about the platform it is compiling for.

False

28
New cards

Processes cannot detect segmentation faults and react to them, instead of crashing and leaving a core dump.

False

29
New cards

How many conditions must be met in order to have a race?

3

30
New cards

A data race can be present in as little as a single line of code.

True

31
New cards

Which sections have a size that can be determined only when the program runs?

1) Heap

2) Stack

32
New cards

When using semaphores, the states 0 and 1 are always equivalent to a locked and unlocked mutex, respectively.

False

33
New cards

Suppose that a compiler turns this code:

int sum = 0;

for (int i = 0; i < MAXI; i++) {

for (int j = 0; j < MAXJ; j++) {

sum += 4 * i + j;

}

}

Into this code:

int sum = 0;

for (int i = 0; i < MAXI; i++) {

const int fouri = 4 * i;

for (int j = 0; j < MAXJ; j++) {

sum += fouri + j;

}

}

What type of optimization is this?

Code Motion

34
New cards

System calls are typically invoked as:

A normal function call that uses a special processor instruction

35
New cards

Which of the following is a well-defined term?

1) CPU Core

2) Logical control flow

36
New cards

The C compiler is limited to optimizations that can be deduced from the source code of the program.

True

37
New cards

The operating system provides an allocation interface to manage small allocations.

True

38
New cards

The size of a memory allocation created by malloc() is visible to the user.

False

39
New cards

What is the primary difference between threads and processes from a software design standpoint?

Threads share a common memory mapping.

40
New cards

The MMU on an x86-64 processor uses _____ to translate virtual addresses to physical addresses. (One word)

paging

41
New cards

Wasted memory in the allocator often comes from:

1) Metadata

2) Fragmentation

42
New cards

Which property is the most important for an optimizing compiler?

Correct program behavior

43
New cards

If a program has a large working set, but accesses it sequentially, it will still exhibit good locality.

True

44
New cards

The name of the "fastmutex" variable in the slides is copied from __________.

man pthread_mutex_init

45
New cards

What mechanism allows function arguments to be call-by-value?

Stack allocated arguments

46
New cards

Every process on a Unix system appears to run on a dedicated computer from its own point of view.

True

47
New cards

When using a condition variable, only the waiting thread must call pthread_mutex_lock and pthread_mutex_unlock. The signaling thread does not need to use a mutex.

False

48
New cards

Given the following declarations, which of these statements are valid?

- struct p { int x; int y };

- int a1[5] = { 1, 2, 3, 4, 5 };

- int a2[5];

- struct p p1 = { 42, 73 };

- struct p p2

p2 = p1;

49
New cards

For this course, you must learn the following regarding assembly language: (mark all that apply)

1) the basic kinds of things that machine instructions can do

2) how to understand assembly programs while I am explaining it

50
New cards

In the following code, the final expression is always true:

bool b = 2;

b == 1;

True

51
New cards

When is it best to fix a system bug?

During system design

52
New cards

When compiling a conditional, the compiler will preserve: (mark all that apply)

- The names of your variables

- The semantics of your program (that is, its meaning)

- The structure of your program

The semantics of your program (that is, its meaning)

53
New cards

In which incidents did people die partly due to computer programmers copying code that they did not fully understand, but thought they did?

- Therac-25

- Mars Pathfinder scheduling

- Toyota unintended acceleration

1) Toyota unintended acceleration

2) Therac-25

54
New cards

You should always use curly braces for if/else/while/etc. in this course.

True

55
New cards

What is the decimal value of the following 8-bit binary number:

0101 1110

94

56
New cards

Computer systems perfectly implement the numeric and boolean systems we want to use.

False

57
New cards

Which of the following 16-bit integers in binary form is a little endian representation of the decimal number 258?

- 10000000 01000000

- 00000010 00000001

- 00000001 00000010

- 01000000 100000000

00000010 00000001

58
New cards

Which of the following would be the IEEE 754 single-precision representation of the binary number 11.01011?

- 1 10101100 00000000000000000000000

- 0 10000000 10101100000000000000000

- 0 00000000 11010110000000000000000

- 0 00000001 10101100000000000000000

0 10000000 10101100000000000000000

0 - Sign bit

10000000 = 1 (expononent) + 127 (bias) = 128

10101100000000000000000 = 11.01011

59
New cards

What file must be included in order to define the type bool and the true and false values?

stdbool.h

60
New cards

Which of the following hexadecimal digits are even?

- 3

- 4

- C

- D

1) 4

2) C

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

61
New cards

Where might you see one's complement math in 2020?

Network packets

62
New cards

If IEEE 754 floating point represents numbers of the following form:

x * 2^y

How many times larger is the largest possible exponent in double-precision floating point versus single-precision floating point? (Note that this question requires understanding the properties of both floating point and integer binary representations!)

8

63
New cards

How wide is the memory bus on our x86-64 system?

64 bits

64
New cards

Order of operations in a program can change program performance by an order of magnitude or more, due to the way memory is accessed.

True

65
New cards

Which of the following bit patterns (represented in hexadecimal) would be negative if they were 32-bit signed integers?

- 0x7B90FF62

- 0x83B96F60

- 0x32109876

- 0xFFFFFFFF

1) 0x83B96F60

2) 0xFFFFFFFF

Leading Value:

0 - 7 = Position

8- F = Negative

66
New cards

Why are structures and array elements padded?

To preserve alignment of the individual members

67
New cards

A pointer is an integer value that contains the address of some data and associates it with a type.

True

68
New cards

Given the following code:

int x = 13;

int *px = &x;

What type is the result of the expression *px?

int

69
New cards

A pointer can be dereferenced with square brackets in the same manner as an array, and with the same result.

True

70
New cards

Pointers and arrays are always interchangeable.

False

71
New cards

Serialization allows us to store data in memory or on disk, or communicate it over a network, without having to follow all of the alignment and representation rules of the platform on which our code is executing.

True

72
New cards

What representation does IEEE 754 floating point use to store negative floating point values?

Sign-magnitude

73
New cards

What is the C compiler driver

The C compiler driver can take a .c source file and produce an executable directly.

74
New cards

What are the 4 parts of the C compiler and toolchain?

Preprocessor, compiler, assembler, linker

75
New cards

What is the preprocessor

- The preprocessor performs certain source code transformations before the C is processed by the compiler.

- It DOESN'T understand C

76
New cards

What is the C compiler?

- The compiler transforms C into machine-dependent assembly code

- It produces and object file via the assembler

- Only part of the tool chain that understands C. Understands the semantics of C and the capabilities of the machine.

77
New cards

What is the assembler?

- The assembler transforms assembly language into machine code.

- Machine code is binary instructions understood by the processor.

- The output of the assembler is object files

78
New cards

What is the linker?

- The linker turns one or more object files into an executable.

79
New cards

What is code folding?

Computation of constants at compile time

- int i = 2 + 3

('i' will never be anything else besides 5)

80
New cards

What is code motion?

The movement of code to minimize redundant operations or calculations.

81
New cards

What is reduction in strength?

Replacement of expensive operations with cheaper operations.

E.x: Multiply and divide are expensive operations, but shift operations are cheap.

82
New cards

What can block optimizations?

1) Data-dependent operations

2) Procedure calls (without inter-procedural optimization)

2) Pointer aliases (more than one pointer to an object)

83
New cards

What is 11.101b in decimal?

3.625

= (1 x 2^1) + (1 x 2^0) + (1 x 2^-1) + (0 x 2^-2) + (1 x 2^-3)

= 2 + 1 + 0.5 + 0 + 0.125

= 3.625

84
New cards

For SINGLE precision floating point numbers:

How many sign bits are there?

How many exponent bits are there?

How many significand bits are there?

Sign - 1

Exponent - 8

Significand - 23

85
New cards

For DOUBLE precision floating point numbers:

How many sign bits are there?

How many exponent bits are there?

How many significand bits are there?

Sign - 1

Exponent - 11

Significand - 52

86
New cards

What does the Text section of memory hold?

The text section is:

The executable code.

87
New cards

What do the Data and BSS sections for memory hold?

The data and BSS (block started by symbol) sections are:

- Global and static local variables

- Variables in the data section have initialized values in the source code.

- Variables in the BSS do not.

88
New cards

What is the width of a register on x86-64?

64 bits

89
New cards

An un-aligned memory access may crash your program.

True

90
New cards

What type of race involves two concurrent flows of control accessing the same state with insufficient synchronization?

data race

91
New cards

Given a pointer to an area of memory allocated with malloc, it is possible for the programmer to tell how large it is.

False

92
New cards

Which of these is very similar to a mutex?

a. condition variable

b. atomic operation

c. binary semaphore

d. counting semaphore

binary semaphore

93
New cards

The data section is cleared to all zero bits when your program starts.

False

94
New cards

Which of these makes sequential array accesses much faster than "jumping around"?

a. caching

b. virtual memory

c. alignment

d. synchronization

Caching

95
New cards

An exception involves non-local control flow.

True

96
New cards

Printing output to the terminal MUST use a system call.

True

97
New cards

Which stage of the compiler toolchain understands the C language?

a. preprocessor

b. compiler

c. assembler

d. linker

Compiler

98
New cards

Changing only the sign bit on a two's complement integer also changes both the sign and the magnitude of its value.

True

99
New cards

Which storage technology is slowest?

a. registers

b. sram

c. dram

DRAM

100
New cards

Three conditions are required to have a race. How many must be broken to eliminate the race?

1

Explore top flashcards

flashcards
Week 1
20
Updated 716d ago
0.0(0)
flashcards
Introduction to Biology
33
Updated 446d ago
0.0(0)
flashcards
Classical Roots Lessons 7-8
42
Updated 1146d ago
0.0(0)
flashcards
Civil Rights and Liberties
38
Updated 1075d ago
0.0(0)
flashcards
units 1-7 vocab
361
Updated 1081d ago
0.0(0)
flashcards
Survey of Humanities- Boroque
40
Updated 925d ago
0.0(0)
flashcards
Week 1
20
Updated 716d ago
0.0(0)
flashcards
Introduction to Biology
33
Updated 446d ago
0.0(0)
flashcards
Classical Roots Lessons 7-8
42
Updated 1146d ago
0.0(0)
flashcards
Civil Rights and Liberties
38
Updated 1075d ago
0.0(0)
flashcards
units 1-7 vocab
361
Updated 1081d ago
0.0(0)
flashcards
Survey of Humanities- Boroque
40
Updated 925d ago
0.0(0)