Table A.2 Code for computing la - b| Exercises Symbolic code Machine code 1. Although we have not yet described division in our miniature computer, let us assume that a quotient p÷ q (the integral...


Help with my homework. Thank you so much.


Table A.2 Code for computing la - b|<br>Exercises<br>Symbolic code<br>Machine code<br>1. Although we have not yet described division in our miniature computer, let us<br>assume that a quotient p÷ q (the integral part) may be obtained by the code<br>sequence that corresponds to<br>Instruction<br>Addresst<br>Instruction<br>Address<br>name<br>Start<br>CLA P<br>START<br>RDS A<br>09<br>701<br>DIV Q<br>RDS B<br>10<br>702<br>CLA A<br>11<br>101<br>The resulting quotient will be found in the three lowest-order positions of the<br>АСС.<br>Write a sequence of symbolic codes and corresponding machine codes that<br>will compute the value<br>SUB B<br>STO C<br>TMI NEG<br>PRT C<br>TRA START<br>302<br>403<br>017<br>803<br>909<br>102<br>301<br>403<br>915<br>12<br>13<br>14<br>AGAIN<br>15<br>16<br>а — b,<br>y =<br>a+ b,<br>CLA B<br>SUB A<br>NEG<br>17<br>18<br>b.<br>Draw a picture of the storage cells showing all instructions and locations for<br>original or intermediate results. You must make certain decisions, such as where<br>STO C<br>19<br>TRA AGAIN<br>20<br>to keep a, b, and y in storage and at what location to begin the program.<br>Hint: Before the division can be carried out, both the numerator and the<br>denominator must be computed. At least one of these must be saved, in a place<br>that you will have to designate, while the other is being computed.<br>t We are assuming the following: (1) Instructions begin at 09.<br>(2) A at 01, B at 02, C at 03.<br>eea-b<br>2. After completing Exercise 1, write a sequence of instructions that reads a pair of<br>values for a and b from punch cards, computes y, prints it, and returns to read<br>another pair of values.<br>T.<br>e<0<br>3. Assume that a product p X q may be obtained by the code sequence that cor-<br>responds to<br>Negative<br>CLA P<br>MPY Q<br>Write a code sequence to compute the following.<br>Ceb-a<br>a) d=ªXb<br>a<br>b) c=<br>bx c<br>Print<br>Fig. A.10 Flowchart for computing a- b|.<br>

Extracted text: Table A.2 Code for computing la - b| Exercises Symbolic code Machine code 1. Although we have not yet described division in our miniature computer, let us assume that a quotient p÷ q (the integral part) may be obtained by the code sequence that corresponds to Instruction Addresst Instruction Address name Start CLA P START RDS A 09 701 DIV Q RDS B 10 702 CLA A 11 101 The resulting quotient will be found in the three lowest-order positions of the АСС. Write a sequence of symbolic codes and corresponding machine codes that will compute the value SUB B STO C TMI NEG PRT C TRA START 302 403 017 803 909 102 301 403 915 12 13 14 AGAIN 15 16 а — b, y = a+ b, CLA B SUB A NEG 17 18 b. Draw a picture of the storage cells showing all instructions and locations for original or intermediate results. You must make certain decisions, such as where STO C 19 TRA AGAIN 20 to keep a, b, and y in storage and at what location to begin the program. Hint: Before the division can be carried out, both the numerator and the denominator must be computed. At least one of these must be saved, in a place that you will have to designate, while the other is being computed. t We are assuming the following: (1) Instructions begin at 09. (2) A at 01, B at 02, C at 03. eea-b 2. After completing Exercise 1, write a sequence of instructions that reads a pair of values for a and b from punch cards, computes y, prints it, and returns to read another pair of values. T. e<0 3.="" assume="" that="" a="" product="" p="" x="" q="" may="" be="" obtained="" by="" the="" code="" sequence="" that="" cor-="" responds="" to="" negative="" cla="" p="" mpy="" q="" write="" a="" code="" sequence="" to="" compute="" the="" following.="" ceb-a="" a)="" d="ªXb" a="" b)="" c="bx" c="" print="" fig.="" a.10="" flowchart="" for="" computing="" a-="">
Exercises:<br>1. Write a program that will read two values, a and b, and will print the quantity<br>a+b<br>and then loop to read another pair of values.<br>a-b<br>2. Write a program that will read three values, a, b, and c, and compute<br>a*b<br>and<br>a<br>b*c'<br>3. Write a program that will read a number and print its absolute value.<br>In all three of the above programs, write the assembly code first, then write the machine code, then place the code into computer memory.<br>

Extracted text: Exercises: 1. Write a program that will read two values, a and b, and will print the quantity a+b and then loop to read another pair of values. a-b 2. Write a program that will read three values, a, b, and c, and compute a*b and a b*c' 3. Write a program that will read a number and print its absolute value. In all three of the above programs, write the assembly code first, then write the machine code, then place the code into computer memory.
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here