Computer science · 01 / 06
Binary: position determines weight
Middle school · Worked example and 4 exercises with solutions, at your pace.
The principle, simply
Positional notation multiplies each digit by a power of the base. Binary digits are 0 and 1; right-to-left weights are 1, 2, 4, 8 and so on. Unsigned, signed and floating-point encodings interpret bit patterns differently.
1011₂ = 11₁₀
- 01Digits
- 02Positional weights
- 03Products
- 04Decimal sum
WORKED EXAMPLE
From principle to reasoning
1011₂ = 8 + 0 + 2 + 1 = 11₁₀. One hexadecimal digit corresponds to four bits; A to F represent 10 to 15.
Solve a problem in this subject
- Specify the contract
Define inputs, types, outputs and forbidden cases. State whether a search algorithm requires sorted data.
- Trace a small example
Tabulate variables, tested conditions and actions using a small hand-checkable example.
- Test boundaries
Consider empty inputs, one item, duplicates, missing values and numeric limits where relevant. Define the output or explain rejection.
- Justify
Explain termination and correctness. Distinguish operation counts, measured time and memory use.
YOUR TURN
01 · Try before checking
Convert 1101₂ to decimal.
One hint
Write weights 8, 4, 2, 1 below the digits.
Reveal and understand the solution
8 + 4 + 0 + 1 = 13.
Compare method, conditions and answer; identify the exact part to revisit.
IMPROVE THROUGH PRACTICE
Three additional challenges with solutions
Start with the first challenge. Write your method before opening a hint; use the solution to find the first step that needs work.
Convert 10110₂ to decimal.
A hint to get started
Use weights 16,8,4,2,1.
Step-by-step solution
- Active bits contribute 16 + 4 + 2.
- The sum is 22.
- Positions have powers-of-two weights.
Which step did you miss? Retry without help, then explain why the method works.
Write unsigned 13 in binary.
A hint to get started
Decompose 13 into powers of two.
Step-by-step solution
- 13 = 8 + 4 + 1.
- Weights 8,4,2,1 give 1,1,0,1.
- 13₁₀ = 1101₂.
Which step did you miss? Retry without help, then explain why the method works.
What is the maximum unsigned 8-bit integer?
A hint to get started
All bits are 1.
Step-by-step solution
- The weights sum to 1 + 2 + … + 128.
- This equals 2⁸ − 1 = 255.
- There are 256 values from 0 to 255, not a maximum of 256.
Which step did you miss? Retry without help, then explain why the method works.
The trap to avoid
State the base and signedness convention.
Without notes, can you…
- Explain the principle in your own words?
- Rebuild the diagram and its connections?
- Solve the exercise and justify the method?
Choosing a state saves it in this browser. This is your assessment, not a grade.