{"id":3963,"date":"2015-01-15T11:33:24","date_gmt":"2015-01-15T19:33:24","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=3963"},"modified":"2015-08-03T17:35:27","modified_gmt":"2015-08-04T00:35:27","slug":"number-systems","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/number-systems\/","title":{"rendered":"Number Systems"},"content":{"rendered":"<p>Today, we are going to learn about number systems. A &#8220;number system&#8221; is defined <a href=\"http:\/\/dictionary.reference.com\/browse\/number%20system?s=t\">here<\/a> as &#8220;any notation for the representation of numerals or numbers.&#8221; We naturally use the decimal (base 10) system, meaning we use the numbers 0-9 to represent all the other numbers. The three types of number systems that we are going to talk about today are <strong>decimal<\/strong>, <strong>binary<\/strong>, and <strong>hexadecimal<\/strong>, but there are many more!<br \/>\n<!--more--><br \/>\n<!--more--><\/p>\n<figure style=\"width: 250px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/f\/ff\/Sudoku-by-L2G-20050714.svg\/250px-Sudoku-by-L2G-20050714.svg.png\" alt=\"\" width=\"250\" height=\"250\" \/><figcaption class=\"wp-caption-text\">Decimal sudoku. From <a href=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/f\/ff\/Sudoku-by-L2G-20050714.svg\/250px-Sudoku-by-L2G-20050714.svg.png\">Wikipedia<\/a>.<\/figcaption><\/figure>\n<p>Sudoku provides a great visual of how different number systems can be!<\/p>\n<p><!--more--><br \/>\n<!--more--><br \/>\nDecimal is the base 10 number system. This is the first number system we are gonna learn about, as we&#8217;ve been using it our whole life, and is fairly easy to show mathematically.<br \/>\n<!--more--><\/p>\n<p>We will use the number 1,234.<\/p>\n<p>&nbsp;<\/p>\n<p>In the single digits, we can say it is 4&#215;10^0. Any number to the 0th power is equal to one, so we have 4&#215;1 (or 4).<\/p>\n<p>&nbsp;<\/p>\n<p>In the tenth place, we have 3&#215;10^1. Using exponent rules, this works out to 3&#215;10 (or 30).<\/p>\n<p>&nbsp;<\/p>\n<p>For the hundredths and thousandths places there is 1&#215;10^3 and 2&#215;10^2. These values are 1&#215;1000 and 2&#215;100.<\/p>\n<p>&nbsp;<\/p>\n<p>When we combine all the values, we get 1000+200+30+4, which is equal to 1,234.<br \/>\n<!--more--><br \/>\n<!--more--><\/p>\n<figure id=\"attachment_3995\" aria-describedby=\"caption-attachment-3995\" style=\"width: 74px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/binary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3995\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/binary.png\" alt=\"Binary Sudoku\" width=\"74\" height=\"81\" \/><\/a><figcaption id=\"caption-attachment-3995\" class=\"wp-caption-text\">Binary sudoku.<\/figcaption><\/figure>\n<p>Binary is slightly more complicated. Binary is base two, and only uses 1 and 0 as its numbers.<\/p>\n<p>&nbsp;<\/p>\n<p>Let&#8217;s check out the binary number 1001. Just like any other number system, we can simplify each number to a summation of bases and exponents. 1001 will simplify into 1&#215;2^3 + 0x2^2 + 0x2^1 + 1&#215;2^0. If we simplify this problem we have 8 + 0 + 0 + 1 = 9.<br \/>\n<!--more--><br \/>\n<!--more--><\/p>\n<figure style=\"width: 450px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/brainden.com\/forum\/uploads\/post-9659-0-32065100-1357852602.png\" alt=\"\" width=\"450\" height=\"451\" \/><figcaption class=\"wp-caption-text\">Hexadecimal sudoku. From <a href=\"http:\/\/brainden.com\/forum\/uploads\/post-9659-0-32065100-1357852602.png\">brainden.com<\/a>.<\/figcaption><\/figure>\n<p><!--more--><br \/>\n<!--more--><\/p>\n<figure id=\"attachment_3999\" aria-describedby=\"caption-attachment-3999\" style=\"width: 165px\" class=\"wp-caption alignright\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/hextable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3999\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/hextable.png\" alt=\"Hexadecimal Table\" width=\"165\" height=\"351\" \/><\/a><figcaption id=\"caption-attachment-3999\" class=\"wp-caption-text\">Hexadecimal table.<\/figcaption><\/figure>\n<p>Hexadecimal is the most complicated of the three number systems we are going to learn about. Hexadecimal stands for base-16 values, going from 0-F (with F being 15).<\/p>\n<p>&nbsp;<\/p>\n<p>We are going to use the number E41D as our example for hexadecimal.<\/p>\n<p>&nbsp;<\/p>\n<p>As with other number systems, we can break it down into less complicated pieces, which gets us<br \/>\nEx16^3 + 4*16^2 + 1*16^1 + D*16^0. We can use our hexadecimal table to convert all the letters to decimal numbers.<\/p>\n<p>&nbsp;<\/p>\n<p>That gets us 14&#215;16^3 + 4*16^2 + 1*16^1 + 13*16^0, and this is just a mathematical equation we can solve! Expanded, that is 14*16*16*16 + 4*16*16 + 1*16 + 13*1 = 58397.<br \/>\n<!--more--><br \/>\n<!--more--><br \/>\nSo far we&#8217;ve only been converting to and from decimal. But what if we wanted to convert between hex and binary. If you understand what we&#8217;ve been doing so far, this will be much simpler than hex-decimal conversion!<\/p>\n<p>&nbsp;<\/p>\n<p>It is important to know that the binary string 1111 is equal to 15, which is great, as we can use every 4 bits as one number in hex. We use some decimal conversions here, but it is only between 0 and 15, which isn&#8217;t too bad.<\/p>\n<p>&nbsp;<\/p>\n<p>If we take the binary number 1111111001. If we divide this into string of four, we get 11 1111 1001. We can add two 0s on the front to get 0011 1111 1001, this doesn&#8217;t change the number value, but it makes it easier to read.<\/p>\n<figure id=\"attachment_4004\" aria-describedby=\"caption-attachment-4004\" style=\"width: 162px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/convert.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4004\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/convert.png\" alt=\"Conversion\" width=\"162\" height=\"106\" \/><\/a><figcaption id=\"caption-attachment-4004\" class=\"wp-caption-text\">Conversion.<\/figcaption><\/figure>\n<p><!--more--><br \/>\n<!--more--><\/p>\n<p>The graphic shows us converting every 4 bits into a decimal number, then converting those decimal numbers into hex. We get 3F9 as our hex number. We can check the two values in decimal, and they should be the same!<br \/>\n<!--more--><br \/>\n<!--more--><br \/>\nWe use different number systems because computers &#8220;think&#8221; differently than humans do! Computers use binary to compute everything, but most humans use the decimal system (theoretically\u00a0because we have two hands with five\u00a0digits each). Hexadecimal is a good balance between the two, making it\u00a0much easier to convert by computers and humans!<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-3963 jlk' data-task='like' data-post_id='3963' data-nonce='ee750c7abc' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-3963 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-3963 jlk' data-task='unlike' data-post_id='3963' data-nonce='ee750c7abc' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-3963 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-3963 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Today, we are going to learn about number systems. A &#8220;number system&#8221; is defined here as &#8220;any notation for the representation of numerals or numbers.&#8221; We naturally use the decimal (base 10) system, meaning we use the numbers 0-9 to represent all the other numbers. The three types of number systems that we are going to talk about today are decimal, binary, and hexadecimal, but there are many more!<\/p>\n","protected":false},"author":29,"featured_media":3999,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1563],"tags":[],"ppma_author":[4478],"class_list":["post-3963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/hextable.png","authors":[{"term_id":4478,"user_id":29,"is_guest":0,"slug":"josh-woldstad","display_name":"Josh","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/b4b62729a3daba9bb76117db7130e81e?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Woldstad","last_name_2":"","first_name":"Josh","first_name_2":"","job_title":"","description":"I love Coding!"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/3963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=3963"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/3963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/3999"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=3963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=3963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=3963"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}