IoT Fundamentals · Study deck
From Bytes to Meaning
Picture a temperature value that keeps the same bytes after an update but silently changes units.
Physics Phoebe is your guide for this deck.

After studying this chapter
Learning objectives
A useful byte contract preserves the capture, identifies the field representation, and makes the decode repeatable.
- Preserve captured bytes.The raw sequence lets another engineer repeat the decode.
- Numeric fields need an explicit contract.Width, sign, byte order, scale, and unit determine the value.
- Validate each representation with its own rule.Text, flags, and structured data need different checks.
Major section
In 60 Seconds · Start With the Story
Firmware means the program stored on a device to control its hardware.
- A payload means the part of a message that carries the application data.
- The deeper sections explain bits, bytes, integers, text, floating point, packed fields, and schema changes.
- Every IoT reading eventually becomes bytes.
Major section
Bytes Are Evidence, Meaning Is a Contract
They could be a price of ten dollars and fifteen cents, a time of 10:15, a year, a part number, or a temperature of 101.5 stored in tenths.
- The digits are identical.
- Bytes work the same way, one level lower: the bits are fixed, but their meaning depends on a shared agreement.
Major section
Bytes Are Evidence, Meaning Is a Contract (continued)
This gives: Bytes Are Evidence, Meaning Is a Contract evidence to revisit.
- The important idea is not "store data efficiently." The important idea is agreement.
- A useful first check is to ask what the bytes are allowed to become.
- The wrong choice gives a different, often plausible, number.
Major section
Bytes Are Evidence, Meaning Is a Contract (continued)
A number that "looks reasonable" is not proof that the rules were right.
- The same sequence may be a scaled integer, a UTF-8 string, a group of status flags, or a structured payload field.
- Each choice has different proof: numeric values need range checks, text needs byte-length checks, flags need bit labels, and structured fields need a schema version.
- Beginner ExamplesThe byte 0x50 is decimal 80, not decimal 50.
Major section
Bytes Are Evidence, Meaning Is a Contract (continued)
Encoding and scale carry meaningText needs an encoding, and raw integers usually need a scale and units before they become real measurements.
- The middle column stores that count as a register value and packet bytes; the right adds payload structure and application context.
- The reading was careful and still wrong, because the label, the contract, was missing.
- Reading hexadecimal as if it were decimal is one of the most common decode mistakes.
Major section
Bytes Are Evidence, Meaning Is a Contract (continued)
If you only need the intuition, this layer is enough: keep the original bytes as evidence, write down the rules used to decode them, and check the result against a plausible range.
- The One-Minute ViewWidth and sign set the range How many bytes a field uses, and whether it can be negative, decide which values it can even represent.
- Byte order assembles valuesA multi-byte number can be built most-significant-first or least-significant-first.
- A device name and a measurement are both "data," but text and numbers follow different rules.
Major section
Apply It: Decode a Field With a Contract
A reliable decode is a short, ordered procedure, not a guess.
- The goal is a value you can defend later, with the original bytes and the exact rules kept together so the same work is reproducible.
- Swapping the order would give 0xEB00 = 60160, a very different value.
- Top bit is 0, so positive.
Major section
Apply It: Decode a Field With a Contract (continued)
Walkthrough: From Raw Bytes to a Trusted ValuePreserve the raw bytes: Capture the original byte sequence before any tool formats or rounds it, so the evidence is not lost.
- If the top bit were set, the value would be negative under two's complement.
- Units are tenths of a degree.
- Reporting 235 degrees would be a unit error, not a sensor fault.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order
Knowing the mechanism lets you predict ranges, recognize overflow, and explain why a byte-order mistake produces a number that still looks believable.
- Bases and Positional ValueDecimal, binary, and hexadecimal are different notations for the same quantities.
- An unsigned 8-bit field holds 0 to 255.
- Both readings are arithmetically valid.

Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
Each digit's value is its symbol times the base raised to the digit's position.
- Fixed-Width RangesAn IoT field usually has a fixed number of bits, which caps how many distinct values it can hold.
- A signed 8-bit field holds -128 to 127.
- Contract Must Record.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
Signed overflow must not be assumed to wrap.
- An unsigned 16-bit field holds 0 to 65535.
- Include fault values before testing a candidate width, so an unusual reading cannot silently exceed the chosen range.
- Silent unsigned wraparound is a classic source of impossible-looking jumps in counters and timers.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
A type is suitable only when every valid value fits and the out-of-range behaviour is deliberate.
- When an out-of-range result is stored in an unsigned N-bit field, it wraps modulo 2^N instead of saturating.
- Two's Complement and SignAlmost all systems store signed integers in two's complement, where the most significant bit carries negative weight.
- Encoding, byte limit, allowed characters, invalid-input behavior.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
The same bits decode very differently depending on whether the field is signed.
- Byte Order (Endianness)A multi-byte value can be stored most significant byte first (big-endian) or least significant byte first (little-endian).
- Both results are real integers, so a byte-order mistake rarely throws an error.
- Below, the character policy controls accepted symbols, while the byte limit controls storage.
- Misread status because reserved bits were assumed zero.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
It quietly produces a wrong-but-plausible value, which makes endianness one of the hardest representation bugs to spot without a known-good test vector.
- In UTF-8, a character occupies one to four bytes: the ASCII range uses a single byte, while many accented, symbol, and non-Latin characters use more.
- Counting characters is therefore not the same as counting bytes, so a field limited to a fixed number of bytes may hold fewer characters than expected.
- Ignoring signedness: A fault code stored as a small negative number can be read as a huge positive counter.
Major section
Under the Hood: Ranges, Two's Complement, and Byte Order (continued)
Common PitfallsReading hexadecimal as decimal: The base must be confirmed first, or values can be wrong by amounts that depend on the digits.
- Assuming byte order: Without a documented order, a value can decode to a believable wrong number that survives into dashboards.
- Treating text as unlimited: Identifiers and topic names still occupy bytes, and multi-byte characters can overflow a fixed field.
- Changing a schema without versioning: If field order or meaning changes silently, deployed receivers decode new payloads as old ones.
- Canonical network order is useful precisely because it makes that hidden agreement common across implementations.
Major section
Checkpoint: Summary · Key Takeaway
Raw bytes are evidence; their meaning comes from a shared interpretation contract, not from the bytes alone.
- Numeric fields need base, width, signedness, byte order, scale, and units before they can be trusted.
- Two's complement and endianness can both turn the same bytes into different, plausible values, so signedness and byte order must be documented per field.
- Fixed-width fields have hard ranges; unsigned results wrap modulo 2^N, while signed overflow needs an explicit policy.
Deck summary
Key takeaways
Firmware means the program stored on a device to control its hardware.
- They could be a price of ten dollars and fifteen cents, a time of 10:15, a year, a part number, or a temperature of 101.5 stored in tenths.
- This gives: Bytes Are Evidence, Meaning Is a Contract evidence to revisit.
- A number that "looks reasonable" is not proof that the rules were right.
- Encoding and scale carry meaningText needs an encoding, and raw integers usually need a scale and units before they become real measurements.
Retrieval practice
Recall question 1

Physics Phoebe says: answer from memory, then check your reasoning.
Q1A packet carries a measurement, a device label, status flags, and a structured event. Which review matches each to the right proof?
Show answer
Answer: A Each representation needs a different decoding and validation rule.
Retrieval practice
Recall question 2

Physics Phoebe says: answer from memory, then check your reasoning.
Q2Two systems receive the exact same bytes but report two different values. What is the most likely cause?
Show answer
Answer: A Identical bytes only decode to the same value when both ends share the same representation contract.
Retrieval practice
Recall questions 3 and 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q3A payload field is documented as signed 16-bit, big-endian, in tenths of a degree, and the bytes are 00 EB. What value should be reported?
Show answer
Answer: A 0x00EB is 235, the top bit is clear so it is positive, and tenths of a degree gives 23.5.
Q4The two bytes FF 38 are decoded as a signed 16-bit big-endian integer. What value results?
Show answer
Answer: A 0xFF38 is 65336 as unsigned, and as a signed 16-bit value it is 65336 - 65536 = -200.
Print reference
Answers
Answer key.
- A · Each representation needs a different decoding and validation rule.
- A · Identical bytes only decode to the same value when both ends share the same representation contract.
- A · 0x00EB is 235, the top bit is clear so it is positive, and tenths of a degree gives 23.5.
- A · 0xFF38 is 65336 as unsigned, and as a signed 16-bit value it is 65336 - 65536 = -200.