Skip to main content
AP CSP course

F04 · Topic 2.1

Binary message studio

Encode unsigned values at a stated bit width, decode by place value and explain overflow and sampling limits.

1. Predict first

Can decimal 45 fit in six unsigned bits? Give its pattern and the maximum value.

Change it · step through · explain

Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.

Ready · Make a prediction

Ready to experiment
  1. Input 145Waiting
  2. Input 26Waiting

Ready to experiment

Why: Predict the first change, then advance one step.

Try this: Try 63 and 64, then change the width.

2. Build your procedure

Design a sensor record with a documented unit, sample interval and unsigned bit width. Choose tests at the largest valid value and the next value, and explain a loss not caused by file corruption.

Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.

3. Check boundaries

Public worked tests for the fixed model
InputExpectedWhy this case
45; width6101101; decoded 45Several nonadjacent place values.
63; width6111111Largest valid unsigned value.
64; width6Overflow; no valid six-bit encodingNeeds a seventh bit.

4. Explain and reflect

Why can the same pattern be a number in one programme and a letter in another?

Model limits: Unsigned integer representation with overflow reported, not wraparound. It does not simulate an analogue signal or signed/floating-point encoding.

Teacher guidance and scoring