Scenario
A device log reports 11110110 from an 8-bit register. One teammate reads it as 246; another insists it is a signed temperature delta and should read as a small negative number. Both are right about the bits and wrong to argue — the same pattern means 246 unsigned and -10 in 8-bit two's complement. The question is which interpretation the firmware intended, and you need both values in front of you to settle it.
Broken input
11110110
width: 8-bit signed
Goal
Use Two's Complement Calculator to decode the bit pattern as a signed two's-complement value while keeping the unsigned reading visible for comparison. Fixed-width matters: the same bits decode differently at 8, 16, or 32 bits.
Tool sequence
- Open Two's Complement Calculator.
- Set the bit width to 8 first — decoding at the default width silently changes the answer.
- Enter the binary pattern
11110110and read the signed decimal result. - Note the leading
1: in two's complement that is the sign bit, so the value is negative — the calculator shows-10. - If you need the unsigned reading or a hex form for a register map, run the same bits through Binary / Hex / Decimal Converter (
246,0xF6).
Checkpoint output
bits 11110110
unsigned 246
8-bit signed -10
hex F6
As an 8-bit two's-complement value the register reads -10 — consistent with a temperature delta, not a count of 246.
Common mistakes
- Decoding signed data without setting the original bit width —
11110110at 16 bits is just 246, not -10. - Padding or trimming bits before you know the source register size.
- Calling every value with a leading
1invalid instead of checking the signed interpretation. - Mixing up two's complement with sign-magnitude and getting
-118instead of-10.
Related tools and lessons
- Binary / Hex / Decimal Converter - Convert exact integers between base 2, 10, and 16.
- Bitwise Operations Calculator - Evaluate AND, OR, XOR, NOT, and bit shifts by width.
- ASCII / Unicode Explorer - Inspect characters, code points, bytes, and escapes.
- Related lesson: Convert a Feature Flag Between Binary, Hex, and Decimal
- Related lesson: Debug a Bitmask Permission Check