CSCE-312

Course Overview

Course Theme

Abstraction Is Good But Don’t Forget Reality

Great Reality 1

Ints are not Integers, Floats are not Reals

Computer Arithmetic

Great Reality 2

You’ve Got to Know Assembly

Great Reality 3: Memory Matters

Random Access Memory Is an Unphysical Abstraction

Memory Referencing Bug Example

typedef struct {
	int a[2];
	double d;
}   struct_t;

double fun(int i) {
	volatile struct_t s;
	s.d = 3.14;
	s.a[i] = 1073741824; /* Possibly out of bounds */
	return s.d;
}

fun(0) ➙ 3.14
fun(1) ➙ 3.14
fun(2) ➙ 3.1399998664856
fun(3) ➙ 2.00000061035156
fun(4) ➙ 3.14
fun(6) ➙ Segmentation fault

Explanation:
Pasted image 20250826131752.png350

Memory Referencing Errors

Great Reality 4

There’s more to performance than asymptotic complexity

Memory System Performance Example

Pasted image 20250826132411.png525

Why The Performance Differs

Pasted image 20250826132526.png400

Great Reality 5

Computers do more than execute programs

Course Perspective

Course Perspective (Cont.)

Textbook

Course Components

Getting Help

Rules of the Lecture Hall


LAB 1

What is a register?

li t0, 5
addi t0, t0, 10
mv tq, to
mov