{"id":54,"date":"2019-09-10T06:38:21","date_gmt":"2019-09-10T06:38:21","guid":{"rendered":"http:\/\/learnlearn.uk\/alevelcs\/?page_id=54"},"modified":"2020-09-22T01:12:34","modified_gmt":"2020-09-22T01:12:34","slug":"binary-coded-decimal","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/","title":{"rendered":"Binary Coded Decimal"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Introduction<\/h2>\n<div class=\"tabcontent\">\n\n<h2>What is Binary Coded Decimal<\/h2>\n<p>Binary Coded Decimal is a form of binary representation where each denary digit is converted individually into binary, rather than the whole number being converted as a large number.<\/p>\n<h3>Example 1 &#8211; the number 42<\/h3>\n<p>Normally this number would be converted directed to binary as <strong>00101010<\/strong>\u00a0 as 8 bit binary.<\/p>\n<table dir=\"ltr\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/><\/colgroup>\n<tbody>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:128}\"><strong>128<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:64}\"><strong>64<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:32}\"><strong>32<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:16}\"><strong>16<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:8}\"><strong>8<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:4}\"><strong>4<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:2}\"><strong>2<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\"><strong>1<\/strong><\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\">1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\">1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\">1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>However in binary coded decimal we would convert the number 4 to binary and the number 2 to binary, then simply concatenate(combine) the 2 numbers together<\/p>\n<p><strong>Binary 4<\/strong><\/p>\n<table dir=\"ltr\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/><\/colgroup>\n<tbody>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:8}\"><strong>8<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:4}\"><strong>4<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:2}\"><strong>2<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\"><strong>1<\/strong><\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\">1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Binary 2<\/strong><\/p>\n<table dir=\"ltr\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/>\n<col width=\"100\" \/><\/colgroup>\n<tbody>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:8}\"><strong>8<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:4}\"><strong>4<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:2}\"><strong>2<\/strong><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\"><strong>1<\/strong><\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:1}\">1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:3,&quot;3&quot;:0}\">0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Therefore 42 in BCD binary would be <strong>01000010<\/strong><\/p>\n\n<\/div><h2 class=\"tabtitle\">Why use BCD?<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Why use Binary Coded Decimal?<\/h3>\n<p>Binary coded decimal has 3 main advantages<\/p>\n<ul>\n<li>It is easier for a human to read large binary numbers than if the number is in pure binary<\/li>\n<li>It is simpler to create hardware than only counts in decimal and uses basic calculation (e.g. digital clocks, simple handheld calculators)<\/li>\n<li>Binary coded decimal removes the problem of floating point rounding errors, which makes is very useful for handling financial transactions.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n\n<\/div><h2 class=\"tabtitle\">BCD Clock Demo<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Binary Coded Decimal Clock Demonstration Project<\/h3>\n<p><a href=\"https:\/\/scratch.mit.edu\/projects\/327777518\/\">The Scratch project for this clock can be found here<\/a><\/p>\n<h3><iframe loading=\"lazy\" style=\"overflow: hidden;\" src=\"https:\/\/scratch.mit.edu\/projects\/327777518\/embed\/?autostart=true\u201d frameborder=\u201c0\u201d allowfullscreen\" width=\"800\" height=\"800\"><\/iframe><\/h3>\n\n<\/div><h2 class=\"tabtitle\">Financial systems<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Financial Systems<\/h3>\n<p>In binary systems decimals numbers are stored using a floating point representation. When representing fractions of a whole some numbers cannot be stored accurately using binary, due to the fractions not fitting perfectly within a binary base 2 system. This results in a floating point rounding error. In financial systems rounding errors are unacceptable and must be dealt within. For this reason binary coded decimal is used instead.<\/p>\n<p><strong>Floating point rounding example<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-915\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/floating-point-rounding-error.png\" alt=\"\" width=\"344\" height=\"145\" srcset=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/floating-point-rounding-error.png 344w, https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/floating-point-rounding-error-300x126.png 300w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/p>\n<p>Here is a great example of a floating point binary rounding error. This kind of error is not acceptable in financial transactions.<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/8fd70fe367\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n<\/div><h2 class=\"tabtitle\">Resources<\/h2>\n<div class=\"tabcontent\">\n\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/1Gu05JxCm6pcWXFs-rOCFaLuNdkW0g96ckBIOo2cvkN4\/edit?usp=sharing\">BCD Worksheet<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is Binary Coded Decimal Binary Coded Decimal is a form of binary representation where each denary digit is converted individually into binary, rather than the whole number being converted as a large number. Example 1 &#8211; the number 42 Normally this number would be converted directed to binary as 00101010\u00a0 as 8 bit binary.&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Binary Coded Decimal<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":70,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Binary Coded Decimal - A Level Computer Science<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Binary Coded Decimal - A Level Computer Science\" \/>\n<meta property=\"og:description\" content=\"What is Binary Coded Decimal Binary Coded Decimal is a form of binary representation where each denary digit is converted individually into binary, rather than the whole number being converted as a large number. Example 1 &#8211; the number 42 Normally this number would be converted directed to binary as 00101010\u00a0 as 8 bit binary.&hellip;&nbsp;Read More &raquo;Binary Coded Decimal\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\" \/>\n<meta property=\"og:site_name\" content=\"A Level Computer Science\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-22T01:12:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/floating-point-rounding-error.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\",\"name\":\"Binary Coded Decimal - A Level Computer Science\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#website\"},\"datePublished\":\"2019-09-10T06:38:21+00:00\",\"dateModified\":\"2020-09-22T01:12:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"A Level Computer Science Home\",\"item\":\"https:\/\/learnlearn.uk\/alevelcs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Binary Coded Decimal\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/\",\"name\":\"A Level Computer Science\",\"description\":\"CIE Specification\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/alevelcs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#organization\",\"name\":\"A Level Computer Science\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png\",\"width\":710,\"height\":98,\"caption\":\"A Level Computer Science\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Binary Coded Decimal - A Level Computer Science","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/","og_locale":"en_GB","og_type":"article","og_title":"Binary Coded Decimal - A Level Computer Science","og_description":"What is Binary Coded Decimal Binary Coded Decimal is a form of binary representation where each denary digit is converted individually into binary, rather than the whole number being converted as a large number. Example 1 &#8211; the number 42 Normally this number would be converted directed to binary as 00101010\u00a0 as 8 bit binary.&hellip;&nbsp;Read More &raquo;Binary Coded Decimal","og_url":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/","og_site_name":"A Level Computer Science","article_modified_time":"2020-09-22T01:12:34+00:00","og_image":[{"url":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/floating-point-rounding-error.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/","url":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/","name":"Binary Coded Decimal - A Level Computer Science","isPartOf":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#website"},"datePublished":"2019-09-10T06:38:21+00:00","dateModified":"2020-09-22T01:12:34+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/alevelcs\/binary-coded-decimal\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"A Level Computer Science Home","item":"https:\/\/learnlearn.uk\/alevelcs\/"},{"@type":"ListItem","position":2,"name":"Binary Coded Decimal"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/alevelcs\/#website","url":"https:\/\/learnlearn.uk\/alevelcs\/","name":"A Level Computer Science","description":"CIE Specification","publisher":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/alevelcs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/alevelcs\/#organization","name":"A Level Computer Science","url":"https:\/\/learnlearn.uk\/alevelcs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png","contentUrl":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2019\/09\/LearnLearnLogowhite.png","width":710,"height":98,"caption":"A Level Computer Science"},"image":{"@id":"https:\/\/learnlearn.uk\/alevelcs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/alevelcs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"What is Binary Coded Decimal Binary Coded Decimal is a form of binary representation where each denary digit is converted individually into binary, rather than the whole number being converted as a large number. Example 1 &#8211; the number 42 Normally this number would be converted directed to binary as 00101010\u00a0 as 8 bit binary.&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/54"}],"collection":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":13,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/54\/revisions"}],"predecessor-version":[{"id":916,"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/pages\/54\/revisions\/916"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/alevelcs\/wp-json\/wp\/v2\/media?parent=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}