Eli5 Binary and hexadecimals

208 views

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

In: 6

9 Answers

Anonymous 0 Comments

Well, let’s start with the number systems you probably already know:

* The simplest is to count on your fingers or use tally marks. For example, we could write the number four as “IIII”. To help make large numbers easier to read, maybe we’ll draw each fifth tally mark horizontally. So, for example, the number twelve might be “~~IIII~~ ~~IIII~~ II” in tally marks.
* To make them quicker to write, we could simplify the symbols. Let’s represent five as a stylized hand: “V”. Two “V”s can be stacked together, one upside-down, to make “X”. We’ll represent a hundred as “C” (short for *centum*, which is Latin for “hundred”) and a thousand as “M” (short for *mille*, which is Latin for “thousand”). The bottom half of a “C” looks kind of like an “L”, and the left half of an “M” looks kind of like a “D”. So, for example, the number two thousand six hundred and eighty-seven could be represented as “MMDCLXXXVII” in Roman numerals.
* We’re going to eventually run out of letters. (What should ten “M”s be? The Latin word is *myrias* and the English word is *myriad*, but we’ve already used “M”, and “Y” is too similar to “V”.) So instead we come up with a place system in which we reuse the same symbols over and over again and their meaning depends on position: the rightmost symbols will tell the number of ones, the next will tell the number of tens, and so on. So, for example, five myriad three thousand six hundred and sixty-five could be represented as “53649” in decimal.

Now we can move forward:

* Having even just ten separate symbols is actually a lot in some contexts. In particular, electrical switches tend to have only two possible states: on and off. So if you’re trying to communicate a number to somebody by turning your lights on and off while they watch your window from across the street, it’s not going to work to need ten different symbols. So instead we take the idea of places, but with only two symbols: 1 and 0. The rightmost will tell the number of ones, the next will tell the number of twos, the next the number of fours, and so on. For example, the number two hundred and thirty is equal to 1*128+1*64+1*32+0*16+0*8+1*4+1*2+0*1 (there’s no shortcut for knowing this, you just have to do the arithmetic to figure out how many of each power of two you need), so can be represented as “11100110” in binary.
* If we’re in a context where we do have the ability to use more symbols, maybe we want to use a number of symbols that’s easily convertible into and out of binary *without* having to do a bunch of arithmetic. Sixteen is convenient, since in binary it’s the nice round number “1,0000”. So in addition to “0” thru “9”, we’ll use “a” to represent ten (which in binary is “1010”), “b” to represent eleven (binary “1011”), and so on up through “f” for fifteen (binary “1111”). For example, the number five myriad one thousand two hundred and seventy-four is equal to 12*4096+8*256+4*16+10, so can be represented as “c84a” in hexadecimal (to convert it to binary, since each symbol can be represented as four bits, and since each symbol’s place is “1,0000” times the previous symbol’s place, we can just convert each symbol individually: c is “1100”, 8 is “1000”, 4 is “0100”, a is “1010”, so “c84a” in hexadecimal becomes “1100,1000,0100,1010” in binary).

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