<pclass="post-list__item__description">Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into...</p>
<pclass="post-list__item__description">Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into...</p>
<pclass="post-list__item__description">Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into...</p>
<pclass="post-list__item__description">Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into...</p>
<pclass="post-list__item__description">Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into...</p>
<metaname="description"content="Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into…">
<metaproperty="og:type"content="article">
<metaproperty="og:title"content="Base16 and all that Jazz">
<metaproperty="og:description"content="Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into…">
<metaname="twitter:title"content="Base16 and all that Jazz">
<metaname="twitter:description"content="Photo by Vidar Nordli-Mathisen on Unsplash Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into…">
<p>Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into programming means they’re going to have to learn how to speak “computer” by learning binary and write programs with it. When you get into it, there
are very few times that you’ll actually need to use binary for every day tasks. Much more common however is Hexidecimal or Base16.</p>
<p>I’m going to try to give you a rundown on Hexidecimal and while I’m at it, I’ll swing back around to binary with what we’ve learned with Hex.</p>
<h2id="What-we-know-now"><ahref="#What-we-know-now"class="headerlink"title="What we know now."></a>What we know now.</h2>
<p>Our common numbering system that we use day to day is actually called base10 or Decimal. Each digit has 10 positions, zero to nine. if I post up a number like 38 the number in the right most is 8 which means there are, well, 8 in the “ones”
location. “Ones” is not a good thing to call this, because, as we’ll learn, that can change. It’s more accurate to call this the least significant digit or LSD for short. That means it’s the position that affects the overall number the least.
Numbers in this position have the least overall value. Consider the digits of our example. <code>38</code> the <code>8</code> digit may be larger than the <code>3</code> but it’s value is also affected by it’s position in the digit.</p>
<p>So <code>8</code> means <code>8</code> but the <code>3</code> means there are <code>30</code>. In English, we call this Thirty Eight but in a lot of other languages it’s called Thirty and Eight. This is the mindset you want to get into. Don’t
think of numbers as individual values, rather think of them as a combinations of digit values. In base 10, each digit above the LSD is a value of <code>10</code> of the digit immediately preceding it. <code>10</code> is worth <code>10</code><code>1</code>s,
<code>30</code> is 3 times <code>10</code><code>1</code>s, and <code>100</code> is worth <code>10</code>, <code>10</code>s. The <code>10</code> is what’s important in base10. It informs when the number rolls over into the next digit.</p>
<p>Hexidecimal is also known as base16. In Hex, <code>1</code> equals <code>1</code> in base10, our well known number system. In fact 0-9 is the same in Hex and Decimal. but those are the only numbers that are the same. For instance. <code>10</code> in Hexidecimal is actually <code>16</code> in base10. But how does this happen? Well in Hexidecimal, there are single digit numbers that are higher than <code>9</code>. How though? You can’t just invent numbers like that. Well actually you
can. Base10 is just a way to record numbers. There’s no reason we couldn’t record numbers another way. Math gets different in different numbering systems but we’re not too worried about that, we just want to be able to record the same information
in less space. Hexidecimal’s LSD is recorded 0-15 like so.</p>
<table>
<thead>
<tr>
<th>Hexidecimal</th>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
<th>9</th>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td>Decimal</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
</tr>
</tbody>
</table>
<p>Letters! Ok so, once you’ve gotten your head around that you can understand how <code>F + 1 = 10</code> is the same as <code>15 + 1 = 16</code> then you have to start thinking about how <code>20</code> in hex is actually <code>32</code> in
base10.</p>
<p>Now we get to the last part you have to understand about base16. Remember how we said that <code>100</code> is <code>10</code><code>10</code>s? Well in base 16, <code>100</code> is <code>16</code><code>16</code>s. So in this example, <code>FF + 1 = 100</code> and <code>100</code> in hex is <code>256</code>. This is the basics of every numbering system. the <code>base</code> part of base16 means how many positions the LSD can be in before overflowing into the next digit. Binary is no different.
Binary is also called base2. <code>0</code> and <code>1</code>.</p>
<p>Knowing what we know in Hexidecimal, Binary should be more approachable. We don’t need to make up new digits because <code>0</code> and <code>1</code> already exist.</p>
<p>take a look at this.</p>
<table>
<thead>
<tr>
<th>Decimal</th>
<th>0</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
<th>8</th>
<th>9</th>
<th>10</th>
<th>11</th>
<th>12</th>
<th>13</th>
<th>14</th>
<th>15</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hexidecimal</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
<tr>
<td>Binary</td>
<td>0</td>
<td>1</td>
<td>10</td>
<td>11</td>
<td>100</td>
<td>101</td>
<td>110</td>
<td>111</td>
<td>1000</td>
<td>1001</td>
<td>1010</td>
<td>1011</td>
<td>1100</td>
<td>1101</td>
<td>1110</td>
<td>1111</td>
</tr>
</tbody>
</table>
<p>For a large margin all you’ll need to know about Hexidecimal will be 2 digits. <code>FF</code> is usually the max number you’ll encounter because it just so happens to be a full byte of data. a byte is 8 bits. A bit is a single digit of a
<p>This is a quick rundown of these numbering systems. To be completely honest, I’m still trying to get my head wrapped around it. The point is here, don’t be intimidated. It’s just a different way to store values in a more compact way, If I
have 1000 entries of 255, I’d much rather store two <code>FF</code>s than three digits <code>255</code> 2000 digits vs 3000 digits. More memory, more space.</p>
<p>If you have anything to add, or any questions, Drop me a line.</p>
</div>
<divclass="article__author"itemscope=""itemprop="author"itemtype="https://schema.org/Person"><imgclass="article__author__image"src="/images/avatar.jpg"alt="John Warren"><aclass="article__author__link"title="About John Warren"rel="author">John Warren</a>
<pclass="article__author__desc">Just a place to make stuff</p>
<metaitemprop="articleBody"content="Photo by Vidar Nordli-Mathisen on Unsplash
Oh God. HEX! It’s just so hard to get your head around. A lot of people think that getting into programming means they’re going to have to learn how to...">
<divclass="related-posts__item__overlay"></div><spanclass="related-posts__item__title">Table based design: Why I loathe it, and you should too!</span></a>
<divclass="related-posts__item__overlay"></div><spanclass="related-posts__item__title">Table based design: Why I loathe it, and you should too!</span></a>