C8 Computer organization · Practice
Floating point on a processor
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 8 kinds solid
Check
What is the spacing between adjacent single-precision floats near 100?
Check
A float has sign 0, stored exponent 3 + 127 and significand bits equal to 1048576. What value does it hold?
Check
A filter needs 1000 multiply-adds per output sample. Without an FPU each costs 80 cycles. At 200 MHz, how many samples per second can it produce?
Check
A float format has a 24-bit significand (counting the hidden 1). What's the largest integer below which every integer is exactly representable?
Check
In float, a program computes with = 3000000 and = 0.01.
(a)
What is the spacing of floats near 3000000?
(b)
What does the expression return? (Round to the nearest multiple of that spacing.)
Check
Compare summation orders in single precision. Write to_f32(x) that rounds a Python float to the nearest float32 (use struct), and fsum32(values) that adds them one by one with a float32 accumulator. Also write kahan32(values), Kahan's compensated sum with every operation rounded to float32. For the harmonic series , = 1 to n (20000), set fwd, bwd and kahan (forward order, backward order, Kahan forward), and exact from math.fsum in double.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What is one ULP of a float near 900?
Check
How long do 64 software float operations of 60 cycles take at 72 MHz, in µs?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C8