Functions in MIPS
1
Todays lecture: Implementing Functions!
The programs flow of control must be changed.
The Jump and Link (jal) instruction (NEW!)
Using Jump Register (jr)
Arguments and return values are passed back & forth.
Register Conventions
Allo

Boolean Algebra and Its Rela1on to Gates
An Introduc+on to CS233
1
233 in one slide!
The class consists roughly of 4 quarters:
1.
2.
3.
4.
You will build a simple computer processor
You will learn how high-level language code exec

Number Systems (in Binary)
1
Todays lecture
Represen:ng things with bits
N bits gets you 2N representa0ons
Unsigned binary number representa:on
Conver0ng between binary and decimal
Hexadecimal nota0on
Binary Addi:on & Bitwise Logica

/ Netflix has been engaged by movie studios to advertise new movies.
/ Netflix will show visitors one of 4 ads based on the kind of movie
/ they last watched.
/
/
/
/
/
/
/
The following characteristics of the last watched movie are
considered:
- Whether

module test;
/ these are inputs to "circuit under test"
reg
A;
reg
F;
reg [1:0] T;
/ wires for the outputs of "circuit under test"
wire [1:0] M;
/ the circuit under test
movies m(M, A, F, T);
initial begin
/ initial = run at beginning of simulation
/ begi

.text
# struct Puzzle cfw_
#
int size;
#
Cell *grid;
# ;
#
# / Given the assignment at current position, removes all inconsistent values
# / for cells in the same row, column, and cage.
# int
# forward_checking(int position, Puzzle *puzzle) cfw_
#
int siz

STAT 200 Homework 2
1.a)
b)
C)I prefer bar chart since it can both compare between different groups and the
changes over time.
2.a)print(reflectances)
[1] 57.6 54.8 63.4 57.0 54.7 42.3 63.6 55.5 33.5 63.3
[11] 58.3 42.1 56.1 47.8 56.1 55.9 38.8 49.7 42.3

Exam 1: Combinational Design (examples will be up on PrairieLearn)
12 short answer questions from PrairieLearn Homeworks
1 Verilog combinational design problem
Exam 2: Sequential Design
1 finite state machine (FSM) design problem
Exam 3: Processor Datapat

Wri$ng Cache Friendly Code
!
Make the common case go fast
! Focus on the inner loops of the core func0ons
!
Minimize the misses in the inner loops
! Repeated references to variables are good (temporal locality)
! Stride-1 reference

MIPS%Load%&%Stores%
1
Todays%lecture%
!
MIPS%Load%&%Stores%
! Data$Memory$
! Load$and$Store$Instruc3ons$
! Encoding$
! How$are$they$implemented?$
2
We need more space!
!
Registers are fast and convenient, but we have only 32 of
them, and each one is just

MIPS control ow instruc1ons:
Jumps, Branches, and Loops
1
Todays lecture
!
!
!
Control Flow
! Programma(cally upda(ng the program counter (PC)
Jumps
! Uncondi(onal control ow
! How is it implemented?
Branches
! Loops
! If/then/els

All#Together:#
Instruc1on#Memory#+#Arithme1c#Machine#
!
1
What do you get if you connect a register to an adder?
out
[3:0]
A[3:0]
Adder
0
0
0
1
B[3:0]
D3
D2
D1
D0
Q3
Q2
Q1
Q0
reset
enable
2
out
[3:0]
D3
D2
D1
D0
A[3:0]
Adder
0
0
0
1
B[3:0]
D[3:0]
Q[3:0]
Q

Combina(onal Logic Design
1
Todays lecture
Combina(onal Logic
Dierent Representa-ons of Boolean Func-ons (review)
How to design any circuit
Write a truth table
Sum-of-Products implementa-on
Example
Other gates you should know