Eli5 Binary and hexadecimals

209 views

I’m struggling in class with understanding and calculating😭😭 It’s just not clicking for me

In: 6

9 Answers

Anonymous 0 Comments

This may be a bit more middle school than 5, but the thing that helped me a lot when we did different number bases in school was to remember “places”. When we’re first learning to count they make a big deal of One’s, Ten’s, Hundred’s, places. Because the way we learn how to count is using base 10, or decimal, each “place” in a number is a power of 10. (10^0, 10^1, 10^2) But after a few years they stop talking as much about 10’s and 100’s and saying stuff like “3 1’s and 2 10’s” so it’s easy to forget about places.

So we have places and we also have numerals indicating a value multiple. In base 10 we have numerals 0-9 because we need 10 values.

So now we have values and places. We have 10 values because each place represents a multiple of 10, so we need 10 possible values in each place to be able to represent numbers in order without skipping any.

We may have just internalized converting 436 to base 10 as “counting” but we could also learn to convert it like this:

Starting from the right read the value in each place.

Place | Value
———|———-
1|6
10|3
100|4

Multiply the value in that place by the place it’s in and add that result to all previous results:

`(6*1)+(3*10)+(4*100)=6+10+400=436`

Yeah now you know how to read numbers, so what?

Well the same longhand process I described will let you read numbers in _any_ base.

Let’s look a hex value like: 1B4

Places in hex are 1’s (16^0), 16’s (16^1), 256’s (16^2)

Place | Value
———|———-
1|4
16|B
256|1

And now the math:

`(1*4)+(16*B)+(256*1)=4+176+256=436`

Same number.

Note that B gets treated as if it was 11 (base 10) because after 0-9 we just keep going with letters using increasing decimal values so A=10, B=11, etc.

Binary is the same method except your places are based on powers of 2. 2^0 = 1, 2^1 = 2, 2^2 = 4.

Edit:

Thinking in places also lets you relearn how to do calculations directly in bases. Like if you remember adding decimals you add the 1’s together, then carry the 1 to the 10’s place, then carry the 10 to the 100’s place as you add numbers that overflow the “space” they’re in.

In hex `1B4+10=1C4`because you just add the places together.

Place | Left side | Right side | Result
———|———-|——–|-
1|4|0|4
16|B|1|C
256|1|0|1

Or here’s one that needs to carry a number to the next place

Place | Left side | Right side | Result
———|———-|——–|-
1|4|C|0 (C=12, 4+12=16 which is larger than a single numeral in hex can express)
16|B|1|C (Carry the 1) = D
256|1|0|1

Or 1B4+1C=1D0.

You are viewing 1 out of 9 answers, click here to view all answers.