Memory interpretation lab
The digits are data. Width and type give them meaning.
The same 32 bits can be an unsigned integer, a negative two’s-complement value, four ordered bytes, or an IEEE-754 float. State the interpretation before trusting the number.
Decimal
3,735,928,559
Hex
0xDEADBEEF
Binary · 32-bit
1101 1110 1010 1101 1011 1110 1110 1111
Bytes
DE AD BE EF
01 · Width before meaning
One bit pattern, two integer readings
Unsigned
3,735,928,559
Signed · two’s complement
−559,038,737
Sign bit
31 · set
Unsigned max
4,294,967,295
Selecting a smaller width may discard high bits. DevSexy labels that truncation instead of silently changing the value.
02 · Address-by-address memory
Endianness reorders bytes, never the bits inside a byte.
03 · IEEE-754 single precision anatomy
Interpret the same 32 bits as a floating-point value
S
1
Exponent
10111101
Fraction
10110101101111011101111
- Class
- Normal
- Unbiased exponent
- 62
- Significand
- 1.fraction
- Value
- ≈ −6.2599 × 10¹⁸
04 · Practical reading recipes
Start from the format contract, not from a plausible-looking result.
Locate field bytes → read the protocol width → apply the declared order → interpret signedness
Copy bytes at increasing addresses → choose the C type width → compare logical and memory views
Confirm register order separately from byte order; 32-bit devices may use mixed word layouts
Read exactly 4 or 8 bytes → apply wire order → decode IEEE-754 → check special classes