←back to thread

182 points Twirrim | 3 comments | | HN request time: 0s | source
Show context
donatj ◴[] No.41875031[source]
So please do excuse my ignorance, but is there a "logic" related reason other than hardware cost limitations ala "8 was cheaper than 10 for the same number of memory addresses" that bytes are 8 bits instead of 10? Genuinely curious, as a high-level dev of twenty years, I don't know why 8 was selected.

To my naive eye, It seems like moving to 10 bits per byte would be both logical and make learning the trade just a little bit easier?

replies(6): >>41875041 #>>41875052 #>>41875110 #>>41875147 #>>41875204 #>>41875211 #
dplavery92 ◴[] No.41875041[source]
Eight is a nice power of two.
replies(1): >>41875063 #
donatj ◴[] No.41875063[source]
Can you explain how that's helpful? I'm not being obtuse, I just don't follow
replies(4): >>41875100 #>>41875101 #>>41875319 #>>41875462 #
1. spongebobstoes ◴[] No.41875101[source]
One thought is that it's always a whole number of bits (3) to bit-address within a byte. It's 3.5 bits to bit address a 10 bit byte. Sorta just works out nicer in general to have powers of 2 when working on base 2.
replies(1): >>41875607 #
2. cogman10 ◴[] No.41875607[source]
This is basically the reason.

Another part of it is the fact that it's a lot easier to represent stuff with hex if the bytes line up.

I can represent "255" with "0xFF" which fits nice and neat in 1 byte. However, now if a byte is 10bits that hex no longer really works. You have 1024 values to represent. The max value would be 0x3FF which just looks funky.

Coming up with an alphanumeric system to represent 2^10 cleanly just ends up weird and unintuitive.

replies(1): >>41876097 #
3. Spivak ◴[] No.41876097[source]
We probably wouldn't have chosen hex in a theoretical world where bytes were 10 bits, right? It would probably be two groups of 5 like 02:21 == 85 (like an ip address) or five groups of two 0x01111 == 85. It just has to be one of its divisors.