← Binary Course — Part E, lesson 3 of 4 (Reading real machine words)
20. Practice Set: Mystery Dumps, Mixed Bases and Interpretations
The concept
Nothing new gets introduced here. Every rule needed for this lesson already exists somewhere in Lessons 1-19 — hex conversion, masking and packed fields, the three signed-integer schemes, fixed-point scale, and a real machine's own word format. What's missing on purpose is the usual worked example sitting right next to each problem, quietly telling the reader which rule to reach for. Real raw dumps don't come with that convenience built in.
The actual skill this lesson drills is Lesson 18's discipline, not any new arithmetic: before computing anything, decide what's actually been given — the width, the convention, the scale, if any — and only then compute. Some items below state all of that plainly, the way a well-documented program would. Some deliberately don't, the way an undocumented one might. Telling those two situations apart, and knowing what to do in each, is the whole exercise.
Example 1 — Fully specified: state it, then compute
The hex value 0x6d, stated to be an 8-bit plain unsigned number.
Given a stated convention, the recipe is just: convert, then read.
0x6d -> 0110 1101 (Lesson 3's nibble table)
0110 1101, plain unsigned = 109 (Lesson 2's place value)
Nothing to decide here — the convention was already given, so the only work is mechanical.
Example 2 — Deliberately unspecified: enumerate, don't guess
The word 1100 1010, given with no stated convention at all. Rather
than guess one, list what each of this course's schemes would say:
plain unsigned: 202
sign-magnitude: -74
one's complement: -53
two's complement: -54
Four different values, none of them more "correct" than the others from the bits alone — exactly Lesson 18's point. The honest answer to "what does this word mean" is: it depends on a convention this problem never supplied, so no single number can be handed back yet. That's not a failure to solve the problem; recognizing the missing information is solving it.
Exercises
Exercise 1. The hex value 0xb4, stated to be an 8-bit two's
complement number. Convert and decode, using Example 1's method.
Exercise 2. The 8-bit word 1001 1011 uses Lesson 8's packing
layout: type at bits 7-6, value at bits 5-2, flags at bits 1-0.
Extract all three fields.
Exercise 3. The word 1011 0110, given with no stated convention.
Using Example 2's method, list what it would mean under all four of
this course's numeric schemes.
Exercise 4. The 8-bit word 1110 1000, stated to be two's
complement, at a fixed-point scale of 2^-4 (point after bit 4).
Decode its value.
Exercise 5. A 32-bit word from an LGP-30-style machine (Lesson 19's
format: sign at bit 31, a 30-bit fractional magnitude, a spacer at bit
0), at a stated scale factor q = 3:
0111 0000 0000 0000 0000 0000 0000 0000
Decode its value, using Lesson 19 Example 1's method.
Exercise 6. The 32-bit word below is stored on the same
LGP-30-style machine, at q = 3:
1001 0000 0000 0000 0000 0000 0000 0000
A classmate reads its magnitude bits directly as a fraction and puts a minus sign in front, the way Lesson 9's sign-magnitude scheme would. What value do they get? What's the word's actual value, decoded using Lesson 19 Example 2's real method (invert the 31-bit sign+magnitude field, add 1, then read the recovered magnitude)?
Show Answer Key
1. 0xb4 = 1011 0100. Unsigned: 180. Two's complement:
180 - 256 = -76.
2. type (bits 7-6, 10) = 2. value (bits 5-2, 0110) = 6.
flags (bits 1-0, 11) = 3.
3. Plain unsigned: 182. Sign-magnitude: sign 1, magnitude
0110110 = 54, so -54. One's complement: invert (0100 1001 = 73),
so -73. Two's complement: 182 - 256 = -74.
4. Two's complement: 1110 1000 = 232 unsigned, 232 - 256 = -24.
At scale 2^-4: -24 / 16 = -1.5.
5. Sign 0 (positive). Magnitude 0.111000...0 = 0.875. At
q = 3: 0.875 x 2^3 = 7.
6. The classmate's face-value reading: magnitude 0.001000...0 = 0.125, sign 1, so -(0.125 x 2^3) = -1. That's wrong — this
machine's negative numbers aren't sign-magnitude, exactly the trap
Lesson 19 named directly. The real decode: invert the 31-bit field
1001000...0 (0110111...1), add 1 (0111000...0) — the recovered
field is Exercise 5's own +7 field. So this word's actual value is
-(0.875 x 2^3) = -7, not -1 — wrong by a wide margin, not a small
rounding slip, because the classmate applied a scheme this machine
never uses.
Lesson 21 closes out Part E, and this course, with pointers to where this fluency gets put to real use: the LGP-30 lessons that motivated this course in the first place, and the machine-specific courses still to come.
Sign in to mark lessons complete and keep your progress.