3 ms·
> In the most popular character encoding, UTF-8, character number 65 ("A") is written: > 01000001 > Only the second and final bits are 1, or "on". Isn’t it m
by bandyaboot 2y ago
> In the most popular character encoding, UTF-8, character number 65 ("A") is written:
> 01000001
> Only the second and final bits are 1, or "on".
Isn’t it more accurate to say that the first and penultimate bits are 1, or “on”?
- fl7305 2y agoIt depends on whether your bit numbering is like x86 (your description), or PowerPC (left most bit is 0).
- duskwuff 2y agoBasically everyone uses x86 bit numbering. It has the pleasant property that the place value of every bit is always 2^n (or -2^n for a sign bit), and zero-extending a value doesn't change the numbering of its bits.
- bandyaboot 2y agoThe more I thought it through, even assuming x86, I guess there’s just no “correct” way to casually reference bit positions when we read them in the opposite order from the machine. Are they being referenced from the perspective of a human consumer of text, or the machine’s perspective as a consumer of bits? If I were writing that content, I’d have a difficult time deciding on which to use. If I were writing for a lay person, referencing left-to-right seems obvious, but in this case where the audience is primarily developers, it becomes much less obvious.
- mark-r 2y agoThanks for giving me an example of an architecture where the bits are labelled backwards, I'd never encountered that before. I've always appreciated that the bit number represents 2 to the power of that number.
- skerit 2y agoThis confused me too. Until reading this I didn't even think much about how I read binary numbers right-to-left by default.