![mips rformat vs iformat opcode mips rformat vs iformat opcode](https://media.cheggcdn.com/media%2F8b9%2F8b9ea98b-f0c6-483e-8814-0d2f360b0a64%2FphpP0uVRQ.png)
Final field: – shamt: This field contains the amount a shift instruction will shift by.– rs (Source Register): generally used to specify register containing first operand – rt (Target Register): generally used to specify register containing second operand (note that name is misleading) – rd (Destination Register): generally used to specify register which will receive result of computation – Question: Why aren’t opcode and funct a single 12bit field? – funct: combined with opcode, this number exactly specifies the instruction Note: This number is equal to 0 for all R-Format instructions.What do these field integer values tell us? – opcode: partially specifies what instruction it is.Important: On these slides and in book, each field is viewed as a 5- or 6-bit unsigned integer, not as part of a 32-bit integer – Consequence: 5-bit fields can represent any number 0-31, while 6-bit fields can represent any number 0-63.Define “fields” of the following number of bits each: 6 + 5 + 5 + 5 + 5 + 6 = 32.It will soon become clear why the instructions have been partitioned in this way.R-format: used for all other instructions.I-format: used for instructions with immediates, lw and sw (since the offset counts as an immediate), and the branches (beq and bne) – (but not the shift instructions later).We could define different fields for each instruction, but MIPS is based on simplicity, so define 3 basic types of instruction formats: – R-format – I-format – J-format.Each field tells processor something about instruction.One word is 32 bits, so divide instruction word into “fields”.
![mips rformat vs iformat opcode mips rformat vs iformat opcode](https://slidetodoc.com/presentation_image/2bbc83a3dd6761404295a8af89a89b42/image-75.jpg)
#MIPS RFORMAT VS IFORMAT OPCODE PC#
Selection of Intel 8086 in 1981 for 1st IBM PC is major reason latest PCs still use 80x86 instruction set (Pentium 4) could still run program from 1981 PC today.Leads to “backward compatible” instruction set evolving over time.New machines want to run old programs (“binaries”) as well as programs compiled to new instructions.Programs are distributed in binary form – Programs bound to specific instruction set – Different version for Macintoshes and PCs.One register keeps address of instruction beingĮxecuted: “Program Counter” (PC) – Basically a pointer to memory: Intel calls it Instruction Address Pointer, a better name.Instructions, data words – both branches and jumps use these
![mips rformat vs iformat opcode mips rformat vs iformat opcode](https://www.cs.fsu.edu/~hawkes/cda3101lects/chap3/F3.37.gif)
Since all instructions and data are stored in memory, everything has a memory address:.– Memory technology for data also used for programs – Programs can be written to manipulate other programs (or self?) Computers built on 2 key principles: 1) Instructions are represented as bit patterns - can think of these as numbers 2) Therefore, entire programs can be stored in memory to be read or written just like data.When loading a byte into a register, it goes in the low end Byte Word Doublew ordĪ doubleword sits in consecutive registers or memory locations according to the big-endian order (most significant word comes first) $zero $at Reserved for assembler use $v0 Procedure results $v1 $a0 Procedure $a1 Saved arguments $a2 $a3 $t0 $t1 $t2 Temporary $t3 values $t4 $t5 $t6 $t7 $s0 $s1 Saved $s2 across $s3 Operands procedure $s4 calls $s5 $s6 $s7 More $t8 temporaries $t9 $k0 Reserved for OS (kernel) $k1 $gp Global pointer $sp Stack pointer Saved $fp Frame pointer $ra Return addressĪ 4-b yte word sits in consecutive memory addresses according to the big-endian order (most significant byte has the lowest address) Byte numbering: Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson & Hennessy, ©2005 Some slides and/or pictures in the following are adapted from: slides ©2008 UCBĬSCI-365 Levels of Representation High Level Language Program (e.g., C) Compiler Assembly Language Program (e.g.,MIPS) Assembler Machine Language Program (MIPS) Machine Interpretation Hardware Architecture Description (e.g., block diagrams) Architecture Implementation Logic Circuit Description (Circuit Schematic Diagrams)