co slideset 5

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

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:21 PM on 10/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

li

puts numbers into registers

2
New cards

what’s system memory

  • where does the cpu run programs?


  • temporary storage hardware

  • it’s smaller, faster, and expensive than the persistent storage

  • where the programs and data resides

  • cpu can only run programs from system memory


3
New cards

what’s a memory?

  • 1d array of bytes

  • bytes have addresses


4
New cards

words

  • comfy integer size for us

  • it’s usually 32 bits which is equal to 4 bytes


5
New cards

accumulator archirectures

  • used on register

  • add more registers that served specific purposes


6
New cards

what’s a word-addressable memory vs. byte addressable memory

  • each address usually points to an entire word

  • byte addressable store a 32-bit word

    • each byte is has it’s own address


7
New cards

why does the address increase by 4?

  • they increase by 4 because we’re taking in 32 bit words and we continue to increase

  • 32 bits = 4 bytes


8
New cards

address vs. value

  • addy tells you where the word is (4, 8, etc)

  • value tells you what’s stored in there (DECE0EBE)


9
New cards

what does the equation 2^nB mean?

  • 2^n is the address representaion

  • B is the number of bytes

  • it’s a memory capacity


10
New cards

now explain how we could store words into an address that only stores one byte?

  • another example, one word= 4 bytes but our memory holds bytes

  • so we just take every 4 addresses and make that our word!

  • if we have a word and it starts at address 4 and goes up to address 8, then the word is in address 4

    • we always take the address where the word starts the beginning which is address 4 and goes up to 8


11
New cards

what’s an accumulator

  • olden days, ppl only added into one register only

  • acc is the place and result was also there


12
New cards

general purpose registers

  • very fast storage location inside cpu

  • used for many things


13
New cards

load

  • you take smth from memory and move it into a register

  • variables tend to be stored in memory u gotta physically take them out


14
New cards

stores

  • copy data from CPU registers into memory


15
New cards

how does memory start, so what do we do?

  • it starts off as an empty slate

  • we exectute in memory address 0×00400000

    • so the cpu knows when to start


16
New cards

what happens after we execute the memory address?

  • we start fetching instructions from memory


17
New cards

t or f does everything in memory has an address?

  • true it does memory stores ALL the information


18
New cards

what does every piece of data have

  • it has two parts

  • an address and a value


19
New cards

how do we access words?

  • we use lw

    • this loads word from MEMORY to CPU REGISTERS

  • we use sq

    • this stores word from CPU REGISTERS to MEMORY


20
New cards

li

  • load immediate means directly put values into the registers


21
New cards

li, sw, lw


  • li — I know the number or addy. Put it in the register.

  • lw — Go to this memory address and bring me what's stored there.

  • sw — Take the value in this register and save it at this memory address.


22
New cards

la vs. li

  • la basically we give it a variable and it finds the address and value

  • li basically we directly assign it to a register it’s never stored in memory


23
New cards

lw

  • This tells the computer:

    1. Look at register to find the address, which is 1000.

    2. Go to memory address 1000.

    3. Read the value stored there, which is 7.

    4. Put that value into $t1.


24
New cards

indirect

memory address is in the value in a register

25
New cards

offset

  • you add a constant to that value


26
New cards

what does byte do?

  • stores 1 byte of data

  • tiny: .byte 4


27
New cards

half

  • stores 2 bytes

  • small: .half 4


28
New cards

word

  • x: .word 4

  • stores 4 bytes


29
New cards

lb

  • load byte

  • memory→ register


30
New cards

lbu

  • load byte unsigned

  • memory→ register


31
New cards

sb

  • stores byte

  • memory→ byte


32
New cards

lh

  • load half-word

  • memory→ register


33
New cards

lhu

  • load half word unsigned

  • memory→ register


34
New cards

sh

  • store half-word

  • register→ mem


35
New cards

sign extension vs. zero extension

so sign extension checks if the msb is 1 or 0 and based on that copies the bit and zero extension j keeps copying the 0's


36
New cards

big endian vs. little endian

  • big

    • it’s when the number is the smallest to biggest

  • little

    • it’s when the number is big to all

we base them off of their place value

comps use little endian

37
New cards

truncating concetp

  • sometimes we truncate extras if we want to store a specific amt of bytes, so we always take the stuff from the right and truncate the left so we

  • we j get rid of extras that dont fit

  • we keep the lowest-order buts and et rid of the upper order buts

  • if we’re keep 8 bits then the lsb value is taken

  • if we’re keeping half words then the two lsbs are taken

  • if we keep a whole word nothing’s rly truncated usually