this post was submitted on 27 Dec 2023
148 points (70.0% liked)
Technology
59608 readers
5111 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related content.
- Be excellent to each another!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, to ask if your bot can be added please contact us.
- Check for duplicates before posting, duplicates may be removed
Approved Bots
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
not exactly because of pairs unless you’re talking about 1 and 0 being a pair… it’s because the maximum number you can count in binary doubles with each additional bit you add:
with 1 bit, you can either have 0 or 1… which is, unsurprisingly perhaps, 0 and 1 respectively - 2 numbers
with 2 bits you can have 00, 01, 10, 11… which is 0, 1, 2, 3 - 4 numbers
with 3 bits you can have 000, 001, 010, 011, 100, 101, 110, 111… which is 0 to 7- 8 numbers
so you see the pattern: add a bit, double the number you can count to… this is the “2 to the power of” that you might see: with 8 bits (a byte) you can count from 0 to 255 - that’s 2 (because binary has 2 possible states per digit) to the power of 8 (because 8 digits); 8^2
the same is true of decimal, but instead of to the 2 to the power, it’s 10 to the power: with each additional digit, you can count 10 x as many numbers - 0-9 for 1 digit, 00-99 for 2 digits, 000-999 for 3 digits - 10^1, 10^2, 10^3 respectively
and that’s the reason we use hexadecimal sometimes too! we group bits into groups of 8 and call it a byte… hexadecimal is base 16, so nicely lets us represent a byte with just 2 characters - 16^2 = 256 = 2^8