Learning · Step 3
Pick Q for your data
Q15 was a choice, not a law. Q is set by
your data: you need enough integer bits to hold the
largest value you'll ever see, and every bit you don't spend on the
integer side becomes resolution. Pick Q wrong and you either
overflow or throw away precision.
Measure your data's peak — the largest magnitude
max|x|. The integer side must reach at least that far;
the rest is fraction. The best Q is the largest one
whose range still covers the peak: maximum resolution, no overflow.
Too much Q → the integer range is smaller than the peak → values saturate. Too little Q → integer bits sit unused while resolution is coarser than it needed to be. The app's Q auto-suggest tool does this measurement for you; the explorer below shows what it's deciding.
Try it
Set your data's peak, slide Q, switch the word width —
the bit budget recolours and the verdict updates live.
What to notice
- Raise Q past the suggestion — the integer side gets too small and the data overflows (the budget turns red).
- Lower Q below the suggestion — it still fits, but the dim spare bits are wasted: you could have had finer resolution.
- The suggested Q sits right at the edge — every integer bit earns its place, every other bit is resolution.
- Try peak
400, then0.05— the right Q swings wildly with your data's range. That's why you measure the data first.
Step exam
Answer all 3 questions correctly to complete this step.
-
Your data's largest magnitude is 12. The Q-format's integer side must:
-
Choosing too large a Q — too many fractional bits — for your data causes:
-
The best Q for a dataset is: