SlideShare a Scribd company logo
1 of 14
INSTRUCTION FORMATS
Mr. C.KARTHIKEYAN,
ASSISTANT PROFESSOR,
ECE , RMKCET
COMPUTER ARCHITECTURE
Von Neumann Vs Harvard Architecture
MIPS INSTRUCTION FORMAT
– Type
– Type
- Type
R – TYPE INSTRUCTION FORMAT
Eg:1. add $s1,$s2,$s3
Eg:2. sll $s1,$s2,10
000000
EXAMPLE
add $s1,$s2,$s3
6 5 5 5 5 6
op rs rt rd Shift amt fn
000000 10010 10011 10001 00000 100000
6 5 5 5 5 6
op rs rt rd Shift amt fn
000000 00000 10010 10001 01010 000000
sll $s1,$s2,10
I – TYPE INSTRUCTION FORMAT
Eg:1. lw $s1,4($s2)
Eg:2. beq $s1,$s2,10
Eg:3. ori $t0,$t1,8
EXAMPLE
lw $s1,4($s2)
6 5 5 16
op rs rt address
100011 10010 10001 0000000000000100
beq $s0,$s3,10
6 5 5 16
op rs rt address
000100 10011 10000 0000000000001010
EXAMPLE
ori $t0,$t1,8
6 5 5 16
op rs rt address
001011 01001 01000 0000000000001000
J – TYPE INSTRUCTION FORMAT
Eg J 500
6 26
op address
6 26
op address
000010 500
EXAMPLE f = (g + h) – (i + j)
lw $t0,20($s4)
lw $t1,24($s4)
lw $t2,28($s4)
lw $t3,32($s4)
add $s1,$t0,$t1
add $s2,$t2,$t3
sub $s0,$s1,$s2
sw $s0, 16($s4)
35 20 8 20
35 20 9 24
35 20 10 28
35 20 11 32
0 8 9 17 0 32
0 10 11 18 0 32
0 17 18 16 0 34
43 20 16 16
COMPUTER ARCHITECTURE
0000 0000 0001 0000 0101 0001 0000 0000
0000 0000 0001 0000 0101 0001 0000 0000
00000000000100000101000100000000
000000 00000100000101000100000000
R - Type
000000 00000100000101000100 000000
sll
000000 00000 10000 01010 00100 000000
sll $t2,
op rs rt rd Shift amt fn
$s0, 4
4.Instruction Formats.pptx

More Related Content

More from KarthikeyanC53

1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptxKarthikeyanC53
 
Floating Point Multiplication.pptx
Floating Point Multiplication.pptxFloating Point Multiplication.pptx
Floating Point Multiplication.pptxKarthikeyanC53
 
Floating Point Addition.pptx
Floating Point Addition.pptxFloating Point Addition.pptx
Floating Point Addition.pptxKarthikeyanC53
 
Floating Point Represenataion.pptx
Floating Point Represenataion.pptxFloating Point Represenataion.pptx
Floating Point Represenataion.pptxKarthikeyanC53
 
Refined Version of Division.pptx
Refined Version of Division.pptxRefined Version of Division.pptx
Refined Version of Division.pptxKarthikeyanC53
 
Version 1 Division.pptx
Version 1 Division.pptxVersion 1 Division.pptx
Version 1 Division.pptxKarthikeyanC53
 
BOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxBOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxKarthikeyanC53
 
2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptx2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptxKarthikeyanC53
 
1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptxKarthikeyanC53
 
5. Addressing Modes.pptx
5. Addressing Modes.pptx5. Addressing Modes.pptx
5. Addressing Modes.pptxKarthikeyanC53
 
3. Instruction Set.pptx
3. Instruction Set.pptx3. Instruction Set.pptx
3. Instruction Set.pptxKarthikeyanC53
 
2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptx2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptxKarthikeyanC53
 
1. Introduction to CAO.pptx
1. Introduction to CAO.pptx1. Introduction to CAO.pptx
1. Introduction to CAO.pptxKarthikeyanC53
 

More from KarthikeyanC53 (14)

1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx
 
Floating Point Multiplication.pptx
Floating Point Multiplication.pptxFloating Point Multiplication.pptx
Floating Point Multiplication.pptx
 
Floating Point Addition.pptx
Floating Point Addition.pptxFloating Point Addition.pptx
Floating Point Addition.pptx
 
Floating Point Represenataion.pptx
Floating Point Represenataion.pptxFloating Point Represenataion.pptx
Floating Point Represenataion.pptx
 
Refined Version of Division.pptx
Refined Version of Division.pptxRefined Version of Division.pptx
Refined Version of Division.pptx
 
Version 1 Division.pptx
Version 1 Division.pptxVersion 1 Division.pptx
Version 1 Division.pptx
 
BOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxBOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptx
 
2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptx2. Addition and Subtraction.pptx
2. Addition and Subtraction.pptx
 
1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx
 
6.Performance.pptx
6.Performance.pptx6.Performance.pptx
6.Performance.pptx
 
5. Addressing Modes.pptx
5. Addressing Modes.pptx5. Addressing Modes.pptx
5. Addressing Modes.pptx
 
3. Instruction Set.pptx
3. Instruction Set.pptx3. Instruction Set.pptx
3. Instruction Set.pptx
 
2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptx2. Eight Great Ideas.pptx
2. Eight Great Ideas.pptx
 
1. Introduction to CAO.pptx
1. Introduction to CAO.pptx1. Introduction to CAO.pptx
1. Introduction to CAO.pptx
 

4.Instruction Formats.pptx

  • 3. Von Neumann Vs Harvard Architecture
  • 4. MIPS INSTRUCTION FORMAT – Type – Type - Type
  • 5. R – TYPE INSTRUCTION FORMAT Eg:1. add $s1,$s2,$s3 Eg:2. sll $s1,$s2,10 000000
  • 6. EXAMPLE add $s1,$s2,$s3 6 5 5 5 5 6 op rs rt rd Shift amt fn 000000 10010 10011 10001 00000 100000 6 5 5 5 5 6 op rs rt rd Shift amt fn 000000 00000 10010 10001 01010 000000 sll $s1,$s2,10
  • 7. I – TYPE INSTRUCTION FORMAT Eg:1. lw $s1,4($s2) Eg:2. beq $s1,$s2,10 Eg:3. ori $t0,$t1,8
  • 8. EXAMPLE lw $s1,4($s2) 6 5 5 16 op rs rt address 100011 10010 10001 0000000000000100 beq $s0,$s3,10 6 5 5 16 op rs rt address 000100 10011 10000 0000000000001010
  • 9. EXAMPLE ori $t0,$t1,8 6 5 5 16 op rs rt address 001011 01001 01000 0000000000001000
  • 10. J – TYPE INSTRUCTION FORMAT Eg J 500 6 26 op address 6 26 op address 000010 500
  • 11. EXAMPLE f = (g + h) – (i + j) lw $t0,20($s4) lw $t1,24($s4) lw $t2,28($s4) lw $t3,32($s4) add $s1,$t0,$t1 add $s2,$t2,$t3 sub $s0,$s1,$s2 sw $s0, 16($s4) 35 20 8 20 35 20 9 24 35 20 10 28 35 20 11 32 0 8 9 17 0 32 0 10 11 18 0 32 0 17 18 16 0 34 43 20 16 16
  • 13. 0000 0000 0001 0000 0101 0001 0000 0000 0000 0000 0001 0000 0101 0001 0000 0000 00000000000100000101000100000000 000000 00000100000101000100000000 R - Type 000000 00000100000101000100 000000 sll 000000 00000 10000 01010 00100 000000 sll $t2, op rs rt rd Shift amt fn $s0, 4

Editor's Notes

  1. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  2. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.
  3. Notes to presenter: Description of what you learned in your own words on one side. Include information about the topic Details about the topic will also be helpful here. Tell the story of your learning experience. Just like a story there should always be a beginning, middle and an end. On the other side, you can add a graphic that provides evidence of what you learned. Feel free to use more than one slide to reflect upon your process. It also helps to add some video of your process.