Program using a loop that multiplies two non-negative number

Assignment Help Basic Computer Science
Reference no: EM131048748

1. Write a MARIE program using a loop that multiplies two non-negative numbers by using repeated addition. For example, to multiply 3 x 6, the program would add 3 six times (e.g. 3 + 3 + 3 + 3 + 3 + 3) or add 6 three times (e.g. 6+6+6). You should write and run the program using MARIE simulator. Also write the code with Address, Instruction, and Comments .

2. You are designing an instruction set for your computer. All the instructions are of same size (11 bits long). The size of an address field is 4 bits. You have already designed five 2-address instructions and 40 1-address instructions. How many 0-address instructions can still you can fit? Justify your answer.

3. Write code to implement the expression: A= (B + C) * (D - E) on 3-, 2-, 1- and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands.

Reference no: EM131048748

Questions Cloud

Number of warehouses closer to the end customer : Consider a firm redesigning its logistics network. What are the advantages to having a small number of centrally located warehouses. What are the advantages to having a larger number of warehouses closer to the end customer?
Which ones are equivalent : Are there any states that could be collapsed withoutchanging the result of any game? If so, which ones are equivalent?
Improve organizational performance : How do enterprise applications, collaboration and communication systems, and intranets improve organizational performance? Give examples to illustrate your answer.
A tropical rain forest affect the forest : Logging in the rain forest: contrasts. Figure 29.2 (page 29-5) gives basic ANOVA output for the study of the effects of logging described in Example 29.1. We might describe the overall effect of logging by comparing the mean species count for unlo..
Program using a loop that multiplies two non-negative number : Write code to implement the expression: A= (B + C) * (D - E) on 3-, 2-, 1- and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands.
Analyse house prices against all other variables : Analyse house prices against all other variables included in the dataset. Use appropriate descriptive techniques such as cross-tabulations, comparative summary measures, scatter diagrams to identify key relationships
Program that asks the user for the month and a positive n : Write a program that asks the user for the month (April, May, or June) and a positive integer n. Your program should then print two types of results. The first should report the title of the first movie that has first been rented (scanned) n times..
Learn test through short logical assessment : James and Jennifer Stolpa and their five-month old kid, Clayton, were stranded outside in a snowstorm for right around 8 days. These types of individuals were spared after James left Jennifer and Clayton in a natural hollow and climbed 31 mills in..
Accused of using non-job-related criteria : Many employers are accused of using non-job-related criteria in hiring decisions. The best management practice for an employer to use in refuting this type of allegation would mos likely be:

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Explaining sites appropriate for mobile devices

What do you think are some of the types of sites that would be appropriate for mobile devices? What types of sites do you think are inappropriate?

  Encryption could assist in addressing some of the current ch

From the e-Activity and your own research, give your opinion of the two (2) most important ways that you believe encryption could assist in addressing some of the current challenges facing organizations today, and explain why these solutions are so i..

  Discuss the different reasons for terminating a process

discuss the different reasons for terminating a process and the commands used for this purpose.

  Function definitions

C++ problem.   Hi there,  I am having problems figuring out my lnk2019 error. below is my code.  I am using visual studio 2012 premium. // Week 5 Assignment-1// Description: correct 8 errors

  Utilize a constant called taxrate to hold the tax rate

Program should read in a file called "sales.txt". The contents of the text file are below. Read in all data from the file. Sore units in integers and store sales in doubles.The first integer is the first unit sales. The first double is the first $ o..

  Which of the following linux distros are based on debian

Which of the following Linux distros are based on debian?

  Underlying array structure

Ef?ciently implement a queue class using a circular array. You may use a vector (rather than a primitive array) as the underlying array structure.

  Designing a corporate network

Design a network that connects the four offices of XYZ by wide area links. The company has users in three different departments, each of which has different security and resource requirements. However, each of the physical offices has some users from..

  Writing a homework using functions to get a list of integers

Writing a homework using functions to get a list of integers from a user and then find statistics of the given list of integers. You are not allowed to use any built in functions for finding the calculations in this assignment.

  Why the fto you selected would find this target valuable

present a recovery plan in the event such an attack is successful: (address any and all applicable DHS organizations within the DHS umbrella and the role they will play)

  Write a program to sum the odd integers

Write a program that uses while statement to calculate average of several integers. Assuming the last value read is the sentinel 9999. For example, the sequence 10 8 11 7 9 9999 indicates that the program should calculate the average of all the va..

  What purposes do cpus, memory and i-o devices

What purposes do CPUs, memory and I-O devices individually serve in a computer system

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd