


## Decode close-up

## R-Format Instructions
- Read two register operands, perform ALU operation, write result to target register

## Inputs to the Register File


[Logisim Register File and ALU](https://ericmanley.github.io/Fall2024/CS130/assets/RegisterFileAndALU.circ)
## Connecting it to the ALU


## Walking an instruction through the datapath
```mips
add $10, $8, $9
```

000000 01000 01001 01010 00000 100000

## Exercise
How can we handle I-type instructions like
```mips
addi $8, $0, 5
```

001000 00000 01000 0000000000000101

## Load/Store Instructions
- Read register operands, calculate address, read/write to memory

## Branch Instructions
- Read register operands, compare operands, calculate target address

## The Full Datapath