Eli5 Binary and hexadecimals

202 views

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

In: 6

9 Answers

Anonymous 0 Comments

They’re both positional number systems–much like the one you’re used to.

Base-10, which is what the normal number system is called, allows for 10 separate characters (0 through 9) to represent 10 separate values.

When the value you’re trying to write down exceeds the maximum value of the position you’re filling, the value rolls over to the next column and the current column reverts to the minimum value.

So, 9 + 1 exceeds the maximum value for one column in a base-10 system. So the value rolls over; 9 becomes 10.

This is true over any number of columns. 99 + 1, for example, goes like this:

99 + 1 = 9 {10, which exceeds the maximum value}, so that rolls over again to {10}0. That 10 also exceeds the maximum value, so it rolls over *again* to 100. This is the basis of “carrying,” as it’s commonly referred to.

You may have seen binary or hex written as exponential values… this is true for base-10 and all other systems, too. The more generic way of writing this is base^position . The “ones” column in a normal number is essentially 10^0 times whatever the value in that column is; the “tens” column is 10^1 times whatever the value in that column is, etc.

So, written like that, “100” becomes “1*10^2 + 0*10^1, + 0*10^0 “. A more complex number, say 2093, would be “2*10^3 + 0*10^2 + 9*10^1 + 3*10^0 “.

As I said, this is true for all bases. In a base-4 system, the maximum value character would be 3, so the (base-10) value “100” would be “1210” in base 4, because that works out to be 1*4^3 + 2*4^2 + 1*4^1 + 0*4^0. You can check that if you want–it works out to be 64 + 32 + 4 + 0 = 100.

So, binary and hexadecimal. These are simply popular bases to work with. Binary is base-2, hexadecimal is base-16.

So, in binary, the base-10 value “100” is just “1100100”. We can do the same math to check this: 1*2^6 + 1*2^5 + 0*2^4 + 0*2^3 + 1*2^2 + 0*2^1 + 0*2^0. That works out to be 64 + 32 + 0 + 0 + 4 + 0 + 0 = 100.

Hexadecimal is exactly the same… except that we don’t have number characters to represent values higher than 9, so we use letters. 0 through 9 are the same; 10 is represented by A, 11 by B, and so on. Hexadecimal is base-16, so the characters are 0 through F.

In computers, you may even come across “octal”, which is just base-8.

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