Question

In: Computer Science

Write a microprogramming for this operation using one - address, two - address, and three -...

Write a microprogramming for this operation using one - address, two - address, and three - address? Y = (A * B) -(CD)

I need the answer as soon as possible

Solutions

Expert Solution

One Address Instructions –
This use a implied ACCUMULATOR register for data manipulation.One operand is in accumulator and other is in register or memory location.Implied means that the CPU already know that one operand is in accumulator so there is no need to specify it.

Expression: Y = (A*B)-(CD)
AC is accumulator
M[ ] is any memory location
M[T] is temporary location

LOAD A // AC = M[A]

MUL B // AC = AC * M[B]

STORE T1 // M[T1] = AC

LOAD C // AC = M[C]

MUL D // AC = AC * M[D]

STORE T2 // M[T2] = AC

LOAD T1 // AC = M[T1]

SUB T2 // AC = AC - M[T2]

STORE Y // M[Y] = AC

Two Address Instructions –
This is common in commercial computers.Here two address can be specified in the instruction.Unlike earlier in one address instruction the result was stored in accumulator here result cab be stored at different location rather than just accumulator, but require more number of bit to represent address.

Here destination address can also contain operand.

Expression: Y = (A*B)-(CD)
R1, R2 are registers
M[] is any memory location

MOV R1, A // R1 = M[A]

MUL R1, B // R1 = R1 * M[B]

MOV R2, C // R2 = C

MUL R2, D // R2 = R2 * D

SUB R1, R2 // R1 = R1 - R2

MOV Y, R1 // M[Y] = R1

Three Address Instructions –
This has three address field to specify a register or a memory location. Program created are much short in size but number of bits per instruction increase. These instructions make creation of program much easier but it does not mean that program will run much faster because now instruction only contain more information but each micro operation (changing content of register, loading address in address bus etc.) will be performed in one cycle only.


Expression: Y = (A*B)-(CD)
R1, R2 are registers
M[] is any memory location

MUL R1, A, B // R1 = M[A] * M[B]

MUL R2, C, D // R2 = M[C] * M[D]

SUB Y, R1, R2 // M[Y] = R1 - R2


Related Solutions

Warwreck Car Wrecking Company has been in operation for three years using two wrecking trucks. On...
Warwreck Car Wrecking Company has been in operation for three years using two wrecking trucks. On 31 August 2016, the end of the third accounting period, the new accountant noticed that the company had recorded depreciation on its wrecking trucks in the following ways: First year Straight-line method Second year Reducing balance method on the net book value at the end of Year 1 Based on the above information: (a) (i) Name the TWO financial statements which were affected by...
Using C++ Write One one single program with two or more functioncallsWrite a C++...
Using C++ Write One one single program with two or more function callsWrite a C++ function, smallest Index, that takes as parameters an int array and its size and returns the index of the smallest element in the array. Also the program should test the function.Write another function that prompts the user to input a string and outputs the string in uppercase letters. You must use a character array to store the string.
Write a C function to implement operation of a stack using the following format: /** *...
Write a C function to implement operation of a stack using the following format: /** * function: *       push * * expects: *       pointer to the stack *       pointer to the size *       the value to push * * returns: *     true when value has been pushed *       false otherwise * * The push function push a value to the passed in stack */ bool push(int *stack, int *size, int max_size, int to_push) {...
write this java code: One statistical operation that is sometimes performed on a set of data...
write this java code: One statistical operation that is sometimes performed on a set of data values is to remove values that are far from the average. Write a program that reads real values from a text file, one per line. Store the data values as Double objects in an instance of the class java.util.ArrayList. Then Use an iterator to compute the average and standard deviation of the values. Display these results. Use a second iterator to remove any value...
For our discussion, you will address one of three slightly different versions of the case of...
For our discussion, you will address one of three slightly different versions of the case of a ball falling to the base of a 50.0 m tall building. Neglect air resistance. The magnitude of the acceleration is 9.80 m/s2. The eventual position of the ball is at the base of the building, 50.0 m below this initial position. Upward is defined as positive. Displacements, velocities and accelerations directed upwards are positive. Conversely, if directed downwards, these same quantities are negative....
Step 1: Address the following questions in discussion in one paragraph for each of the three...
Step 1: Address the following questions in discussion in one paragraph for each of the three question items: Questions 1. Do you think that conscious (voluntary) movements must be organized differently from unconscious (involuntary) movements? What does the evidence tell you? 2. Can you point to any body movements that do not involve reflexes--or some reflexes that do not involve bodily movement?
Write or Draft three interview questions that address how the leader addresses the challenges associated with...
Write or Draft three interview questions that address how the leader addresses the challenges associated with recruitment and retention and his or her role in the process.
Write a program that accepts user’s name, password and address and display them back using the...
Write a program that accepts user’s name, password and address and display them back using the format “Hi, I am user’s name. I live at user’s address.”. Restrictions: ▪ Use only three variables. ▪ Make sure you support spaces.
Using the previous tutorial, address the following: Imagine an experiment where three dice are tossed and...
Using the previous tutorial, address the following: Imagine an experiment where three dice are tossed and the numbers on each die is recorded under Die1, Die2 and Die3. Answer the following questions about the sum of the three numbers recorded from: Die1+Die2+Die3. (Discussions allowed) Hint: Simulate this experiment 1000 times. (use the same procedure as in the above tutorial, but for the Number of Variables, instead of 1 put 3; since we are rolling 3 dice not one). Next, create...
Identify two or three programs that have been in place to address the health concern or...
Identify two or three programs that have been in place to address the health concern or issue. Explain whether these have been effective. Explain how you know this and identify any gaps in the data if present. Identify a policy, if it exists, that aims to address the health concern or issue. Describe the impact of this policy. Explain whether it should be changed and why.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT