

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































Peer instruction What value is stored in $t0 when the program finishes? (numeric response)
Where we are going
Learn what gets stored in here
Storing an instruction as bits
lw $s3, 0($s0) lw $s4, 4($s0) add $s2, $s3, $s sw $s2, 8($s0) addi $s0, $s0, 4 addi $s1, $s1, - 1 bgtz $s1, loop
R-type opcode = 0 for R-type and funct is this
R-type Example: opcode = 0 for R-type and funct is this 3 steps to translate from human code to machine code
R-type Example:
step 2: write as a 32-bit binary number 000000 01000 01001 01101 00000 100000
R-type Example:
step 3: typically write the code as hex, so translate to hexadecimal by turning each 4 bits into a digit 0000 00 01000 0 1001 0110 1 00000 10 0000 0x
Peer instruction Give the 32-bit representation of this instruction a) 0x b) 0x014B c) 0x d) 0x e) 0x
Where we are going Instruction set architecture (e.g., MIPS) Compiler Memory system Processor I/O system Datapath & Control Digital logic translating source code (C or Java) Programs to assembly language And linking your code to Library code How the software talks To the hardware How a processor runs MIPS Programs! How switches (1 or 0) can be used to build Interesting functions: from integer arithmetic to programmable computers
Register names - > numbers
this table in the MIPS reference sheet says, e.g., that register $t8 is represented by 5-bit number 24
More instructions opcode opcode funct