How to animate an ASCII character to a byte
Uppercase A has the decimal ASCII value 65. In an eight-bit byte, that value is 01000001. ASCII uses seven bits; the leading zero pads the value to eight bits.
Check the values before animating
Check the values with Python
Run this snippet in Python 3 before building the scene. It checks the decimal value and eight-bit display, then converts the bits back to the original character.
glyph = "A"
value = ord(glyph)
bits = format(value, "08b")
assert (value, bits) == (65, "01000001")
assert chr(int(bits, 2)) == glyph
print(glyph, value, bits)Expected output: A 65 01000001.
Plan four shots in fixed columns
- Set up three columns: Glyph, Decimal ASCII, and Eight-bit binary. Reveal
Ain the first column, and leave the other two cells blank. - Reveal
65under Decimal ASCII. KeepAvisible in its original position. - Reveal
01000001under Eight-bit binary. Keep the leading zero visible and leave the first two values in place. - Hold the completed row. Pause the animation and compare all three values with the Python output before recording narration.