Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Using a table similar to that shown in Figure 3.10, Calculate 74 divided by21 using the hardware described in Figure 3.8. You should show the contents of each register on each step. Assume both inputs are unsigned 6-bit integers.

Short Answer

Expert verified

The value of 74 divided by 21 is :

Quotient 3 Remainder 9

Step by step solution

01

Determine the MIPS Division algorithm

The division starts by subtracting the divisor register from the remainder register. The result will be placed in a Remainder register. Then, the remainder value will be checked. If the remainder value is greater than or equal to 0, the quotient register will be shifted to the left and set 1 to the rightmost bit. If the remainder value is less than zero, then the original value will be restored by adding the divisor and remainder. Also, the quotient register will shit to left and set the least significant bit to 0. The divisor register will be shifted to the right 1 bit. Finally checks for number of repetitions.

02

Determine the value of division in table format. 

Given that 74 is divided by 21. Convert both the values to binary.

7416=0111010022116=001000012

Rewrite them in 3 bits order:

7416=00000011110022116=0100010000002

Division table is as follows:

Step

Action

Quotient

Divisor

Remainder

0

Initial values

000 000

010 001 000 000

000 000 111 100

1

remainder=remainder-Divisor

000 000

010 001 000 000

101 111 111 100

Remainder<0,R+D,Q left shift

000 000

010 001 000 000

000 000 111 100

Rshift Div

000 000

001 000 100 000

000 000 111 100

2

remainder=remainder-Divisor

000 000

001 000 100 000

111 000 011 100

Remainder<0,R+D,Q left shift

000 000

001 000 100 000

000 000 111 100

Rshift Div

000 000

000 100 010 000

000 000 111 100

3

remainder=remainder-Divisor

000 000

000 100 010 000

111 100 101 100

Remainder<0,R+D,Q left shift

000 000

000 100 010 000

000 000 111 100

Rshift Div

000 000

000 010 001 000

000 000 111 100

4

remainder=remainder-Divisor

000 000

000 010 001 000

111 110 110 100

Remainder<0,R+D,Q left shift

000 000

000 010 001 000

000 000 111 100

Rshift Div

000 000

000 001 000 100

000 000 111 100

5

remainder=remainder-Divisor

000 000

000 001 000 100

111 111 111 000

Remainder<0,R+D,Q left shift

000 000

000 001 000 100

000 000 111 100

Rshift Div

000 000

000 000 100 010

000 000 111 100

6

remainder=remainder-Divisor

000 000

000 000 100 010

000 000 011 010

Remainder>0,R+D,Q Lshift 1

000 001

000 000 100 010

000 000 011 010

Rshift Div

000 001

000 000 010 001

000 000 011 010

7

remainder=remainder-Divisor

000 001

000 000 010 001

000 000 001 001

Remainder>0,R+D,Q Lshift 1

000 011

000 000 010 001

000 000 001 001

Rshift Div

000 011

000 000 001 000

000 000 001 001

Now, convert the binary values to decimals:

Quotient=0000112=3Remainder=0000000010012=9

Therefore, the quotient and remainder of the 74 divided by 21 is 3 and 9 respectively.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

IEEE 754-2008 contains a half precision that is only 16 bits wide. The left most bit is still the sign bit, the exponent is 5 bits wide and has a bias of 15, and the mantissa is 10 bits long. A hidden 1 is assumed. Write down the bit pattern to represent -1.5625ร—10-1assuming a version of this format, which uses an excess-16 format to store the exponent. Comment on how the range and accuracy of this 16-bit floating point format compares to the single precision IEEE 754 standard.

Calculate 3.4179687510-3ร—6.34765625ร—10-3ร—1.05625ร—102by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 ( and also described in the text). Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Show all the steps, and write your answer in both the 16-bit floating point format and in decimal.

Using the IEEE 754 floating-point format, write down the bit pattern that would represent -14. Can you represent -1โ„4exactly?

Calculate 1.666015625ร—100ร—1.9760ร—104+1.666015625ร—100ร—-1.9744ร—104

by hand, assuming each of the values is stored in the 16-bit half-precision format described in Exercise 3.27 (and also described in the text). Assume 1 guard, 1 round bit, and 1 sticky bit, and round to the nearest even. Show all the steps, and write your answer in both the 16-bit floating-point format and in decimal.

Calculate the time necessary to perform a multiply using the approach given in Figure 3.3 and 3.4 if an integer is 8 bits wide and each step of the operation takes 4-time units. Assume that in step 1a an addition is always performed -either the multiplicand will be added, or a zero will be. Also assume that the registers have already been initialized (you are just counting how long it takes to do the multiplication loop itself). If this is being done in hardware, the shifts of the multiplicand and multiplier can be done simultaneously. If this is being done in software, they will have to be done one after the other. Solve for each case.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free