SlideShare a Scribd company logo
1 of 2
Download to read offline
4. The size of instructions can be fixed or variable. What are advantage and disadvantage of
fixed compared to variable? point) eft 2 20 0 C-4131-28 Add suction 131-26 nvaction 125-2 PC
egister daiess mancion 120-16 date 1 regnter 2 nstructien 31-00 eg stcrs Read U ALLu dela tlata
dvts 02 rstend In the above figure (single-cycle implementation), current instruction is SW S1,
4(S2) (SW: Store Word; current addrss for this instruction is 100 in decimal; S1 and $2 are
initially 8). For redundancy, you should write "X" instead of 0 or . You should write the reason
for cach question as well. 5. What is the value of RegDst? (1 point) 6. What is the value of
RegWrite? (I point) 7. What is the value after sign-extension? 1 point) 8. What is the value of
MemRead? (1 point) 9. What is the value of MemtoReg? (1 point) In the above figure, current
instruction is ADDI $1. S2, #-1(which is minus l) (ADDI is ADD Immediate; current address for
this instruction s 100 in decimal and S2 are initially1). For redundancy, you should write “X',
instead of 0 or 1 . You should write the reason for each question as well. 10. What is the value
(immediate value) of instruction [15-0)? Write the value in 6-bit binary (1 point) 11. What is the
value after sign extension? Write the value in 32-bit binary. (I point) 12. What is the value of
Reg Write? (1 point) 13. What is the value of MemtoReg? (1 point) 2/4
Solution
import java.util.AbstractSet; import java.util.Arrays; import java.util.Iterator; import
java.util.NoSuchElementException; /** * Implementation of an abstract set using an array-
based binary tree. This is * used to help teach binary tree's and will have more details explained
in * future lectures. * * @author William J. Collins * @author Matthew Hertz * @param
Data type (which must be Comparable) of the elements in this tree. */ public class
ArrayBinaryTree> extends AbstractSet { /** Entry in the data store where the root node can be
found. */ private static final int ROOT = 0; /** Array used to store the nodes which consist of
this binary tree. */ protected Node[] store; /** Number of elements within the tree. */
protected int size; /** * Initializes this ArrayBinaryTree object to be empty. This creates the
array * in which items will be stored. */ @SuppressWarnings("unchecked") public
ArrayBinaryTree() { store = new Node[63]; size = 0; } /** * Initializes this
ArrayBinaryTree object to contain a shallow copy of a * specified ArrayBinaryTree object.
The worstTime(n) is O(n), where n is the * number of elements in the specified
ArrayBinaryTree object. * * @param otherTree The tree which will be copied to create our
new tree, */ @SuppressWarnings("unchecked") public ArrayBinaryTree(ArrayBinaryTree
otherTree) { store = (Node[]) Arrays.copyOf(otherTree.store, otherTree.store.length); size =
otherTree.size; } public int countLeaves() { } /** * Returns the size of this
ArrayBinaryTree object. * * @return the size of this ArrayBinaryTree object. */
@Override public int size() { return size; } /** * Returns an iterator that will return the
elements in this ArrayBinaryTree, * but without any specific ordering. * * @return Iterator
positioned at the smallest element in this ArrayBinaryTree * object. */ @Override
public Iterator iterator() { return new ArrayTreeIterator(); } /** * Determines if there is at
least one element in this ArrayBinaryTree object * that equals a specified element. The
worstTime(n) is O(n) and * averageTime(n) is O(log n). * * @param obj - the element
sought in this ArrayBinaryTree object. * @return true - if there is an element in this
ArrayBinaryTree object that * equals obj; otherwise, return false. * @throws
ClassCastException - if obj cannot be compared to the elements in * this
ArrayBinaryTree object. * @throws NullPointerException - if obj is null. */ @Override
public boolean contains(Object obj) { return getEntry(obj) != null; } /** * Ensures that
this ArrayBinaryTree object contains a specified element. The * worstTime(n) is O(n) for this
addition. * * @param element Element we want to be certain is contained within this *
ArrayBinaryTree * @return True if the element had not been in ArrayBinaryTree and so was
just * added; false if the element was already in the ArrayBinaryTree and * so did
not need to be added or was null and so cannot be added. */ @Override public boolean
add(E element) { // Null objects cannot be added to this Collection if (element == null) {
return false; } // Handle the easy case when the tree has no elements if (isEmpty()) {
Node root = new Node(element, ROOT); store[ROOT] = root; size++ ; return true;
} // Handle the most common case -- adding the element to the end of the tree. else { int
idx = ROOT; // Find the location where this element should be added in the tree while
(true) { int comp = element.compareTo(store[idx].element); // The Set ADT definition
only allows the Collection to contain a single // copy of an element; if this element had been
previously added, we // should just return false if (comp == 0) { return false;
} // If it is smaller, we should traverse to the left child else if (comp < 0) { idx =
(idx * 2) + 1; } // Otherwise it must be larger, so we should traverse to the right child
else { idx = (idx * 2) + 2; } // When the array is not large enough to hold the
new element at the // location at which it needs to be added

More Related Content

Similar to 4. The size of instructions can be fixed or variable. What are advant.pdf

Please write in C++ and should be able to compile and debug.Thank yo.pdf
Please write in C++ and should be able to compile and debug.Thank yo.pdfPlease write in C++ and should be able to compile and debug.Thank yo.pdf
Please write in C++ and should be able to compile and debug.Thank yo.pdfajaycosmeticslg
 
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docxAssg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docxfestockton
 
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdfAssignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdfFootageetoffe16
 
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdfpetercoiffeur18
 
In this lab, you will be given a simple code for a min Heap, and you.pdf
In this lab, you will be given a simple code for a min Heap, and you.pdfIn this lab, you will be given a simple code for a min Heap, and you.pdf
In this lab, you will be given a simple code for a min Heap, and you.pdfcharanjit1717
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfaksahnan
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdframbagra74
 
For the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdfFor the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdfxlynettalampleyxc
 
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdf
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdfPlease Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdf
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdfajaycosmeticslg
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
 
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docx
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docxAssg 12 Binary Search TreesCOSC 2336 Spring 2019April.docx
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docxfestockton
 
Given the following class in Java- public class ThreeTenDynArray-T- {.pdf
Given the following class in Java-  public class ThreeTenDynArray-T- {.pdfGiven the following class in Java-  public class ThreeTenDynArray-T- {.pdf
Given the following class in Java- public class ThreeTenDynArray-T- {.pdfNicholasflqStewartl
 
Given the following errors and class in Java- How are these errors fix.pdf
Given the following errors and class in Java- How are these errors fix.pdfGiven the following errors and class in Java- How are these errors fix.pdf
Given the following errors and class in Java- How are these errors fix.pdfNicholasflqStewartl
 
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfAnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfnipuns1983
 
Help please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdfHelp please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdfjyothimuppasani1
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfinfo430661
 
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdf
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdfpackage com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdf
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdfaptind
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfinfo309708
 
Use the following data set that compares age to average years lef.docx
Use the following data set that compares age to average years lef.docxUse the following data set that compares age to average years lef.docx
Use the following data set that compares age to average years lef.docxdickonsondorris
 
Modify this code to do an Insert function for an AVL tree, instead o.pdf
Modify this code to do an Insert function for an AVL tree, instead o.pdfModify this code to do an Insert function for an AVL tree, instead o.pdf
Modify this code to do an Insert function for an AVL tree, instead o.pdffathimaoptical
 

Similar to 4. The size of instructions can be fixed or variable. What are advant.pdf (20)

Please write in C++ and should be able to compile and debug.Thank yo.pdf
Please write in C++ and should be able to compile and debug.Thank yo.pdfPlease write in C++ and should be able to compile and debug.Thank yo.pdf
Please write in C++ and should be able to compile and debug.Thank yo.pdf
 
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docxAssg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
Assg 12 Binary Search Trees COSC 2336assg-12.cppAssg 12 Binary .docx
 
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdfAssignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
Assignment 9 (Parent reference for BST) Redefine TreeNode by adding .pdf
 
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
1)(JAVA) Extend the Binary Search Tree ADT to include a public metho.pdf
 
In this lab, you will be given a simple code for a min Heap, and you.pdf
In this lab, you will be given a simple code for a min Heap, and you.pdfIn this lab, you will be given a simple code for a min Heap, and you.pdf
In this lab, you will be given a simple code for a min Heap, and you.pdf
 
So I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdfSo I have this code(StackInAllSocks) and I implemented the method but.pdf
So I have this code(StackInAllSocks) and I implemented the method but.pdf
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
 
For the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdfFor the code below complete the preOrder() method so that it perform.pdf
For the code below complete the preOrder() method so that it perform.pdf
 
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdf
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdfPlease Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdf
Please Write in CPP.Thank youCreate a class called BinaryTreeDeque.pdf
 
ReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdfReversePoem.java ---------------------------------- public cl.pdf
ReversePoem.java ---------------------------------- public cl.pdf
 
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docx
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docxAssg 12 Binary Search TreesCOSC 2336 Spring 2019April.docx
Assg 12 Binary Search TreesCOSC 2336 Spring 2019April.docx
 
Given the following class in Java- public class ThreeTenDynArray-T- {.pdf
Given the following class in Java-  public class ThreeTenDynArray-T- {.pdfGiven the following class in Java-  public class ThreeTenDynArray-T- {.pdf
Given the following class in Java- public class ThreeTenDynArray-T- {.pdf
 
Given the following errors and class in Java- How are these errors fix.pdf
Given the following errors and class in Java- How are these errors fix.pdfGiven the following errors and class in Java- How are these errors fix.pdf
Given the following errors and class in Java- How are these errors fix.pdf
 
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfAnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
 
Help please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdfHelp please!!(Include your modified DList.java source code file in.pdf
Help please!!(Include your modified DList.java source code file in.pdf
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdf
 
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdf
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdfpackage com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdf
package com.java2novice.ds.linkedlist;import java.util.NoSuchEleme.pdf
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
Use the following data set that compares age to average years lef.docx
Use the following data set that compares age to average years lef.docxUse the following data set that compares age to average years lef.docx
Use the following data set that compares age to average years lef.docx
 
Modify this code to do an Insert function for an AVL tree, instead o.pdf
Modify this code to do an Insert function for an AVL tree, instead o.pdfModify this code to do an Insert function for an AVL tree, instead o.pdf
Modify this code to do an Insert function for an AVL tree, instead o.pdf
 

More from mumnesh

Poisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdfPoisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdfmumnesh
 
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdfProblem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdfmumnesh
 
One of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdfOne of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdfmumnesh
 
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdfMalpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdfmumnesh
 
In JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdfIn JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdfmumnesh
 
How does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdfHow does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdfmumnesh
 
Hi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdfHi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdfmumnesh
 
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdf
For which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdfFor which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdf
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdfmumnesh
 
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdf
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdfFor Programming Embedded SystemsQ-07 Whcih variable and condition.pdf
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdfmumnesh
 
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdfFor analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdfmumnesh
 
Fill in the blank. A contingency table relates only continuous rando.pdf
Fill in the blank. A contingency table relates  only continuous rando.pdfFill in the blank. A contingency table relates  only continuous rando.pdf
Fill in the blank. A contingency table relates only continuous rando.pdfmumnesh
 
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdfDiscuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdfmumnesh
 
Complete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdfComplete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdfmumnesh
 
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdfCommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdfmumnesh
 
Based on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdfBased on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdfmumnesh
 
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdfAnswer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdfmumnesh
 
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdfAbraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdfmumnesh
 
29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdf29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdfmumnesh
 
14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdfmumnesh
 
13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdf13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdfmumnesh
 

More from mumnesh (20)

Poisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdfPoisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdf
 
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdfProblem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
 
One of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdfOne of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdf
 
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdfMalpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
 
In JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdfIn JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdf
 
How does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdfHow does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdf
 
Hi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdfHi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdf
 
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdf
For which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdfFor which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdf
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdf
 
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdf
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdfFor Programming Embedded SystemsQ-07 Whcih variable and condition.pdf
For Programming Embedded SystemsQ-07 Whcih variable and condition.pdf
 
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdfFor analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
 
Fill in the blank. A contingency table relates only continuous rando.pdf
Fill in the blank. A contingency table relates  only continuous rando.pdfFill in the blank. A contingency table relates  only continuous rando.pdf
Fill in the blank. A contingency table relates only continuous rando.pdf
 
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdfDiscuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
 
Complete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdfComplete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdf
 
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdfCommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
 
Based on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdfBased on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdf
 
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdfAnswer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
 
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdfAbraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
 
29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdf29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdf
 
14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf
 
13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdf13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdf
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 

4. The size of instructions can be fixed or variable. What are advant.pdf

  • 1. 4. The size of instructions can be fixed or variable. What are advantage and disadvantage of fixed compared to variable? point) eft 2 20 0 C-4131-28 Add suction 131-26 nvaction 125-2 PC egister daiess mancion 120-16 date 1 regnter 2 nstructien 31-00 eg stcrs Read U ALLu dela tlata dvts 02 rstend In the above figure (single-cycle implementation), current instruction is SW S1, 4(S2) (SW: Store Word; current addrss for this instruction is 100 in decimal; S1 and $2 are initially 8). For redundancy, you should write "X" instead of 0 or . You should write the reason for cach question as well. 5. What is the value of RegDst? (1 point) 6. What is the value of RegWrite? (I point) 7. What is the value after sign-extension? 1 point) 8. What is the value of MemRead? (1 point) 9. What is the value of MemtoReg? (1 point) In the above figure, current instruction is ADDI $1. S2, #-1(which is minus l) (ADDI is ADD Immediate; current address for this instruction s 100 in decimal and S2 are initially1). For redundancy, you should write “X', instead of 0 or 1 . You should write the reason for each question as well. 10. What is the value (immediate value) of instruction [15-0)? Write the value in 6-bit binary (1 point) 11. What is the value after sign extension? Write the value in 32-bit binary. (I point) 12. What is the value of Reg Write? (1 point) 13. What is the value of MemtoReg? (1 point) 2/4 Solution import java.util.AbstractSet; import java.util.Arrays; import java.util.Iterator; import java.util.NoSuchElementException; /** * Implementation of an abstract set using an array- based binary tree. This is * used to help teach binary tree's and will have more details explained in * future lectures. * * @author William J. Collins * @author Matthew Hertz * @param Data type (which must be Comparable) of the elements in this tree. */ public class ArrayBinaryTree> extends AbstractSet { /** Entry in the data store where the root node can be found. */ private static final int ROOT = 0; /** Array used to store the nodes which consist of this binary tree. */ protected Node[] store; /** Number of elements within the tree. */ protected int size; /** * Initializes this ArrayBinaryTree object to be empty. This creates the array * in which items will be stored. */ @SuppressWarnings("unchecked") public ArrayBinaryTree() { store = new Node[63]; size = 0; } /** * Initializes this ArrayBinaryTree object to contain a shallow copy of a * specified ArrayBinaryTree object. The worstTime(n) is O(n), where n is the * number of elements in the specified ArrayBinaryTree object. * * @param otherTree The tree which will be copied to create our new tree, */ @SuppressWarnings("unchecked") public ArrayBinaryTree(ArrayBinaryTree otherTree) { store = (Node[]) Arrays.copyOf(otherTree.store, otherTree.store.length); size = otherTree.size; } public int countLeaves() { } /** * Returns the size of this ArrayBinaryTree object. * * @return the size of this ArrayBinaryTree object. */ @Override public int size() { return size; } /** * Returns an iterator that will return the
  • 2. elements in this ArrayBinaryTree, * but without any specific ordering. * * @return Iterator positioned at the smallest element in this ArrayBinaryTree * object. */ @Override public Iterator iterator() { return new ArrayTreeIterator(); } /** * Determines if there is at least one element in this ArrayBinaryTree object * that equals a specified element. The worstTime(n) is O(n) and * averageTime(n) is O(log n). * * @param obj - the element sought in this ArrayBinaryTree object. * @return true - if there is an element in this ArrayBinaryTree object that * equals obj; otherwise, return false. * @throws ClassCastException - if obj cannot be compared to the elements in * this ArrayBinaryTree object. * @throws NullPointerException - if obj is null. */ @Override public boolean contains(Object obj) { return getEntry(obj) != null; } /** * Ensures that this ArrayBinaryTree object contains a specified element. The * worstTime(n) is O(n) for this addition. * * @param element Element we want to be certain is contained within this * ArrayBinaryTree * @return True if the element had not been in ArrayBinaryTree and so was just * added; false if the element was already in the ArrayBinaryTree and * so did not need to be added or was null and so cannot be added. */ @Override public boolean add(E element) { // Null objects cannot be added to this Collection if (element == null) { return false; } // Handle the easy case when the tree has no elements if (isEmpty()) { Node root = new Node(element, ROOT); store[ROOT] = root; size++ ; return true; } // Handle the most common case -- adding the element to the end of the tree. else { int idx = ROOT; // Find the location where this element should be added in the tree while (true) { int comp = element.compareTo(store[idx].element); // The Set ADT definition only allows the Collection to contain a single // copy of an element; if this element had been previously added, we // should just return false if (comp == 0) { return false; } // If it is smaller, we should traverse to the left child else if (comp < 0) { idx = (idx * 2) + 1; } // Otherwise it must be larger, so we should traverse to the right child else { idx = (idx * 2) + 2; } // When the array is not large enough to hold the new element at the // location at which it needs to be added