Eli5 Binary and hexadecimals

210 views

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

In: 6

9 Answers

Anonymous 0 Comments

Computers can only understand if something is on, or off. If it’s on, it’s a 1. If it’s off, it’s a 0.

You have 8 digits, or bits, in a byte. If you turn the first bit on, it’s a 1. From right to left, you’ll notice that they are powers of 2, or just double what was previous. So it goes:

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1

Now, when you see a binary number, in this example 00000001, you just line it up with this “graph.” Since the first bit is on, and it equals to one, this means 00000001 = 1.

If you have 0101, you’ll notice it’s only half a byte. You can substitute the remaining 0’s if you want, but 00000101 and 0101 equal the same thing, 4 + 1. Since the 3rd and 1st bit are on. So, 5.

Hexadecimal if I remember correctly involve the numbers 1-9 and letters A-F. The letters A-F are just 10-15. So:

A = 10

B = 11

C = 12

D = 13

E = 14

F = 15

So, when you see 35, you naturally read that as thirty five, but in hexa it’s actually 3 and 5. Remember that half byte I talked about earlier? It applies here. You may notice that with a half byte the max number you can reach is 15, which is the max for hexa too. So each number is split into 2 half bytes, to make 1 byte. In this case you convert 3 to binary, and 5 to binary.

You convert by going from right to left, turning on bits until you reach the desired number.

For example, 5 is 0101, and 3 is 0011, you put these together and it is 00110101, or 35, three and five.

Another example, 4F. F is 15, and 15 is all of the bits in a half byte turned on. So it’s just 1111. 4 has its own bit, so it’s 0100. Together? 01001111.

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