Homework 1 solutions

1. Decimal to binary conversion

Example:

decimal_to_binary_example.png

2. All the non-negative machine numbers

a [4 points]

all_numbers_without_denorm.png

(base 2 or 10 from context in the above)

b [2 points] smallest positive w and w/o denorm

without denorm: 0.28125

with denorm: 0|00|001 <-> 0.001 x 2^(0-(2-1)) = 0.0001 binary = 0.0625

all_numbers_with_denorm.png

c [1 point] machine epsilon is 0.125 (This is a very coarse system: relative spacing as much as 12.5%.)

d&e [2 points] same as smallest positive numbers in part b.

f [1 point] largest would then be 1.875 (See table above for largest number with e.c. not the highest value 11.)

3. Machine code for 9.3

[5 points]

machine_code_for_9.3.png