3 ms·
Thanks for blog, very useful analogy. With the odd/even detection section, do you know why the bytes aren't also small to big in Little Endian? That is why isn
by bear8642 5y ago
Thanks for blog, very useful analogy.
With the odd/even detection section, do you know why the bytes aren't also small to big in Little Endian? That is why isn't the one's bit the leftmost bit?
- kstenerud 5y agoIt's just the convention we've adopted for bit positioning. To the programmer, it doesn't matter since you never actually see sub-byte data, so we just conventionally use the same meaning of shift "left" and shift "right" opcodes regardless of byte-endianness or how the CPU itself arranges the bits. So if we had followed the original Indian endianness, then a shift "left" would divide by 2 and a shift "right" would multiply by 2. All of our troubles stem from not swapping the digits around when we adopted the Indian/Arabic number system in the 10th century - we had to keep up the convention at first because it was compatible, and later because it's "natural".