SlideShare a Scribd company logo
2
Most read
13
Most read
Chapter 2
Instructions: Language
of the Computer
Summary of the previous
 Computer Architecture =
 Instruction set architecture +
 Computer organization
 Why we study computer architecture
 To increase computer performance
 Response Time (Execution Time)
 Bandwidth (Throughput)
Chapter 2 — Instructions: Language of the Computer — 2
Chapter 2 — Instructions: Language of the Computer — 3
Instruction Set
 The group of instructions of a computer
 Different computers have different
instruction sets
 But with many aspects in common
 Early computers had very simple
instruction sets
 Simplified implementation
 Many modern computers also have simple
instruction sets
§2.1Introduction
Chapter 2 — Instructions: Language of the Computer — 4
The MIPS Instruction Set
 Used as the example throughout the book
 Stanford MIPS commercialized by MIPS
Technologies (www.mips.com)
 Large share of embedded core market
 Applications in consumer electronics, network/storage
equipment, cameras, printers, …
 Typical of many modern ISAs
 See MIPS Reference Data tear-out card, and
Appendixes B and E
Chapter 2 — Instructions: Language of the Computer — 5
Arithmetic Operations
 Add and subtract, three operands
 Two sources and one destination
add a, b, c # a gets b + c
 All arithmetic operations have this form
 Design Principle 1: Simplicity favours
regularity
 Regularity makes implementation simpler
 Simplicity enables higher performance at
lower cost
§2.2OperationsoftheComputerHardware
Chapter 2 — Instructions: Language of the Computer — 6
Arithmetic Example
 C code:
f = (g + h) - (i + j);
 Compiled MIPS code:
add t0, g, h # temp t0 = g + h
add t1, i, j # temp t1 = i + j
sub f, t0, t1 # f = t0 - t1
Chapter 2 — Instructions: Language of the Computer — 7
Representing Instructions
 Instructions are encoded in binary
 Called machine code
 MIPS instructions
 Encoded as 32-bit instruction words
 Register numbers
 $t0 – $t7 are reg’s 8 – 15
 $s0 – $s7 are reg’s 16 – 23
 $t8 – $t9 are reg’s 24 – 25
§2.5RepresentingInstructionsintheComputer
Chapter 2 — Instructions: Language of the Computer — 8
MIPS R-format Instructions
 Instruction fields
 op: operation code (opcode)
 rs: first source register number
 rt: second source register number
 rd: destination register number
 shamt: shift amount (00000 for now)
 funct: function code (extends opcode)
op rs rt rd shamt funct
6 bits 6 bits5 bits 5 bits 5 bits 5 bits
Chapter 2 — Instructions: Language of the Computer — 9
R-format Example
add $t0, $s1, $s2
special $s1 $s2 $t0 0 add
0 17 18 8 0 32
000000 10001 10010 01000 00000 100000
000000100011001001000000001000002 = 0232402016
op rs rt rd shamt funct
6 bits 6 bits5 bits 5 bits 5 bits 5 bits
Chapter 2 — Instructions: Language of the Computer — 10
MIPS I-format Instructions
 Immediate arithmetic and load/store instructions
 rt: destination or source register number
 Constant: –215 to +215 – 1
 Address: offset added to base address in rs
 E.g lw $t1, 50($t2)
op rs rt constant or address
6 bits 5 bits 5 bits 16 bits
Chapter 2 — Instructions: Language of the Computer — 11
MIPS j-format Instructions
 Opcode = 6 bits
 Address = 26 bits
 E.g. J 1000
Chapter 2 — Instructions: Language of the Computer — 12
Chapter 2 — Instructions: Language of the Computer — 13

More Related Content

PPTX
MIPS Architecture
PPTX
MIPS Assembly Language I
PPT
Chapter 2 instructions language of the computer
PPT
Chapter 1 computer abstractions and technology
PPTX
Assembly language
PPT
Chapter 4 The Processor
PPTX
MIPS Instruction Set
MIPS Architecture
MIPS Assembly Language I
Chapter 2 instructions language of the computer
Chapter 1 computer abstractions and technology
Assembly language
Chapter 4 The Processor
MIPS Instruction Set

What's hot (20)

PDF
Mips opcodes
PPT
Core 2 processors
PDF
Gestión de entrada salida
PDF
Session 8,9 PCI Express
PPTX
Arithmetic instructions
DOCX
PPTX
Register & flags
PDF
Implementation of FIFO in Linux
PPTX
Computer registers
PPT
Chapter 6: Expansion Buses
PPTX
06 mips-isa
PDF
Pcie basic
PPTX
Core 2 Duo Processor
PPT
Chapter 01 - Introduction
PPT
Chapter 3
PPTX
Chapter 02 instructions language of the computer
PPT
Chapter 4
PDF
Manchester & Differential Manchester encoding scheme
PPTX
Instruction Set Architecture
PPTX
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Mips opcodes
Core 2 processors
Gestión de entrada salida
Session 8,9 PCI Express
Arithmetic instructions
Register & flags
Implementation of FIFO in Linux
Computer registers
Chapter 6: Expansion Buses
06 mips-isa
Pcie basic
Core 2 Duo Processor
Chapter 01 - Introduction
Chapter 3
Chapter 02 instructions language of the computer
Chapter 4
Manchester & Differential Manchester encoding scheme
Instruction Set Architecture
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Ad

Similar to Mips architecture (20)

PPT
RISC-V processor- computer organization and design
PPT
Chapter 2 Part1
PPT
Chapter 2
DOCX
Chapter 1SyllabusCatalog Description Computer structu
DOCX
Hennch2nts 160526114335-160526184116-160527121537
PDF
Instructions: Language of the Computer pdf document is very useful
PPT
Digital principles and computer organisation -Instruction set architecture.ppt
PPT
Assembly.ppt
PPT
Computer Architecture Patterson chapter 3.ppt
PPTX
CSe_Cumilla Bangladesh_Country CSE CSE213_5.ppt
PPT
insyruction set architecture-digital principles and computer organization
PDF
C programming part2
PDF
C programming part2
PDF
C programming part2
PPT
hvuygyugihLec02-Review Instruction Set.ppt
PPTX
ISA.pptx
PPTX
Assembly chapter One.pptx
PPTX
Introduction to computer architecture .pptx
PPTX
Unit 1 computer architecture_gghhhjjhbh.pptx
PPT
CODch3Slides.ppt
RISC-V processor- computer organization and design
Chapter 2 Part1
Chapter 2
Chapter 1SyllabusCatalog Description Computer structu
Hennch2nts 160526114335-160526184116-160527121537
Instructions: Language of the Computer pdf document is very useful
Digital principles and computer organisation -Instruction set architecture.ppt
Assembly.ppt
Computer Architecture Patterson chapter 3.ppt
CSe_Cumilla Bangladesh_Country CSE CSE213_5.ppt
insyruction set architecture-digital principles and computer organization
C programming part2
C programming part2
C programming part2
hvuygyugihLec02-Review Instruction Set.ppt
ISA.pptx
Assembly chapter One.pptx
Introduction to computer architecture .pptx
Unit 1 computer architecture_gghhhjjhbh.pptx
CODch3Slides.ppt
Ad

Recently uploaded (20)

PPTX
udi-benefits-ggggggggfor-healthcare.pptx
PPTX
Embeded System for Artificial intelligence 2.pptx
PDF
YKS Chrome Plated Brass Safety Valve Product Catalogue
PDF
Smarter Security: How Door Access Control Works with Alarms & CCTV
PPTX
Embedded for Artificial Intelligence 1.pptx
PDF
Cableado de Controladores Logicos Programables
PDF
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
PPTX
executive branch_no record.pptxsvvsgsggs
PDF
Dynamic Checkweighers and Automatic Weighing Machine Solutions
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
ATL_Arduino_Complete_Presentation_AI_Visuals.pptx
PPTX
Presentacion compuuuuuuuuuuuuuuuuuuuuuuu
PPTX
making presentation that do no stick.pptx
PPTX
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
PPTX
Fundamentals of Computer.pptx Computer BSC
PDF
Prescription1 which to be used for periodo
PPTX
KVL KCL ppt electrical electronics eee tiet
PPTX
quadraticequations-111211090004-phpapp02.pptx
PPTX
Lecture-3-Computer-programming for BS InfoTech
PPTX
material for studying about lift elevators escalation
udi-benefits-ggggggggfor-healthcare.pptx
Embeded System for Artificial intelligence 2.pptx
YKS Chrome Plated Brass Safety Valve Product Catalogue
Smarter Security: How Door Access Control Works with Alarms & CCTV
Embedded for Artificial Intelligence 1.pptx
Cableado de Controladores Logicos Programables
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
executive branch_no record.pptxsvvsgsggs
Dynamic Checkweighers and Automatic Weighing Machine Solutions
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
ATL_Arduino_Complete_Presentation_AI_Visuals.pptx
Presentacion compuuuuuuuuuuuuuuuuuuuuuuu
making presentation that do no stick.pptx
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
Fundamentals of Computer.pptx Computer BSC
Prescription1 which to be used for periodo
KVL KCL ppt electrical electronics eee tiet
quadraticequations-111211090004-phpapp02.pptx
Lecture-3-Computer-programming for BS InfoTech
material for studying about lift elevators escalation

Mips architecture

  • 2. Summary of the previous  Computer Architecture =  Instruction set architecture +  Computer organization  Why we study computer architecture  To increase computer performance  Response Time (Execution Time)  Bandwidth (Throughput) Chapter 2 — Instructions: Language of the Computer — 2
  • 3. Chapter 2 — Instructions: Language of the Computer — 3 Instruction Set  The group of instructions of a computer  Different computers have different instruction sets  But with many aspects in common  Early computers had very simple instruction sets  Simplified implementation  Many modern computers also have simple instruction sets §2.1Introduction
  • 4. Chapter 2 — Instructions: Language of the Computer — 4 The MIPS Instruction Set  Used as the example throughout the book  Stanford MIPS commercialized by MIPS Technologies (www.mips.com)  Large share of embedded core market  Applications in consumer electronics, network/storage equipment, cameras, printers, …  Typical of many modern ISAs  See MIPS Reference Data tear-out card, and Appendixes B and E
  • 5. Chapter 2 — Instructions: Language of the Computer — 5 Arithmetic Operations  Add and subtract, three operands  Two sources and one destination add a, b, c # a gets b + c  All arithmetic operations have this form  Design Principle 1: Simplicity favours regularity  Regularity makes implementation simpler  Simplicity enables higher performance at lower cost §2.2OperationsoftheComputerHardware
  • 6. Chapter 2 — Instructions: Language of the Computer — 6 Arithmetic Example  C code: f = (g + h) - (i + j);  Compiled MIPS code: add t0, g, h # temp t0 = g + h add t1, i, j # temp t1 = i + j sub f, t0, t1 # f = t0 - t1
  • 7. Chapter 2 — Instructions: Language of the Computer — 7 Representing Instructions  Instructions are encoded in binary  Called machine code  MIPS instructions  Encoded as 32-bit instruction words  Register numbers  $t0 – $t7 are reg’s 8 – 15  $s0 – $s7 are reg’s 16 – 23  $t8 – $t9 are reg’s 24 – 25 §2.5RepresentingInstructionsintheComputer
  • 8. Chapter 2 — Instructions: Language of the Computer — 8 MIPS R-format Instructions  Instruction fields  op: operation code (opcode)  rs: first source register number  rt: second source register number  rd: destination register number  shamt: shift amount (00000 for now)  funct: function code (extends opcode) op rs rt rd shamt funct 6 bits 6 bits5 bits 5 bits 5 bits 5 bits
  • 9. Chapter 2 — Instructions: Language of the Computer — 9 R-format Example add $t0, $s1, $s2 special $s1 $s2 $t0 0 add 0 17 18 8 0 32 000000 10001 10010 01000 00000 100000 000000100011001001000000001000002 = 0232402016 op rs rt rd shamt funct 6 bits 6 bits5 bits 5 bits 5 bits 5 bits
  • 10. Chapter 2 — Instructions: Language of the Computer — 10 MIPS I-format Instructions  Immediate arithmetic and load/store instructions  rt: destination or source register number  Constant: –215 to +215 – 1  Address: offset added to base address in rs  E.g lw $t1, 50($t2) op rs rt constant or address 6 bits 5 bits 5 bits 16 bits
  • 11. Chapter 2 — Instructions: Language of the Computer — 11 MIPS j-format Instructions  Opcode = 6 bits  Address = 26 bits  E.g. J 1000
  • 12. Chapter 2 — Instructions: Language of the Computer — 12
  • 13. Chapter 2 — Instructions: Language of the Computer — 13

Editor's Notes

  • #2: 26 November 2019
  • #4: 26 November 2019
  • #5: 26 November 2019
  • #6: 26 November 2019
  • #7: 26 November 2019
  • #8: 26 November 2019
  • #9: 26 November 2019
  • #10: 26 November 2019
  • #11: 26 November 2019
  • #12: 26 November 2019