lecture3 - CSCI-365 Computer Organization Lecture 3 Note:...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI-365 Computer Organization Lecture Note : Some slides and/or pictures in the following are adapted from: Some slides and/or pictures in the following are adapted from: slides ©2008 UCB 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Anatomy of a Computer Personal Computer Processor Computer Control (“brain”) Datapath Registers Memory Devices Input Output Load (from) Load (from) Store (to) Store (to) These are “data transfer” instructions… Registers are in the datapath of the processor; if operands are in memory, we must transfer them to the processor to operate on them, and then transfer back to memory when done
Background image of page 2
Data Transfer: Memory to Reg To transfer a word of data, we need to specify two things: Register : specify this by # ( $0 - $31 ) or symbolic name ( $s0 ,…, $t0 , …) Memory address : more difficult Think of memory as a single one-dimensional array, so we can address it simply by supplying a pointer to a memory address Other times, we want to be able to offset from this pointer Remember: “ Load FROM memory
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Transfer: Memory to Reg To specify a memory address to copy from, specify two things: A register containing a pointer to memory A numerical offset ( in bytes ) The desired memory address is the sum of these two values Example: 8($t0) specifies the memory address pointed to by the value in $t0 , plus 8 bytes
Background image of page 4
Data Transfer: Memory to Reg Load Instruction Syntax: 1 2,3(4) where 1) operation name 2) register that will receive value 3) numerical offset in bytes 4) register containing pointer to memory MIPS Instruction Name: lw (meaning Load Word, so 32 bits or one word are loaded at a time)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Transfer: Memory to Reg Example: lw $t0,12($s0) This instruction will take the pointer in $s0 , add 12 bytes to it, and then load the value from the memory pointed to by this calculated sum into register $t0 Notes: $s0 is called the base register 12 is called the offset offset is generally used in accessing elements of array or structure: base reg points to beginning of array or structure Data flow
Background image of page 6
Data Transfer: Reg to Memory Also want to store from register into memory
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

lecture3 - CSCI-365 Computer Organization Lecture 3 Note:...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online