You are on page 1of 3

LABORATORY EXERCISE 2

SOURCES OF ERRORS IN COMPUTATION

SAMPLE PROBLEM

Converting to IEEE754 Standard Format

a. 0.011 (32 bit)


First, is to convert the decimal into binary:
Multiplicand Multiplier Product Binary
0.011 x 2 = 0.022 0
0.022 x 2 = 0.044 0
0.044 x 2 = 0.088 0
0.088 x 2 = 0.176 0
0.176 x 2 = 0.352 0
0.352 x 2 = 0.704 0
0.704 x 2 = 1.408 1
0.408 x 2 = 0.816 0
0.816 x 2 = 1.632 1
0.632 x 2 = 1.264 1
0.264 x 2 = 0.528 0
0.528 x 2 = 1.056 1
0.056 x 2 = 0.112 0
0.112 x 2 = 0.224 0
0.224 x 2 = 0.448 0
0.448 x 2 = 0.896 0
0.896 x 2 = 1.792 1
0.792 x 2 = 1.584 1
0.584 x 2 = 1.168 1
0.168 x 2 = 0.336 0
0.336 x 2 = 0.672 0
0.672 x 2 = 1.344 1
0.344 x 2 = 0.688 0
0.688 x 2 = 1.376 1
0.376 x 2 = 0.752 0

Approximately, the binary conversion is 0000001011010000111001010.

Second, is to get the normalize form of the binary:


1.011010000111001010 x 2-7
In obtaining the binary of exponent, we must add the exponent bias to the exponent of the
normalized form: (127 for 32 bit, 1023 for 64 bit)
127 + (-7) = 120

Third, is to convert the sum of bias and exponent into binary:


Dividend Divisor Quotient Binary
120 ∕ 2 = 60 0
60 ∕ 2 = 30 0
30 ∕ 2 = 15 0
15 ∕ 2 = 7.5 1
7 ∕ 2 = 3.5 1
3 ∕ 2 = 1.5 1
1 ∕ 2 = 0.5 1

Therefore, our binary for the EXPONENT is 1111000.


Lastly, to obtain the SIGNIFICAND, the decimal digits of the mantissa will be used.
011010000111001010

To fill up the 32 bit,


SIGN EXPONENT (8 BITS) SIGNIFICAND (23 BITS)
0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0

Conditions:
• 0, since the given number is positive, otherwise, 1.
• Adding 0 in the left most for the exponent bits since the binary conversion is only up
to 7 binary digits.
• Adding more 0 in the significand bits to complete the required 23 bits.

LABORATORY EXERCISE

Using your preferred program language, make a program that will convert Decimals to Binary
in IEEE754 Standard Format.

• Solutions might be optional to be shown as an output in your program.


• The program should be beginner’s friendly.
• The program output should be submitted during face-to-face schedule.
• Codes are to be presented in appendices. (If available)

PROBLEM SETS
(To be submitted in handwritten during face-to-face schedule, not included in laboratory report, to be
done separately but also as a group. Show complete solutions)

Perform the following operations in scientific notations, express all final answer in normalized form:
1. 18.31E 6 x 2.5E-2
2. 1.45E-5 + 0.00502
3. 3.1415E2 / 2.001E2
4. 10.18E7 – 2.12E4
5. 331E-2 x 19.93E-3

Convert the following numbers in binary, express all final answer in normalized form:
1. 313
2. 1000.75
3. 0.5625
4. 115.125
5. 55.1
Format for Laboratory Report:

LABORATORY REPORT NO.


TITLE
I. Introduction
A short background about the activity, its significance and the expected output.
II. Methodology
A past perfect tense procedure of accomplishing the activity.
III. Results and Discussion
Includes the core of the activity, includes solution and other data as required. It also
includes interpretation, observations and other necessary experiment data.
IV. Conclusion
Mentions a student’s learning and answers the learning objective of the topic.
V. Appendices
Includes documentations as needed.
VI. References

File format:
a. Laboratory report must be submitted in hard copy.
b. Solutions done should be in hand-written, scanned, and inserted Discussion in Laboratory
Report file.
c. Arial, 10, 1.15 spacing
d. To be submitted with printed Laboratory Rubrics.

You might also like