2 ms·
Little endian: byte N has value 256^N, bit n has value 2^n. Big endian: byte N has value 256^(L-N), bit n has value 2^n or 2^(l-n) depending on the architectur
by userbinator 7mo ago
Little endian: byte N has value 256^N, bit n has value 2^n.
Big endian: byte N has value 256^(L-N), bit n has value 2^n or 2^(l-n) depending on the architecture (some effectively have little bit-endian but big byte-endian) and where L and l are the byte and bit size of the whole integer respectively.
Design hardware or even write arbitrary precision routines, and you'll quickly realise that "big endian is backwards, little endian is logical".
- zajio1am 7mo agoAs bits are generally not addressable / not ordered, it makes no sense to call CPU architecture big/little bit-endian. That makes sense only for serial lines/buses.
- userbinator 7mo agoWrong for any CPU with bit manipulation instructions... which is nearly all of them.