MIPS ARCHITECTURE MIPS-semiconductor company that built one of the first commercial RISC architectures We will study the mips architecture in some detail in this class Why mips instead of Intel x86? MIPS is simple, elegant. Dont want to get bogged down in gritty details MPS widely used in embedded apps, x86 lttle used in embedded, and more embedded computers than PCs
▪MIPS – semiconductor company that built one of the first commercial RISC architectures ▪ We will study the MIPS architecture in some detail in this class. ▪ Why MIPS instead of Intel x86? ▪ MIPS is simple, elegant. Don’t want to get bogged down in gritty details. ▪ MIPS widely used in embedded apps, x86 little used in embedded, and more embedded computers than PCs 6
MIPS32 (32-BIT INSTRUCTIONS) emory Program Bytes One mips instruction 32 bits Data
7 7 Memory Bytes Program Data One MIPS Instruction = 32 bits
HOW PROGRAM IS EXECUTED? Memory Processor struction Control n bits rogram Datapath Program Counter struction Bytes- Address Registers Arithmetic Logic Unit Data (ALU) The program counter (internal register inside processor) holds address of next instruction to be executed
8 Processor Control Datapath Program Counter Registers Arithmetic & Logic Unit (ALU) Memory Instruction Bytes Address Read Instructio n Bits Program Data The program counter (internal register inside processor) holds address of next instruction to be executed
ASSEMBIY VARIABIES REGISTERS Unlike HlL like C or java, assembly cannot use variables Why not? Keep hardware simple Assembly operands are registers Limited number of special locations built directly into the hardware Operations can only be performed on these registers. Benefit: Since registers are directly in hardware, they are very fast (faster than I ns-light travels 30cm in l ns!!!)
▪ Unlike HLL like C or Java, assembly cannot use variables ▪ Why not? Keep hardware simple ▪ Assembly operands are registers. ▪ Limited number of special locations built directly into the hardware ▪ Operations can only be performed on these registers! ▪Benefit: Since registers are directly in hardware, they are very fast (faster than 1 ns - light travels 30cm in 1 ns!!! ) 9
NUMBER OF MIPS REGISTERS Drawback: Since registers are in hardware there are a predetermined number of them Solution: MiPS code must be very carefully put together to eficiently use registers 32 registers in MPs Why 32? Smaller is faster, but too small is bad. Goldilocks problem Each MPS register is 32 bits wide Groups of 32 bits called a word in MPS
▪Drawback: Since registers are in hardware, there are a predetermined number of them. ▪ Solution: MIPS code must be very carefully put together to efficiently use registers. ▪32 registers in MIPS ▪ Why 32? Smaller is faster, but too small is bad. Goldilocks problem. ▪Each MIPS register is 32 bits wide ▪ Groups of 32 bits called a word in MIPS 10