{"id":2628,"date":"2018-01-12T09:53:10","date_gmt":"2018-01-12T09:53:10","guid":{"rendered":"https:\/\/old.staging-teachcomputerscienceuk.kinsta.cloud\/?p=276"},"modified":"2024-07-24T11:26:29","modified_gmt":"2024-07-24T11:26:29","slug":"converting-binary-to-hexadecimal","status":"publish","type":"post","link":"https:\/\/teachcomputerscience.com\/converting-binary-to-hexadecimal\/","title":{"rendered":"Converting Binary to Hexadecimal"},"content":{"rendered":"<div class=\"gb-container gb-container-3589f5e0 upsell-block\"><div class=\"gb-inside-container\">\n<div class=\"gb-grid-wrapper gb-grid-wrapper-cf1fc142\">\n<div class=\"gb-grid-column gb-grid-column-fbbe2eba\"><div class=\"gb-container gb-container-fbbe2eba\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-76725455 gb-headline-text\">KS3 Hexadecimal System (14-16 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-1ddcc244\">\n\n<a class=\"gb-button gb-button-c740fad9 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/ks3\/data-representation\/hexadecimal-system\/\">View KS3 Hexadecimal System Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n\n<div class=\"gb-grid-column gb-grid-column-4801228f\"><div class=\"gb-container gb-container-4801228f\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-8f0327bb gb-headline-text\">A-Level Binary Resources (16-18 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-bb8ce664\">\n\n<a class=\"gb-button gb-button-c7a5b692 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/a-level\/data-types-data-structures-and-algorithms\/binary\/\">View A-Level Binary Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n<\/div>\n<\/div><\/div>\n\n<h2>Binary Numbering System<\/h2>\n<p>Binary is a base 2 numbering system which is made up of two numbers: 0 and 1.&nbsp; 0 means OFF and 1 means ON.&nbsp; The computer\u2019s central processing unit (CPU) only recognizes these two states \u2013 ON and OFF.&nbsp; It is the foundation for all binary code, which is used in computer and digital systems.<\/p>\n<h2>Bits and Bytes<\/h2>\n<p>A binary digit called bit is the smallest unit of data in a computer.&nbsp; Each bit has a single value which is either 0 or 1.&nbsp; 8 bits (b) is equivalent to 1 byte (B).<\/p>\n<h2>Hexadecimal Numbering System<\/h2>\n<p>Hexadecimal is a base 16 numbering system which is made up of 16 digits: 0 \u2013 9 and six more, which is A through F.<\/p>\n<h2>Uses of Hexadecimal<\/h2>\n<p>Hexadecimal numbering system is often used by programmers to simplify the binary numbering system.&nbsp; Since 16 is equivalent to 2<sup>4<\/sup>, there is a linear relationship between the numbers 2 and 16.&nbsp; This means that one hexadecimal digit is equivalent to four binary digits.&nbsp; Computers use binary numbering system while humans use hexadecimal numbering system to shorten binary and make it easier to understand.<\/p>\n<h2>Conversion from Binary to Hexadecimal<\/h2>\n<p>Conversion can be done in two ways:<\/p>\n<h3>Basic Conversion<\/h3>\n<p>This is used for binary numbers with four or less digits.<\/p>\n<ol>\n<li><strong>Start with four binary numbers to convert.<\/strong> If the binary has less than 4 digits, just add zeroes to the front to make it 4 digits. <em>For example: 1010. If you have 01, make it 0001.&nbsp;<\/em><\/li>\n<li><strong>Put the binary number on the power of 2 columns<\/strong> as follows:<br>\n<table class=\"rcp-table\">\n<tbody>\n<tr>\n<th>Exponent<\/th>\n<td>2<sup>3<\/sup><\/td>\n<td>2<sup>2<\/sup><\/td>\n<td>2<sup>1<\/sup><\/td>\n<td>2<sup>0<\/sup><\/td>\n<\/tr>\n<tr>\n<th>Value<\/th>\n<td>8<\/td>\n<td>4<\/td>\n<td>2<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<th>Binary<\/th>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li><strong>Take the corresponding value of each binary digit equal to 1 and add to get the total value<\/strong>. The total value corresponds to the decimal equivalent.Total value = (8 + 2) = 10So binary number 1010 is 10 in decimal number.<\/li>\n<li><strong>Convert decimal to hexadecimal.<\/strong>Decimal number 10 is A in hexadecimal.&nbsp; Refer to the table below.So binary number 1010 is equivalent to A in hexadecimal.<br>\n<table class=\"rcp-table\">\n<tbody>\n<tr>\n<th>Hexadecimal<\/th>\n<th>Decimal<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>6<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>7<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>8<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>9<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>10<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>11<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>12<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>13<\/td>\n<\/tr>\n<tr>\n<td>E<\/td>\n<td>14<\/td>\n<\/tr>\n<tr>\n<td>F<\/td>\n<td>15<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ol>\n<h3>Conversion of Long Binary Numbers<\/h3>\n<p>This is used for binary numbers with more than four digits.<\/p>\n<ol>\n<li><strong>Break the string of binary numbers into groups of four, from right to left<\/strong>. If the leftmost binary has less than 4 digits, just add zeroes to the front to make it 4 digits.Example: 1110110010100111 1011 0010 1001(0011) (1011) (0010) (1001)<\/li>\n<li><strong>Convert each group at a time using the Basic Conversion method discussed earlier.<\/strong>0011 = (2 + 1) = 31011 = (8 + 2 + 1) = 11 = B0010 = 2<br>\n1001 = (8+1) = 9<\/li>\n<li><strong>Put together the converted value of each group<\/strong>.So binary number 11101100101001 is 3B29 in hexadecimal.<\/li>\n<\/ol>\n<h2>Conversion from Hexadecimal to Binary<\/h2>\n<p>Conversion can be done by converting each hexadecimal digit to 4 binary digits based on the following table:<\/p>\n<table class=\"rcp-table\">\n<tbody>\n<tr>\n<th>Hexadecimal<\/th>\n<th>Binary<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0000<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0001<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>0010<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>0011<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>0100<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>0101<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>0110<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>0111<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1000<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>1001<\/td>\n<\/tr>\n<tr>\n<td>A<\/td>\n<td>1010<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>1011<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>1100<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>1101<\/td>\n<\/tr>\n<tr>\n<td>E<\/td>\n<td>1110<\/td>\n<\/tr>\n<tr>\n<td>F<\/td>\n<td>1111<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Example: 3B29, convert each digit as follows:<br>\n3 is converted to 0011<br>\nB is converted to 1011<br>\n2 is converted to 0010<br>\n9 is converted to 1001<br>\nSo <strong>hexadecimal number 3B29 is equivalent to 0011101100101001 in binary<\/strong>.<\/p>\n\n\n<h3 class=\"gb-headline gb-headline-52c30807 gb-headline-text\">Further Readings:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Hexadecimal\" target=\"_blank\" rel=\"noopener\">Hexadecimal<\/a><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/001-AI.png\" alt=\"Converting binary to hexadecimal involves changing number systems from base 2 to base 16\" class=\"wp-image-5769\" width=\"283\" height=\"283\" title=\"\" srcset=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/001-AI.png 512w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/001-AI-150x150.png 150w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/001-AI-300x300.png 300w\" sizes=\"auto, (max-width: 283px) 100vw, 283px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Binary Numbering System Binary is a base 2 numbering system which is made up of two numbers: 0 and 1.&nbsp; 0 means OFF and 1 means ON.&nbsp; The computer\u2019s central processing unit (CPU) only recognizes these two states \u2013 ON and OFF.&nbsp; It is the foundation for all binary code, which is used in computer &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Converting Binary to Hexadecimal\" class=\"read-more button\" href=\"https:\/\/teachcomputerscience.com\/converting-binary-to-hexadecimal\/\" aria-label=\"Read more about Converting Binary to Hexadecimal\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[27],"tags":[204,47],"class_list":["post-2628","post","type-post","status-publish","format-standard","hentry","category-data-representation","tag-article","tag-hide-old-upsell","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"acf":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/comments?post=2628"}],"version-history":[{"count":2,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2628\/revisions"}],"predecessor-version":[{"id":607167,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/2628\/revisions\/607167"}],"wp:attachment":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/media?parent=2628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/categories?post=2628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/tags?post=2628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}