SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
MIPS: Resoluc¸˜ao dos exerc´ıcios propostos
Elaine Cec´ılia Gatto 1
1
Portal Embarcados: www.embarcados.com.br
elainececiliagatto@gmail.com
1. Artigo 7: IF Simples
Verificar Tabelas 1, 2 e 3
C´odigo C:
1 if(x==y) go to L2
2 a[1] = b - c;
3 b = a[2] + c;
4 c = b + c[3]
5 L2:
6 a[4] = a[6] + a[5];
2. Artigo 8: IF Composto
2.1. Resoluc¸˜ao do Exerc´ıcio 1
Verificar Figura 1 e Tabelas 4, 5 e 6
C´odigo C:
1 if(a==b){
2 c = a + b;
3 a = b - c;
4 } else{
5 b = a + c;
6 c = b - c;
7 }
Considere:
• BEQ: branch if equal ou desvie se igual. Se a == b desvie para else;
• Se a n˜ao ´e diferente de b [lado esquerdo da figura BEQ], ent˜ao a s´o pode ser igual
a b [lado direito da figura BNE];
• BNE: branch if not equal ou desvie se n˜ao igual. Se a != b desvie para else;
• Se a n˜ao ´e igual a b [lado esquerdo da figura BNE], ent˜ao a s´o pode ser diferente
de b [lado direito da figura BEQ].
• Se (a==b) entra no if e se (a!=b) entra no else. Por isso, vamos usar BNE. O desvio
acontece quando (a!=b), caso contr´ario n˜ao tem desvio! Atente-se a este detalhe.
2.2. Resoluc¸˜ao do Exerc´ıcio 2
Verificar Figura 2 e Tabelas 7, 8 e 9
C´odigo C:
1 if(a!=b){
2 c = a - b;
3 a = b + c;
4 } else{
5 b = a - c;
6 c = b + c;
7 }
Considere: Se (a!=b) entra no if e se (a==b) entra no else. Por isso, vamos usar BEQ. O
desvio acontece quando (a==b), caso contr´ario n˜ao tem desvio! Atente-se a este detalhe.
2.3. Resoluc¸˜ao do Exerc´ıcio 3
Verificar Figura 3 e Tabelas 10, 11 e 12
C´odigo C:
1 if(a > b){
2 c = a - b;
3 a = b + c;
4 } else {
5 b = a - c;
6 c = b + c;
7 }
De acordo com a instruc¸˜ao SLT, se o primeiro registrador for menor que o se-
gundo registrador, ent˜ao o terceiro registrador recebe o valor 1. Se fizermos a seguinte
comparac¸˜ao, vamos descobri que maior ´e igual a 0 e menor ´e igual a 1. Portanto, para
entrar no ELSE, o valor de $t0 deve ser 1. Assim, quando $t0 for igual a um, acontece
o desvio. Quem testa isso ´e a instruc¸˜ao BNE que realiza o desvio quando a desigualdade
entre dois valores ´e verdadeira!
2.4. Resoluc¸˜ao do Exerc´ıcio 4
Verificar Figura 4 e Tabelas 13, 14 e 15
C´odigo C:
1 if(a > b){
2 c = a - b;
3 a = b + c;
4 } else {
5 b = a - c;
6 c = b + c;
7 }
De acordo com a instruc¸˜ao SLT, se o primeiro registrador for menor que o se-
gundo registrador, ent˜ao o terceiro registrador recebe o valor 1. Se fizermos a seguinte
comparac¸˜ao, vamos descobri que maior ´e igual a 0 e menor ´e igual a 1. Portanto, para
entrar no ELSE, o valor de $t0 deve ser 0. Assim, quando $t0 for igual a 1 acontece o
desvio. Quem testa isso ´e a instruc¸˜ao BEQ que realiza o desvio quando a igualdade entre
dois valores ´e verdadeira!
3. Artigo 10: Operac¸˜oes L´ogicas
Verificar Figura 5 e Tabelas 16, 17 e 18.
4. Artigo 11: Operac¸˜ao AND
Verificar Figura 6 e Tabelas 19, 20 e 21.
5. Artigo 12: Operac¸˜ao OR
Verificar Figura 7 e Tabelas 22, 23 e 24.
6. Artigo 13: Operac¸˜ao NOT
Verificar Figura 8 e Tabelas 25, 26 e 27.
7. Artigo 16
Verificar Tabelas 28, 29 e 30.
Table 1. Linguagem IF Simples
Inst. Assembly M´aquina
1 BEQ $s3, $s4, L2 BEQ $s3, $s4, L2
2 SUB $t0, $s1, $s2 SUB $t0, $s1, $s2
3 SW $t0, 1($s0) SW $t0, 1($s0)
4 LW $t1, 2($s0) LW $t1, 2($s0)
5 ADD $s1, $t1, $s2 ADD $s1, $t1, $s2
6 LW $t2, 3($s2) LW $t2, 3($s2)
7 ADD $s2, $s1, $t2 ADD $s2, $s1, $t2
8 L2 : LW $t0, 6($s0) LW $t0, 6($s0)
9 LW $t1, 5($s0) LW $t1, 5($s0)
10 ADD $t2, $t0, $t1 ADD $t2, $t0, $t1
11 SW $t2, 4($s0) SW $t2, 4($s0)
Table 2. Representac¸ ˜ao de M´aquina IF Simples
Instr. End.Mem. op rs rt rd shamt funct
1 10.000 5 19 20 10028
2 10.004 0 17 18 8 0 34
3 10.008 43 8 16 1
4 10.012 35 8 16 2
5 10.016 0 9 18 17 0 32
6 10.020 35 10 18 3
7 10.024 0 17 10 18 0 32
8 10.028 35 8 16 6
9 10.032 35 9 16 5
10 10.036 0 8 9 10 0 32
11 10.040 43 10 16 4
Table 3. C´odigo de M´aquina IF Simples
Instr. End.Mem. op rs rt rd shamt funct
1 10.000 000101 10011 10100 L2
2 10.004 000000 10001 10010 01000 00000 100010
3 10.008 101011 01000 10000 0000 0000 0000 0001
4 10.012 100011 01000 10000 0000 0000 0000 0010
5 10.016 000000 01001 10010 10001 00000 100000
6 10.020 100011 01010 10010 0000 0000 0000 0011
7 10.024 000000 10001 01010 10010 00000 100000
8 10.028 100011 01000 10000 0000 0000 0000 0110
9 10.032 100011 01001 10000 0000 0000 0000 0101
10 10.036 000000 01000 01001 01010 00000 100000
11 10.040 101011 01010 10000 0000 0000 0000 0100
Figure 1. BNE e BEQ Exerc´ıcio 1
Table 4. Linguagem Exerc´ıcio 1
Instr. End.Mem. Assembly M´aquina
1 10000 BNE $s0, $s1, EXIT ELSE $16, $17, ELSE
2 10004 ADD $s2, $s0, $s1 ADD $18, $16, $17
3 10008 SUB $s0, $s1, $s2 SUB $16, $17, $18
4 10012 J EXIT J EXIT
5 10016 ELSE: ADD $s1, $s0, $s2 ELSE: ADD $17, $16, $18
6 10020 SUB $s2, $s1, $s2 SUB $18, $17, $183
7 10024 EXIT EXIT
Table 5. Representac¸ ˜ao Exerc´ıcio 1
Instr. End.Mem. op rs rt rd shamt funct
1 10000 5 16 17 10016
2 10004 0 16 17 18 0 32
3 10008 0 17 18 16 0 34
4 10012 2 10024
5 10016 0 16 18 17 0 32
6 10020 0 17 18 18 0 34
7 10024 EXIT
Table 6. C´odigo de M´aquina Exerc´ıcio 1
Instr. End.Mem. op rs rt rd shamt funct
1 10000 000101 10000 10001 0010 0111 0010 0000
2 10004 000000 10000 10001 10010 00000 100000
3 10008 000000 10001 10010 10000 00000 100010
4 10012 000010 0000 0000 0000 1001 1100 1010 00
5 10016 000000 10000 10010 10001 00000 100000
6 10020 000000 10001 10010 10010 00000 100010
7 10024 EXIT
Figure 2. BNE e BEQ Exerc´ıcio 2
Table 7. Linguagem Assembly Exerc´ıcio 2
Instr. End.Mem. Assembly M´aquina
1 10000 BEQ $s0, $s1, ELSE BEQ $16, $17, ELSE
2 10004 SUB $s2, $s0, $s1 SUB $18, $16, $17
3 10008 ADD $s0, $s1, $s2 ADD $16, $17, $18
4 10012 J EXIT J EXIT
5 10016 ELSE: SUB $s1, $s0, $s2 ELSE: SUB $17, $16, $18
6 10020 ADD $s2, $s1, $s2 ADD $18, $17, $18
7 10024 EXIT EXIT
Table 8. Representac¸ ˜ao Exerc´ıcio 2
Instr. End.Mem. op rs rt rd shamt funct
1 10000 4 16 17 10016
2 10004 0 16 17 18 0 32
3 10008 0 17 18 16 0 34
4 10012 2 10024
5 10016 0 16 18 17 0 32
6 10020 0 17 18 18 0 34
7 10024 EXIT
Table 9. C´odigo de M´aquina Exerc´ıcio 2
Instr. End.Mem. op rs rt rd shamt funct
1 10000 000100 10000 10001 0010 0111 0010 0000
2 10004 000000 10000 10001 10010 00000 100000
3 10008 000000 10001 10010 10000 00000 100010
4 10012 000010 0000 0000 0000 1001 1100 1010 00
5 10016 000000 10000 10010 10001 00000 100000
6 10020 000000 10001 10010 10010 00000 100010
7 10024 EXIT
Table 10. Linguagem Exerc´ıcio 3
Instr. End.Mem. Assembly M´aquina
1 10000 SLT $t0, $s0, $s1 SLT $8, $16, $17
2 10004 BNE $t0, $zero, ELSE BNE $8, $0, 10020
3 10008 SUB $s2, $s0, $s1 SUB $18, $16, $17
4 10012 ADD $s0, $s1, $S2 ADD $16, $17, $18
5 10016 J EXIT J EXIT
6 10020 ELSE: SUB $s1, $s0, $s2 ELSE: SUB $17, $16, $18
7 10024 ADD $s2, $s1, $s2 ADD $16, $17, $18
8 10028 EXIT EXIT
Figure 3. SLT e BNE Exerc´ıcio 3
Table 11. Representac¸ ˜ao Exerc´ıcio 3
Instr. End.Mem. op rs rt rd shamt funct
1 10000 0 16 17 8 0 42
2 10004 5 8 0 10020
3 10008 0 16 17 18 0 34
4 10012 0 17 18 16 0 32
5 10016 2 10028
6 10020 0 16 18 17 0 34
7 10024 0 17 18 18 0 32
8 10028 EXIT
Table 12. C´odigo de M´aquina Exerc´ıcio 3
Instr. End.Mem. op rs rt rd shamt funct
1 10000 000000 10000 10001 0010 0111 0010 0100
2 10004 000101 01000 00000 0010 0111 0010 0100
3 10008 000000 10000 10001 10010 00000 100010
4 10012 000000 10001 10010 10000 00000 100000
5 10016 000010 0000 0000 0000 1001 1100 1100 00
6 10020 000000 10000 10010 10001 00000 100010
7 10024 000000 10001 10010 10010 00000 100000
8 10028 EXIT
Figure 4. BNE e BEQ Exerc´ıcio 4
Table 13. Linguagem Exerc´ıcio 4
Instr. End.Mem. Assembly M´aquina
1 10000 SLT $t0, $s0, $s1 SLT $8, $16, $17
2 10004 BEQ $t0, $zero, ELSE BEQ $8, $0, 10016
3 10008 ADD $s2, $s0, $s1 ADD $18, $16, $17
4 10012 SUB $s0, $s1, $S2 SUB $16, $17, $18
5 10016 J EXIT J EXIT
6 10020 ELSE: ADD $s1, $s0, $s2 ELSE: ADD $17, $16, $18
7 10024 SUB $s2, $s1, $s2 SUB $16, $17, $18
8 10028 EXIT EXIT
Table 14. Representac¸ ˜ao Exerc´ıcio 4
Instr. End.Mem. op rs rt rd shamt funct
1 10000 0 16 17 8 0 42
2 10004 4 8 0 10020
3 10008 0 16 17 18 0 34
4 10012 0 17 18 16 0 32
5 10016 2 10028
6 10020 0 16 18 17 0 34
7 10024 0 17 18 18 0 32
8 10028 EXIT
Table 15. C´odigo Exerc´ıcio 4
Instr. End.Mem. op rs rt rd shamt funct
1 10000 000000 10000 10001 0010 0111 0010 0100
2 10004 000100 01000 00000 0010 0111 0010 1100
3 10008 000000 10000 10001 10010 00000 100010
4 10012 000000 10001 10010 10000 00000 100000
5 10016 000010 0000 0000 0000 1001 1100 1011 00
6 10020 000000 10000 10010 10001 00000 100010
7 10024 000000 10001 10010 10010 00000 100000
8 10028 EXIT
Figure 5. Calculando Deslocamentos Artigo 10
Table 16. Linguagem Artigo 10
Assembly M´aquina
1 SRL $t0, $s0, 8 SRL $8, $16, 8
2 SLL $t1, $s1, 4 SLL $9, $17, 4
Table 17. Representac¸ ˜ao Artigo 10
op rs rt rd shamt funct
1 0 0 16 8 8 2
2 0 0 17 9 4 0
Table 18. C´odigo Artigo 10
op rs rt rd shamt funct
1 000000 000000 010010 001000 001000 000010
2 000000 000000 010001 001001 000100 000000
Figure 6. Calculando AND Artigo 11
Table 19. Linguagem Artigo 11
Assembly M´aquina
1 AND $t0, $t1, $t2 AND $8, $9, $10
Table 20. Representac¸ ˜ao Artigo 11
op rs rt rd shamt funct
1 0 9 10 8 0 36
Table 21. C´odigo Artigo 11
op rs rt rd shamt funct
1 000000 001001 001010 001000 000000 100100
Table 22. Linguagem Artigo 12
Assembly M´aquina
1 OR $t0, $t1, $t2 OR $8, $9, $10
Figure 7. Calculando OR Artigo 12
Table 23. Representac¸ ˜ao Artigo 12
op rs rt rd shamt funct
1 0 9 10 8 0 37
Table 24. C´odigo Artigo 12
op rs rt rd shamt funct
1 000000 001001 001010 001000 000000 100101
Figure 8. Calculando NOT Artigo 13
Table 25. Linguagem Artigo 13
Assembly M´aquina
1 NOT $t0, $t1, $zero NOT $8, $9, $0
Table 26. Representac¸ ˜ao Artigo 13
op rs rt rd shamt funct
1 0 9 0 8 0 39
Table 27. C´odigo Artigo 13
op rs rt rd shamt funct
1 000000 001001 00000 001000 000000 100111
Table 28. Linguagem Artigo 16
Instr. End.Mem. Assembly M´aquina
1 10000 SLL $t1, $s3, $2 SLL $8, $19, $2
2 10004 ADD $t0, $t1, $s2 ADD $9, $9, $17
3 10008 LW $t2, 0($1) LW $10, 0($9)
4 10012 ADD $s0, $s1, $t2 ADD $16, $17, $10
Table 29. Representac¸ ˜ao Artigo 16
Instr. End.Mem. op rs rt rd shamt funct
1 10000 0 19 9 2 0 0
2 10004 0 17 9 0 0 32
3 10008 35 9 0 18
4 10012 0 10 16 16 0 32
Table 30. C´odigo Artigo 16
Instr. End.Mem. op rs rt rd shamt funct
1 10000 000000 010011 001001 000010 000000 000000
2 10004 000000 010001 001001 000000 000000 100000
3 10008 100011 001001 000000 0000 0000 0000 000000
4 10012 000000 001010 010000 010000 000000 100000

Contenu connexe

Tendances

Conceitos de Banco de dados e SGBD
Conceitos de Banco de dados e SGBDConceitos de Banco de dados e SGBD
Conceitos de Banco de dados e SGBDVinicius Buffolo
 
Plano de aula áreas de superfícies planas- 2015
Plano de aula  áreas de superfícies planas- 2015Plano de aula  áreas de superfícies planas- 2015
Plano de aula áreas de superfícies planas- 2015qcavalcante
 
Excel fórmulas básicas
Excel fórmulas básicasExcel fórmulas básicas
Excel fórmulas básicasAfonso Lima
 
Lista 03 1º ano logarítmos
Lista 03 1º ano   logarítmosLista 03 1º ano   logarítmos
Lista 03 1º ano logarítmosHélio Rocha
 
Introdução a estruturas de dados em python
Introdução a estruturas de dados em pythonIntrodução a estruturas de dados em python
Introdução a estruturas de dados em pythonAlvaro Oliveira
 
Apostila matematica fundamental
Apostila matematica fundamentalApostila matematica fundamental
Apostila matematica fundamentalMaryana Moreira
 
14 aula teoria dos conjuntos
14 aula   teoria dos conjuntos14 aula   teoria dos conjuntos
14 aula teoria dos conjuntosjatobaesem
 
MATRIZES E DETERMINANTES (2º ANO)
MATRIZES E DETERMINANTES (2º ANO)MATRIZES E DETERMINANTES (2º ANO)
MATRIZES E DETERMINANTES (2º ANO)Hélio Rocha
 
O Scratch no ensino da programação
O Scratch no ensino da programaçãoO Scratch no ensino da programação
O Scratch no ensino da programaçãoJoão Sá
 
Lista de exercicios algoritmos com pseudocodigo
Lista de exercicios   algoritmos com pseudocodigoLista de exercicios   algoritmos com pseudocodigo
Lista de exercicios algoritmos com pseudocodigoMauro Pereira
 
Conjuntos numéricos
Conjuntos numéricosConjuntos numéricos
Conjuntos numéricosandreilson18
 
Eletiva matematica ludica.docx
Eletiva matematica ludica.docxEletiva matematica ludica.docx
Eletiva matematica ludica.docxMayconClezio
 

Tendances (20)

Conceitos de Banco de dados e SGBD
Conceitos de Banco de dados e SGBDConceitos de Banco de dados e SGBD
Conceitos de Banco de dados e SGBD
 
Conjuntos
ConjuntosConjuntos
Conjuntos
 
Plano de aula áreas de superfícies planas- 2015
Plano de aula  áreas de superfícies planas- 2015Plano de aula  áreas de superfícies planas- 2015
Plano de aula áreas de superfícies planas- 2015
 
Algoritmos - Aula 07 A - Lacos
Algoritmos - Aula 07 A - LacosAlgoritmos - Aula 07 A - Lacos
Algoritmos - Aula 07 A - Lacos
 
Excel fórmulas básicas
Excel fórmulas básicasExcel fórmulas básicas
Excel fórmulas básicas
 
Linguagem C - Ponteiros
Linguagem C - PonteirosLinguagem C - Ponteiros
Linguagem C - Ponteiros
 
Lista 03 1º ano logarítmos
Lista 03 1º ano   logarítmosLista 03 1º ano   logarítmos
Lista 03 1º ano logarítmos
 
Linguagem C - Estruturas
Linguagem C - EstruturasLinguagem C - Estruturas
Linguagem C - Estruturas
 
Introdução a estruturas de dados em python
Introdução a estruturas de dados em pythonIntrodução a estruturas de dados em python
Introdução a estruturas de dados em python
 
Apostila matematica fundamental
Apostila matematica fundamentalApostila matematica fundamental
Apostila matematica fundamental
 
14 aula teoria dos conjuntos
14 aula   teoria dos conjuntos14 aula   teoria dos conjuntos
14 aula teoria dos conjuntos
 
Integração numerica
Integração  numericaIntegração  numerica
Integração numerica
 
Python - Introdução
Python - IntroduçãoPython - Introdução
Python - Introdução
 
MATRIZES E DETERMINANTES (2º ANO)
MATRIZES E DETERMINANTES (2º ANO)MATRIZES E DETERMINANTES (2º ANO)
MATRIZES E DETERMINANTES (2º ANO)
 
O Scratch no ensino da programação
O Scratch no ensino da programaçãoO Scratch no ensino da programação
O Scratch no ensino da programação
 
Apostila de matrizes (9 páginas, 40 questões, com gabarito)
Apostila de matrizes (9 páginas, 40 questões, com gabarito)Apostila de matrizes (9 páginas, 40 questões, com gabarito)
Apostila de matrizes (9 páginas, 40 questões, com gabarito)
 
Aula 9 banco de dados
Aula 9   banco de dadosAula 9   banco de dados
Aula 9 banco de dados
 
Lista de exercicios algoritmos com pseudocodigo
Lista de exercicios   algoritmos com pseudocodigoLista de exercicios   algoritmos com pseudocodigo
Lista de exercicios algoritmos com pseudocodigo
 
Conjuntos numéricos
Conjuntos numéricosConjuntos numéricos
Conjuntos numéricos
 
Eletiva matematica ludica.docx
Eletiva matematica ludica.docxEletiva matematica ludica.docx
Eletiva matematica ludica.docx
 

Similaire à Exercicios Resolvidos Série MIPS Embarcados

CASIO 991 ES Calculator Technique
CASIO 991 ES Calculator TechniqueCASIO 991 ES Calculator Technique
CASIO 991 ES Calculator TechniqueMark Lester Manapol
 
Proyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IProyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IDaniel A. Lopez Ch.
 
Microeconomics-The cost of production.ppt
Microeconomics-The cost of production.pptMicroeconomics-The cost of production.ppt
Microeconomics-The cost of production.pptmayamonfori
 
Exercise 1 networking
Exercise 1 networkingExercise 1 networking
Exercise 1 networkingMendana Pweka
 
Time brings all things to pass
Time brings all things to passTime brings all things to pass
Time brings all things to passKamil Witecki
 
Number system arithmetic
Number system arithmetic Number system arithmetic
Number system arithmetic renatus katundu
 
Solutions Manual for Basics of Engineering Economy 2nd Edition by Blank
Solutions Manual for Basics of Engineering Economy 2nd Edition by BlankSolutions Manual for Basics of Engineering Economy 2nd Edition by Blank
Solutions Manual for Basics of Engineering Economy 2nd Edition by Blankriven062
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiMuhammad Abdullah
 
Error Reduction of Modified Booth Multipliers in Mac Unit
Error Reduction of Modified Booth Multipliers in Mac UnitError Reduction of Modified Booth Multipliers in Mac Unit
Error Reduction of Modified Booth Multipliers in Mac UnitIOSR Journals
 
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...Julio Banks
 
Electronica digital
Electronica digitalElectronica digital
Electronica digitalcas
 
Resolucao de-exercicios-cap 2 - franco-brunetti
Resolucao de-exercicios-cap 2 - franco-brunettiResolucao de-exercicios-cap 2 - franco-brunetti
Resolucao de-exercicios-cap 2 - franco-brunettiArgélio Paniago
 

Similaire à Exercicios Resolvidos Série MIPS Embarcados (20)

CASIO 991 ES Calculator Technique
CASIO 991 ES Calculator TechniqueCASIO 991 ES Calculator Technique
CASIO 991 ES Calculator Technique
 
Crystal ball
Crystal ball Crystal ball
Crystal ball
 
Proyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital IProyecto final curso – Electrónica Digital I
Proyecto final curso – Electrónica Digital I
 
Microeconomics-The cost of production.ppt
Microeconomics-The cost of production.pptMicroeconomics-The cost of production.ppt
Microeconomics-The cost of production.ppt
 
Exercise 1 networking
Exercise 1 networkingExercise 1 networking
Exercise 1 networking
 
Time brings all things to pass
Time brings all things to passTime brings all things to pass
Time brings all things to pass
 
Ch4
Ch4Ch4
Ch4
 
18-FSM.ppt
18-FSM.ppt18-FSM.ppt
18-FSM.ppt
 
Theory of cost
Theory of costTheory of cost
Theory of cost
 
03 cost curves
03 cost curves03 cost curves
03 cost curves
 
Number system arithmetic
Number system arithmetic Number system arithmetic
Number system arithmetic
 
7
77
7
 
Solutions Manual for Basics of Engineering Economy 2nd Edition by Blank
Solutions Manual for Basics of Engineering Economy 2nd Edition by BlankSolutions Manual for Basics of Engineering Economy 2nd Edition by Blank
Solutions Manual for Basics of Engineering Economy 2nd Edition by Blank
 
5431305022
54313050225431305022
5431305022
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
Exer7
Exer7Exer7
Exer7
 
Error Reduction of Modified Booth Multipliers in Mac Unit
Error Reduction of Modified Booth Multipliers in Mac UnitError Reduction of Modified Booth Multipliers in Mac Unit
Error Reduction of Modified Booth Multipliers in Mac Unit
 
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...
T liner simulation parametric study of a thermal-liner by Julio c. banks, MSM...
 
Electronica digital
Electronica digitalElectronica digital
Electronica digital
 
Resolucao de-exercicios-cap 2 - franco-brunetti
Resolucao de-exercicios-cap 2 - franco-brunettiResolucao de-exercicios-cap 2 - franco-brunetti
Resolucao de-exercicios-cap 2 - franco-brunetti
 

Plus de Elaine Cecília Gatto

A influência da Tecnologia em cada faixa etaria
A influência da Tecnologia em cada faixa etariaA influência da Tecnologia em cada faixa etaria
A influência da Tecnologia em cada faixa etariaElaine Cecília Gatto
 
Inteligência Artificial Aplicada à Medicina
Inteligência Artificial Aplicada à MedicinaInteligência Artificial Aplicada à Medicina
Inteligência Artificial Aplicada à MedicinaElaine Cecília Gatto
 
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...Elaine Cecília Gatto
 
Apresentação da minha tese de doutorado no EPPC
Apresentação da minha tese de doutorado no EPPCApresentação da minha tese de doutorado no EPPC
Apresentação da minha tese de doutorado no EPPCElaine Cecília Gatto
 
Como a pesquisa científica impacta o mundo real.pptx
Como a pesquisa científica impacta o mundo real.pptxComo a pesquisa científica impacta o mundo real.pptx
Como a pesquisa científica impacta o mundo real.pptxElaine Cecília Gatto
 
Explorando correlações entre rótulos para o particionamento do espaço de rótu...
Explorando correlações entre rótulos para o particionamento do espaço de rótu...Explorando correlações entre rótulos para o particionamento do espaço de rótu...
Explorando correlações entre rótulos para o particionamento do espaço de rótu...Elaine Cecília Gatto
 
Community Detection for Multi-Label Classification - Seminários UFSCar
Community Detection for Multi-Label Classification - Seminários UFSCarCommunity Detection for Multi-Label Classification - Seminários UFSCar
Community Detection for Multi-Label Classification - Seminários UFSCarElaine Cecília Gatto
 
Classificação Multirrótulo: Aprendizado de Correlações
Classificação Multirrótulo: Aprendizado de CorrelaçõesClassificação Multirrótulo: Aprendizado de Correlações
Classificação Multirrótulo: Aprendizado de CorrelaçõesElaine Cecília Gatto
 
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...Elaine Cecília Gatto
 
Community Detection Method for Multi-Label Classification
Community Detection Method for Multi-Label ClassificationCommunity Detection Method for Multi-Label Classification
Community Detection Method for Multi-Label ClassificationElaine Cecília Gatto
 
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdf
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdfMulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdf
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdfElaine Cecília Gatto
 
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...Elaine Cecília Gatto
 
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...Elaine Cecília Gatto
 
Pipeline desdobramento escalonamento
Pipeline desdobramento escalonamentoPipeline desdobramento escalonamento
Pipeline desdobramento escalonamentoElaine Cecília Gatto
 
Resumo das Instruções de Desvio Incondicionais MIPS 32 bits
Resumo das Instruções de Desvio Incondicionais MIPS 32 bitsResumo das Instruções de Desvio Incondicionais MIPS 32 bits
Resumo das Instruções de Desvio Incondicionais MIPS 32 bitsElaine Cecília Gatto
 
Como descobrir e classificar coisas usando machine learning sem compilcação
Como descobrir e classificar coisas usando machine learning sem compilcaçãoComo descobrir e classificar coisas usando machine learning sem compilcação
Como descobrir e classificar coisas usando machine learning sem compilcaçãoElaine Cecília Gatto
 

Plus de Elaine Cecília Gatto (20)

A influência da Tecnologia em cada faixa etaria
A influência da Tecnologia em cada faixa etariaA influência da Tecnologia em cada faixa etaria
A influência da Tecnologia em cada faixa etaria
 
Inteligência Artificial Aplicada à Medicina
Inteligência Artificial Aplicada à MedicinaInteligência Artificial Aplicada à Medicina
Inteligência Artificial Aplicada à Medicina
 
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...
Além do Aprendizado Local e Global: Particionando o espaço de classes em prob...
 
Apresentação da minha tese de doutorado no EPPC
Apresentação da minha tese de doutorado no EPPCApresentação da minha tese de doutorado no EPPC
Apresentação da minha tese de doutorado no EPPC
 
entrevista r7.pdf
entrevista r7.pdfentrevista r7.pdf
entrevista r7.pdf
 
Como a pesquisa científica impacta o mundo real.pptx
Como a pesquisa científica impacta o mundo real.pptxComo a pesquisa científica impacta o mundo real.pptx
Como a pesquisa científica impacta o mundo real.pptx
 
Empoderamento Feminino
Empoderamento FemininoEmpoderamento Feminino
Empoderamento Feminino
 
Explorando correlações entre rótulos para o particionamento do espaço de rótu...
Explorando correlações entre rótulos para o particionamento do espaço de rótu...Explorando correlações entre rótulos para o particionamento do espaço de rótu...
Explorando correlações entre rótulos para o particionamento do espaço de rótu...
 
Community Detection for Multi-Label Classification - Seminários UFSCar
Community Detection for Multi-Label Classification - Seminários UFSCarCommunity Detection for Multi-Label Classification - Seminários UFSCar
Community Detection for Multi-Label Classification - Seminários UFSCar
 
Classificação Multirrótulo: Aprendizado de Correlações
Classificação Multirrótulo: Aprendizado de CorrelaçõesClassificação Multirrótulo: Aprendizado de Correlações
Classificação Multirrótulo: Aprendizado de Correlações
 
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
 
Community Detection Method for Multi-Label Classification
Community Detection Method for Multi-Label ClassificationCommunity Detection Method for Multi-Label Classification
Community Detection Method for Multi-Label Classification
 
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdf
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdfMulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdf
Mulheres na Campus Party assumir o feminismo ou não – Blogueiras Feministas.pdf
 
Curtinhas de sábado.pdf
Curtinhas de sábado.pdfCurtinhas de sábado.pdf
Curtinhas de sábado.pdf
 
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...
Explorando Correlações entre Rótulos usando Métodos de Detecção de Comu...
 
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
EXPLORANDO CORRELAÇÕES PARA O PARTICIONAMENTO DO ESPAÇO DE RÓTULOS EM PROBLEM...
 
Pipeline desdobramento escalonamento
Pipeline desdobramento escalonamentoPipeline desdobramento escalonamento
Pipeline desdobramento escalonamento
 
Cheat sheet Mips 32 bits
Cheat sheet Mips 32 bitsCheat sheet Mips 32 bits
Cheat sheet Mips 32 bits
 
Resumo das Instruções de Desvio Incondicionais MIPS 32 bits
Resumo das Instruções de Desvio Incondicionais MIPS 32 bitsResumo das Instruções de Desvio Incondicionais MIPS 32 bits
Resumo das Instruções de Desvio Incondicionais MIPS 32 bits
 
Como descobrir e classificar coisas usando machine learning sem compilcação
Como descobrir e classificar coisas usando machine learning sem compilcaçãoComo descobrir e classificar coisas usando machine learning sem compilcação
Como descobrir e classificar coisas usando machine learning sem compilcação
 

Dernier

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Dernier (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Exercicios Resolvidos Série MIPS Embarcados

  • 1. MIPS: Resoluc¸˜ao dos exerc´ıcios propostos Elaine Cec´ılia Gatto 1 1 Portal Embarcados: www.embarcados.com.br elainececiliagatto@gmail.com 1. Artigo 7: IF Simples Verificar Tabelas 1, 2 e 3 C´odigo C: 1 if(x==y) go to L2 2 a[1] = b - c; 3 b = a[2] + c; 4 c = b + c[3] 5 L2: 6 a[4] = a[6] + a[5]; 2. Artigo 8: IF Composto 2.1. Resoluc¸˜ao do Exerc´ıcio 1 Verificar Figura 1 e Tabelas 4, 5 e 6 C´odigo C: 1 if(a==b){ 2 c = a + b; 3 a = b - c; 4 } else{ 5 b = a + c; 6 c = b - c; 7 } Considere: • BEQ: branch if equal ou desvie se igual. Se a == b desvie para else; • Se a n˜ao ´e diferente de b [lado esquerdo da figura BEQ], ent˜ao a s´o pode ser igual a b [lado direito da figura BNE]; • BNE: branch if not equal ou desvie se n˜ao igual. Se a != b desvie para else; • Se a n˜ao ´e igual a b [lado esquerdo da figura BNE], ent˜ao a s´o pode ser diferente de b [lado direito da figura BEQ]. • Se (a==b) entra no if e se (a!=b) entra no else. Por isso, vamos usar BNE. O desvio acontece quando (a!=b), caso contr´ario n˜ao tem desvio! Atente-se a este detalhe.
  • 2. 2.2. Resoluc¸˜ao do Exerc´ıcio 2 Verificar Figura 2 e Tabelas 7, 8 e 9 C´odigo C: 1 if(a!=b){ 2 c = a - b; 3 a = b + c; 4 } else{ 5 b = a - c; 6 c = b + c; 7 } Considere: Se (a!=b) entra no if e se (a==b) entra no else. Por isso, vamos usar BEQ. O desvio acontece quando (a==b), caso contr´ario n˜ao tem desvio! Atente-se a este detalhe. 2.3. Resoluc¸˜ao do Exerc´ıcio 3 Verificar Figura 3 e Tabelas 10, 11 e 12 C´odigo C: 1 if(a > b){ 2 c = a - b; 3 a = b + c; 4 } else { 5 b = a - c; 6 c = b + c; 7 } De acordo com a instruc¸˜ao SLT, se o primeiro registrador for menor que o se- gundo registrador, ent˜ao o terceiro registrador recebe o valor 1. Se fizermos a seguinte comparac¸˜ao, vamos descobri que maior ´e igual a 0 e menor ´e igual a 1. Portanto, para entrar no ELSE, o valor de $t0 deve ser 1. Assim, quando $t0 for igual a um, acontece o desvio. Quem testa isso ´e a instruc¸˜ao BNE que realiza o desvio quando a desigualdade entre dois valores ´e verdadeira! 2.4. Resoluc¸˜ao do Exerc´ıcio 4 Verificar Figura 4 e Tabelas 13, 14 e 15 C´odigo C: 1 if(a > b){ 2 c = a - b; 3 a = b + c; 4 } else { 5 b = a - c; 6 c = b + c; 7 } De acordo com a instruc¸˜ao SLT, se o primeiro registrador for menor que o se- gundo registrador, ent˜ao o terceiro registrador recebe o valor 1. Se fizermos a seguinte comparac¸˜ao, vamos descobri que maior ´e igual a 0 e menor ´e igual a 1. Portanto, para
  • 3. entrar no ELSE, o valor de $t0 deve ser 0. Assim, quando $t0 for igual a 1 acontece o desvio. Quem testa isso ´e a instruc¸˜ao BEQ que realiza o desvio quando a igualdade entre dois valores ´e verdadeira! 3. Artigo 10: Operac¸˜oes L´ogicas Verificar Figura 5 e Tabelas 16, 17 e 18. 4. Artigo 11: Operac¸˜ao AND Verificar Figura 6 e Tabelas 19, 20 e 21. 5. Artigo 12: Operac¸˜ao OR Verificar Figura 7 e Tabelas 22, 23 e 24. 6. Artigo 13: Operac¸˜ao NOT Verificar Figura 8 e Tabelas 25, 26 e 27. 7. Artigo 16 Verificar Tabelas 28, 29 e 30. Table 1. Linguagem IF Simples Inst. Assembly M´aquina 1 BEQ $s3, $s4, L2 BEQ $s3, $s4, L2 2 SUB $t0, $s1, $s2 SUB $t0, $s1, $s2 3 SW $t0, 1($s0) SW $t0, 1($s0) 4 LW $t1, 2($s0) LW $t1, 2($s0) 5 ADD $s1, $t1, $s2 ADD $s1, $t1, $s2 6 LW $t2, 3($s2) LW $t2, 3($s2) 7 ADD $s2, $s1, $t2 ADD $s2, $s1, $t2 8 L2 : LW $t0, 6($s0) LW $t0, 6($s0) 9 LW $t1, 5($s0) LW $t1, 5($s0) 10 ADD $t2, $t0, $t1 ADD $t2, $t0, $t1 11 SW $t2, 4($s0) SW $t2, 4($s0)
  • 4. Table 2. Representac¸ ˜ao de M´aquina IF Simples Instr. End.Mem. op rs rt rd shamt funct 1 10.000 5 19 20 10028 2 10.004 0 17 18 8 0 34 3 10.008 43 8 16 1 4 10.012 35 8 16 2 5 10.016 0 9 18 17 0 32 6 10.020 35 10 18 3 7 10.024 0 17 10 18 0 32 8 10.028 35 8 16 6 9 10.032 35 9 16 5 10 10.036 0 8 9 10 0 32 11 10.040 43 10 16 4 Table 3. C´odigo de M´aquina IF Simples Instr. End.Mem. op rs rt rd shamt funct 1 10.000 000101 10011 10100 L2 2 10.004 000000 10001 10010 01000 00000 100010 3 10.008 101011 01000 10000 0000 0000 0000 0001 4 10.012 100011 01000 10000 0000 0000 0000 0010 5 10.016 000000 01001 10010 10001 00000 100000 6 10.020 100011 01010 10010 0000 0000 0000 0011 7 10.024 000000 10001 01010 10010 00000 100000 8 10.028 100011 01000 10000 0000 0000 0000 0110 9 10.032 100011 01001 10000 0000 0000 0000 0101 10 10.036 000000 01000 01001 01010 00000 100000 11 10.040 101011 01010 10000 0000 0000 0000 0100 Figure 1. BNE e BEQ Exerc´ıcio 1
  • 5. Table 4. Linguagem Exerc´ıcio 1 Instr. End.Mem. Assembly M´aquina 1 10000 BNE $s0, $s1, EXIT ELSE $16, $17, ELSE 2 10004 ADD $s2, $s0, $s1 ADD $18, $16, $17 3 10008 SUB $s0, $s1, $s2 SUB $16, $17, $18 4 10012 J EXIT J EXIT 5 10016 ELSE: ADD $s1, $s0, $s2 ELSE: ADD $17, $16, $18 6 10020 SUB $s2, $s1, $s2 SUB $18, $17, $183 7 10024 EXIT EXIT Table 5. Representac¸ ˜ao Exerc´ıcio 1 Instr. End.Mem. op rs rt rd shamt funct 1 10000 5 16 17 10016 2 10004 0 16 17 18 0 32 3 10008 0 17 18 16 0 34 4 10012 2 10024 5 10016 0 16 18 17 0 32 6 10020 0 17 18 18 0 34 7 10024 EXIT Table 6. C´odigo de M´aquina Exerc´ıcio 1 Instr. End.Mem. op rs rt rd shamt funct 1 10000 000101 10000 10001 0010 0111 0010 0000 2 10004 000000 10000 10001 10010 00000 100000 3 10008 000000 10001 10010 10000 00000 100010 4 10012 000010 0000 0000 0000 1001 1100 1010 00 5 10016 000000 10000 10010 10001 00000 100000 6 10020 000000 10001 10010 10010 00000 100010 7 10024 EXIT Figure 2. BNE e BEQ Exerc´ıcio 2
  • 6. Table 7. Linguagem Assembly Exerc´ıcio 2 Instr. End.Mem. Assembly M´aquina 1 10000 BEQ $s0, $s1, ELSE BEQ $16, $17, ELSE 2 10004 SUB $s2, $s0, $s1 SUB $18, $16, $17 3 10008 ADD $s0, $s1, $s2 ADD $16, $17, $18 4 10012 J EXIT J EXIT 5 10016 ELSE: SUB $s1, $s0, $s2 ELSE: SUB $17, $16, $18 6 10020 ADD $s2, $s1, $s2 ADD $18, $17, $18 7 10024 EXIT EXIT Table 8. Representac¸ ˜ao Exerc´ıcio 2 Instr. End.Mem. op rs rt rd shamt funct 1 10000 4 16 17 10016 2 10004 0 16 17 18 0 32 3 10008 0 17 18 16 0 34 4 10012 2 10024 5 10016 0 16 18 17 0 32 6 10020 0 17 18 18 0 34 7 10024 EXIT Table 9. C´odigo de M´aquina Exerc´ıcio 2 Instr. End.Mem. op rs rt rd shamt funct 1 10000 000100 10000 10001 0010 0111 0010 0000 2 10004 000000 10000 10001 10010 00000 100000 3 10008 000000 10001 10010 10000 00000 100010 4 10012 000010 0000 0000 0000 1001 1100 1010 00 5 10016 000000 10000 10010 10001 00000 100000 6 10020 000000 10001 10010 10010 00000 100010 7 10024 EXIT Table 10. Linguagem Exerc´ıcio 3 Instr. End.Mem. Assembly M´aquina 1 10000 SLT $t0, $s0, $s1 SLT $8, $16, $17 2 10004 BNE $t0, $zero, ELSE BNE $8, $0, 10020 3 10008 SUB $s2, $s0, $s1 SUB $18, $16, $17 4 10012 ADD $s0, $s1, $S2 ADD $16, $17, $18 5 10016 J EXIT J EXIT 6 10020 ELSE: SUB $s1, $s0, $s2 ELSE: SUB $17, $16, $18 7 10024 ADD $s2, $s1, $s2 ADD $16, $17, $18 8 10028 EXIT EXIT
  • 7. Figure 3. SLT e BNE Exerc´ıcio 3 Table 11. Representac¸ ˜ao Exerc´ıcio 3 Instr. End.Mem. op rs rt rd shamt funct 1 10000 0 16 17 8 0 42 2 10004 5 8 0 10020 3 10008 0 16 17 18 0 34 4 10012 0 17 18 16 0 32 5 10016 2 10028 6 10020 0 16 18 17 0 34 7 10024 0 17 18 18 0 32 8 10028 EXIT
  • 8. Table 12. C´odigo de M´aquina Exerc´ıcio 3 Instr. End.Mem. op rs rt rd shamt funct 1 10000 000000 10000 10001 0010 0111 0010 0100 2 10004 000101 01000 00000 0010 0111 0010 0100 3 10008 000000 10000 10001 10010 00000 100010 4 10012 000000 10001 10010 10000 00000 100000 5 10016 000010 0000 0000 0000 1001 1100 1100 00 6 10020 000000 10000 10010 10001 00000 100010 7 10024 000000 10001 10010 10010 00000 100000 8 10028 EXIT Figure 4. BNE e BEQ Exerc´ıcio 4
  • 9. Table 13. Linguagem Exerc´ıcio 4 Instr. End.Mem. Assembly M´aquina 1 10000 SLT $t0, $s0, $s1 SLT $8, $16, $17 2 10004 BEQ $t0, $zero, ELSE BEQ $8, $0, 10016 3 10008 ADD $s2, $s0, $s1 ADD $18, $16, $17 4 10012 SUB $s0, $s1, $S2 SUB $16, $17, $18 5 10016 J EXIT J EXIT 6 10020 ELSE: ADD $s1, $s0, $s2 ELSE: ADD $17, $16, $18 7 10024 SUB $s2, $s1, $s2 SUB $16, $17, $18 8 10028 EXIT EXIT Table 14. Representac¸ ˜ao Exerc´ıcio 4 Instr. End.Mem. op rs rt rd shamt funct 1 10000 0 16 17 8 0 42 2 10004 4 8 0 10020 3 10008 0 16 17 18 0 34 4 10012 0 17 18 16 0 32 5 10016 2 10028 6 10020 0 16 18 17 0 34 7 10024 0 17 18 18 0 32 8 10028 EXIT Table 15. C´odigo Exerc´ıcio 4 Instr. End.Mem. op rs rt rd shamt funct 1 10000 000000 10000 10001 0010 0111 0010 0100 2 10004 000100 01000 00000 0010 0111 0010 1100 3 10008 000000 10000 10001 10010 00000 100010 4 10012 000000 10001 10010 10000 00000 100000 5 10016 000010 0000 0000 0000 1001 1100 1011 00 6 10020 000000 10000 10010 10001 00000 100010 7 10024 000000 10001 10010 10010 00000 100000 8 10028 EXIT Figure 5. Calculando Deslocamentos Artigo 10
  • 10. Table 16. Linguagem Artigo 10 Assembly M´aquina 1 SRL $t0, $s0, 8 SRL $8, $16, 8 2 SLL $t1, $s1, 4 SLL $9, $17, 4 Table 17. Representac¸ ˜ao Artigo 10 op rs rt rd shamt funct 1 0 0 16 8 8 2 2 0 0 17 9 4 0 Table 18. C´odigo Artigo 10 op rs rt rd shamt funct 1 000000 000000 010010 001000 001000 000010 2 000000 000000 010001 001001 000100 000000 Figure 6. Calculando AND Artigo 11 Table 19. Linguagem Artigo 11 Assembly M´aquina 1 AND $t0, $t1, $t2 AND $8, $9, $10 Table 20. Representac¸ ˜ao Artigo 11 op rs rt rd shamt funct 1 0 9 10 8 0 36 Table 21. C´odigo Artigo 11 op rs rt rd shamt funct 1 000000 001001 001010 001000 000000 100100 Table 22. Linguagem Artigo 12 Assembly M´aquina 1 OR $t0, $t1, $t2 OR $8, $9, $10
  • 11. Figure 7. Calculando OR Artigo 12 Table 23. Representac¸ ˜ao Artigo 12 op rs rt rd shamt funct 1 0 9 10 8 0 37 Table 24. C´odigo Artigo 12 op rs rt rd shamt funct 1 000000 001001 001010 001000 000000 100101 Figure 8. Calculando NOT Artigo 13 Table 25. Linguagem Artigo 13 Assembly M´aquina 1 NOT $t0, $t1, $zero NOT $8, $9, $0 Table 26. Representac¸ ˜ao Artigo 13 op rs rt rd shamt funct 1 0 9 0 8 0 39
  • 12. Table 27. C´odigo Artigo 13 op rs rt rd shamt funct 1 000000 001001 00000 001000 000000 100111 Table 28. Linguagem Artigo 16 Instr. End.Mem. Assembly M´aquina 1 10000 SLL $t1, $s3, $2 SLL $8, $19, $2 2 10004 ADD $t0, $t1, $s2 ADD $9, $9, $17 3 10008 LW $t2, 0($1) LW $10, 0($9) 4 10012 ADD $s0, $s1, $t2 ADD $16, $17, $10 Table 29. Representac¸ ˜ao Artigo 16 Instr. End.Mem. op rs rt rd shamt funct 1 10000 0 19 9 2 0 0 2 10004 0 17 9 0 0 32 3 10008 35 9 0 18 4 10012 0 10 16 16 0 32 Table 30. C´odigo Artigo 16 Instr. End.Mem. op rs rt rd shamt funct 1 10000 000000 010011 001001 000010 000000 000000 2 10004 000000 010001 001001 000000 000000 100000 3 10008 100011 001001 000000 0000 0000 0000 000000 4 10012 000000 001010 010000 010000 000000 100000