←back to thread

29 points andwati | 1 comments | | HN request time: 0.201s | source
Show context
MrBuddyCasino ◴[] No.45905428[source]
What first confused me about endianness is that it is about byte order, not bit order. The latter would have seemed more logical, or is this just me?
replies(5): >>45905811 #>>45906279 #>>45906495 #>>45907705 #>>45907834 #
jojomodding ◴[] No.45906495[source]
You can't address individual bits. There is no way of telling if the LSBit is "left" or "right" of the MSBit. So endianness can't be about that.

For bytes, you can distinguish them, as you can look at the individual bytes produced from a larger-than-byte store.

replies(1): >>45907092 #
tadfisher ◴[] No.45907092[source]
Your CPU (probably) has left and right variants for shift and rotate operations, which is certainly an avenue for confusion. There's a "logical" bit order that these operations follow, which starts with the MSBit and ends with the LSBit, even when the physical connections are all parallel and don't really define a physical bit order.
replies(2): >>45907513 #>>45907877 #
1. NobodyNada ◴[] No.45907513[source]
> There's a "logical" bit order that these operations follow, which starts with the MSBit and ends with the LSBit

Well, normally when bits are numbered, "bit 0" is the least significant bit. The MSB is usually written on the left, (such as for left and right shifts), but that doesn't necessarily make it "first" in my mind.