Write code to implement the expression

Assignment Help Data Structure & Algorithms
Reference no: EM13327119

1. Convert the following expression in postfix (reverse Polish notation). Remember the rules of precedence for arithmetic operators. To get full credit, you need to show all work done. i.e. sample snapshot of the stack

X = A - B + C * (D * E - F) / (G + H * K)

2. Show how the following values would be stored by machines with 32-bit words, using little endian and big endian format. Assume each value starts at address 016. Draw a diagram of memory for each, placing the appropriate values in the correct (and labeled) memory locations.

a. 0123456816

b. 0000112216

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. Show all instructions.

4. A digital computer has a memory unit with 32 bits per word. The instruction set consists of 128 different operations. All instructions have an operations code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory.

a. How many bits are needed for the opcode?

b. How many Bits are left for the address part of the instruction?

c. What is the maximum allowable size for memory?

5. Write the following code segment in MARIE's assembly language:

if X > 1 then
Y = X + X;
X = 0;
endif;
Y = Y + 1;

6. Write a MARIE subroutine to subtract two numbers.

Reference no: EM13327119

Questions Cloud

How to compute the required rate of return : Russo's Gas Distributor, Inc. wants to determine the required return on a stock with a beta coefficient of 0.5. Assuming the risk free rate of 6 percent and the market return of 12 percent.
The opportunity cost of purchasing the textbook is the phone : You have a choice between spending $195 on a new biology textbook or purchasing a new 3G smart phone. The opportunity cost of purchasing the textbook is the phone.
Calculate the certainty equivalent cash flow for year 4 : A project has an expected risky cash flow of $500, in year 4. The risk-free rate is 4%, the market rate of return is 13%, and the project's beta is 1.2. Calculate the certainty equivalent cash flow for year 4.
How much work is the roping doing on the sledge : A sledge loaded with bricks has a total mass of 17.1 kg and is pulled at constant speed by a rope inclined at 19.9° above the horizontal. how much work is the roping doing on the sledge
Write code to implement the expression : 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. Show all instructions.
Find the magnitude of the average stopping force : A man of mass 91 kg drops to a concrete patio from a window 0.63 m above the patio. What is the magnitude of the average stopping force exerted on him by the patio
A sinusoidal power system : Non-essential electrical loads have been secured and the remaining electrical loads are required to be operating 24 hours a day. What are some of the measures you can take to reduce the overall warehouse power consumption? Can 100% efficiency e..
What is present value of the payment to be recieved : I expect a payment of $104 one year from now. My discount rate is 4%. What is present value of the payment to be recieved? How much if 5%?
What is the force of the chair seat on you : a ferris wheel has a radius of 11.0 m and rotates once every 11 s, what is the force of the chair seat on you

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Propose an efficient data structure

Propose an efficient data structure that may hold the tour operator's data using a normalization process. Describe each step of the process that will enable you to have a 2nd Normal Form data structure.

  An independent set in a graph g

An independent set in a graph G is a set of vertices I in G such that no two vertices in I are adjacent (neighbors). The maximum independent set problem is, given a graph G, to compute an independent set of maximum size (maximum number of vertices) i..

  Explaining playout delay algorithm

Let the adaptive playout delay algorithm. Show through simple example that adjusting playout delay at beginning of each talk.

  Finding page faults for lru replacement algorithms

How many page faults would happen for the given replacement algorithms, assuming one, two, three, and four frames?

  Find out the big-o running time of bubble sort

Find out the big-O running time (tight bound) of bubble sort. Illustrtae your derivation. Count comparisons as critical operation.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Data warehouse and operational databases

Every big organization has large documents or databases containing data used in operating the business. Does a data warehouse differ from these operational files or databases?

  Singly linked list

Singly Linked List (SLL)Introduce a SLL class with the following functions. Please also introduce a main function that will invoke and verify whether the functions are implemented correctly

  Opens an output file with the external name

Design an algorithm that does the following: opens an output file with the external name number_list.dat, uses a loop to write the numbers 1 through 100 to the file and then closes the file.

  Display the dfs starting from a specified vertex

Design and implement a driver to show the following (check for 2 graphs; 1 is provided, including the starting vertex):Display the dfs starting from a specified vertex;Display the discovery/finishing time for each node in the graph;Show the Parenthes..

  Find shortest path tree by bellman-ford-dijkstra algorithm

Find the shortest path tree from every node to node 1for the graph of following figure using Bellman-Ford and Dijkstra algorithm.

  Explaining diffie-hellman public-key algorithm

Use the Diffie-Hellman public-key algorithm to exchange secret keys.

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