UCLA COMSCI M151B - Lecture4 (7 pages)

Previewing pages 1, 2 of 7 page document View the full content.
View Full Document

Lecture4



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Lecture4

86 views


Pages:
7
School:
University of California, Los Angeles
Course:
Comsci M151b - Computer Systems Architecture
Computer Systems Architecture Documents

Unformatted text preview:

Week 3 Monday 2 3 Representing Instructions Instructions are encoded in binary They are called machine code MIPS instructions Encoded as 32 bit instruction words Small number of formats encoding operation code opcode register numbers Regularity Register numbers t0 t7 are registers 8 15 t8 t9 are registers 24 25 s0 s7 are registers 16 23 MIPS R format Instructions Useful for a variety of reasons 32 bit value format op 6 rs 5 rt 6 rd shamt shamt 5 funct 6 Instruction fields op operation code opcode Number that indicates that it s an R format instruction More interesting role for other format instructions For R format it s all the same Defines what instructions to use rs first source register number Register source rt second source register number Second register source rd destination register number rs rt and rd are 5 bits because there are 32 registers and we need to specify properly which register we are referring to shamt shift amount 00000 for now Indication of how much to shift Most of R format we re not going to use it Also for the rest of the class funct function code extends opcode Indicate what type of operation should be performed by the R format instruction Add Subtract AND or whatever R format Example add t0 s1 s2 Destination is first special s1 s2 t0 0 add 0 17 18 8 0 32 s1 is register 17 s2 is register 18 t0 is register 8 000000 10001 10010 01000 00000 100000 00000010001100100100000000100000 2 0x02324020 MIPS I format Instructions 32 bit value format op 6 rs 5 rt 5 constant address 16 Instruction fields rs destination register number rt destination or source register number constant 2 15 to 2 15 1 address offset added to base address in rs Embedded literal constant Design Principle 4 Good design demands good compromises Different formats complicate decoding but allow 32 bit instructions uniformly Keep formats as similar as possible Stored Program Computers Instructions represented in binary just like data Instructions and data stored in memory Memory is



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Lecture4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture4 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?