Computer Organization and Design MIPS Edition, Fifth Edition: The Hardware/Software Interface (The Morgan Kaufmann Series in Computer Architecture and Design)
Question
Book Icon
Chapter 3, Problem 3.37E
Program Plan Intro

Given numbers: 3.41796875×103, 6.34765625×103, and 1.05625×102.

Binary Multiplication:

Binary multiplication follows the following rules:

0 x 0 = 00 x 1 = 01 x 0 = 01 x 1 = 1

Given Information:

A, B and C are stored in 16-bit half precision format.

Expert Solution & Answer
Check Mark

Explanation of Solution

Compare: 3.41796875×103×(6.34765625×103×1.05625×102) and (3.41796875×103×6.34765625×103)×1.05625×102

For: 3.41796875×103×(6.34765625×103×1.05625×102)

Here, 3.41796875×103 is represented as “A”, 6.34765625×103 is represented as “B” and 1.05625×102 is represented as “C”.

Converting the above values to binary:

3.41796875×103=1.1100000000×29

6.34765625×103=1.0001000000×28

1.05625×102=1.1010011010×26

The exponent for A×B can be represented as:

Exponent=8+6=2

Here, the sign of the result is positive as all the numbers are positive and hence their product is positive. It is assumed that it has “1” guard, “1” round bit and “1” sticky bit and round to the nearest even.

The fraction of B×C is represented below:

(B)1.0001000000(C)×1.10100110101000100000010001000000100010000001000100000010001000000100010000001.1100000011101000000001.110000001110100000000Guard51,Round50,Sticky51:Round

The value of B×C is 1.1100000100×22.

The fraction “A×(B×C)” is represented below:

(A)1.1100000000(B×C)×1.110000010011100000000111000000001110000000011.00010001110000000000Normalize,add1toexponent1.100010011100000000000Guard=1,Round=0,Sticky=0:

Hence after rounding up to even, the value of “A×(B×C)” is 1.1000100100×210.

For: (3.41796875×103×6.34765625×103)×1.05625×102

Here, 3.41796875×103 is represented as “A”, 6.34765625×103 is represented as “B” and 1.05625×102 is represented as “C”.

Converting the above values to binary:

3.41796875×103=1.1100000000×29

6.34765625×103=1.0001000000×28

1.05625×102=1.1010011010×26

The exponent can be represented as:

Exponent=98=17

Here, the sign of the result is positive as all the numbers are positive and hence their product is positive. It is assumed that it has “1” guard, “1” round bit and “1” sticky bit and round to the nearest even.

The fraction of the multiplication is represented as:

(A)1.1100000000(B)×1.000100000011100000000111000000001.11011100000000000000A×B1.11011100000000000000Guard=0,Round=0,Sticky=0,NoRound

Hence, the result of the product “A×B” is “1.1101110000×217”.

There is underflow as A and B are both small and their product does not fit into the 16-bit floating point format being used and hence cannot be represented.

As in 2nd case the value of (A×B)×C cannot be found whereas in 1st case the value of “A×(B×C)” is 1.1000100100×210 and hence they are not equal.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY