Questions
Write a MIPS assembly language program that implements the following pseudo-code operation: result = x +...

Write a MIPS assembly language program that implements the following pseudo-code operation:

result = x + y – z + A[j]

x and y should be in reserved memory words using the .word directive and labeled as x and y. Initialize x=10 and y=200.

Read in z from the console. Input the value -8. This is the value for z, not for –z. Store this value in memory with the label z. To begin, you could just initialize z to a value using .word directive and test your code.

Read in j from the console. The value of j should be in the range [0, 3]. Input the value 2. You do not need to check j for the proper range on input.

Reserve 4 words in memory for A with the label A. Assume A is referenced starting at A[0]. Initialize these 4 words to: 4, 9, 15, 20. E.g.,:

   A: .word 4, 9, 15, 20

Which number is A[j]? In order to get an element, you will need the load address instruction, which loads the address of a label into a register. E.g., to load the starting address of label A, A[0], into $t0, you would do the following:

           la $t0, A

You can then use $t0 as an address in the normal way for an lw or sw instruction, as needed.

Store the final result in a reserved memory word labeled result.

Your final data section might look like this:

         .data

x: .word 10

y: .word 200

z: .word 0

A: .word 4, 9, 15, 20

result: .word 0

prf: .asciiz "The result is: " #String for printing

crlf: .asciiz "\n" #For printing a cr/lf

Output the result to the console prefixed by a string that reads (without the quotes):

"The result is: "

The result should follow this string on the same line. E.g., the output to the console might be:

The result is: 5768

Check your data segment to be sure values are stored appropriately. Only the memory locations for z and result should be changed from initial values.

In: Computer Science

How many generations of peacekeeping operations has the UN created since 1945? how many do you...

How many generations of peacekeeping operations has the UN created since 1945? how many do you consider successful and why? must be 750 words and not word to word from google

In: Economics

( USE C++ ) The program prompts the user to enter a word. The program then...

( USE C++ ) The program prompts the user to enter a word. The program then prints out the word with letters in backward order. For example, if the user enter "hello" then the program would print "olleh"
show that it works .

In: Computer Science

how do I copy my word data to excel I typed my report on word document...

how do I copy my word data to excel

I typed my report on word document and would like to copy them on excel 2013 in other to add table and graph

In: Math

Chapter Name: Handmaid of ethics: Corporate Social Responsibility Creative Question: (Some question have a requirements which...

Chapter Name: Handmaid of ethics: Corporate Social Responsibility

Creative Question: (Some question have a requirements which is give with the question)

  1. Why social responsibility of business in CSR?- Explain in your own word. ( Requirement: You must include in this topic :Accountability to society and Corporations’ debt to society) .Explain in your own word about The Classical Economic Model & The Socioeconomic Model. Explain in your own word about implementation of CSR.

In: Economics

Exercise 3 – Strings Using a function Write a program that prompts the user to enter...

Exercise 3 – Strings

Using a function Write a program that prompts the user to enter two inputs: some text and a word. The program outputs the starting indices of all occurrences of the word in the text. If the word is not found, the program should output “not found”.

Example1:

Input1: my dog and myself are going to my friend

Input2: my

Output: 0 11 31

Example 2:

Input1: Programming is fun

Input 2: my

Output: not found

In: Computer Science

Recognizing partitions - sets of strings. (b) Let A be the set of words in the...

Recognizing partitions - sets of strings.

(b) Let A be the set of words in the Oxford English Dictionary (OED). For each positive integer j, define Aj to be the set of all words with j letters in the OED. For example, the word "discrete" is an element of A8 because the word "discrete" has 8 letters. The longest word in the OED is "pneumonoultramicroscopicsilicovolcanoconiosis" which has 45 letters. You can assume that for any integer i in the range 1 through 45, there is at least one word in the OED that has i letters. Do the sets A1, …, A45 form a partition of the set of words in the OED?

(don't give explanation with reflexive, symmetric and transitive because we haven't learn it yet)

In: Advanced Math

Grammar Check! "I never said she stole my money." Did you know that this sentence changes...

Grammar Check! "I never said she stole my money." Did you know that this sentence changes its meaning depending on which word you stress? Practice your grammar skills by stressing each word in the sentence; notice how the part of speech stressed affects the meaning of the sentence. Which word did you stress first? What meaning does that sentence have? Which word is the most awkward for you to stress? What meaning does THAT sentence have? For your peer responses this week, comment on at least two of your fellow learner's posts as to how you feel about their interpretation, and whether you feel similarly or differently.

In: Nursing

Write a recursive method that takes a String argument and recursively prints out each word in...

Write a recursive method that takes a String argument and recursively prints out each word in the String on a different line.

Note: You will need to use methods such as indexOf() and substring() within the String class to identify each word and the remaining string.

For example, if the input was “the cat purred”, then the method would print the following to the Java console:

the
cat
purred

Challenge Problem

Write a recursive method that takes a string as an input and returns a boolean value that tells you whether the string is a palindrome. A palindrome is a word/sentence that when read backwards is the same as the original word/sentence.

Some example palindromes: “civic”, “radar”, “deleveled”, “a man, a plan, a canal: Panama” (ignore the punctuation)

PreviousNext

In: Computer Science

A software company is trying to use Bayes Theorem and other rules of probability to develop...

  1. A software company is trying to use Bayes Theorem and other rules of probability to develop an algorithm that can effectively filter out spam emails. The company’s software developers carefully examined a random sample of 5,000 emails received by its employees and found out that 1200 of the emails were spam. A closer look at the spam emails revealed that 300 of them contained the word ‘free’ in the subject line. On the other hand, only 228 of the non-spam emails had the word ‘free’ in their subject line. Please answer the following questions based on the given information
  2. What is the probability that a random email will be a spam and will not contain the word ‘free’ in its subject line? Please show your work.                           [2 points
  3. If the word ‘free’ does not appear in the subject line of an email, what is the probability that the email is not a spam? Please show work.                  [2 points]
  4. What is the probability that a random email will be neither a spam and nor will contain the word ‘free’ in its subject line? Please show your work.         [2 points]          
  5. Are an email being a spam and its subject line containing the word ‘free’ independent events? Please show how you arrived at your answer.      [1 point]

In: Statistics and Probability