{"id":11588,"date":"2015-12-08T09:15:47","date_gmt":"2015-12-08T17:15:47","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=11588"},"modified":"2015-12-07T16:26:02","modified_gmt":"2015-12-08T00:26:02","slug":"bringing-back-boolean-and-other-data-types","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/bringing-back-boolean-and-other-data-types\/","title":{"rendered":"Bringing Back Boolean (And Other) Data Types"},"content":{"rendered":"<p>Last year, James Colvin wrote <a href=\"https:\/\/digilent.com\/blog\/index.php\/true-or-false-boolean-is-a-data-type\/\">a guide to understanding the different data types that are commonly used<\/a> by programmers. While he focused specifically on Boolean data, he also talks about others. Since it&#8217;s been a while, we thought it was time to revisit his guide!<\/p>\n<p>&#8220;In a broad sense, data types are ways to represent different kinds of information in a computer processor or FPGA. Today we will be discussing booleans, integers, chars, and floating point numbers, all of which are commonly known as primitive data types,&#8221; said James.<\/p>\n<p>Okay, a quick run-through.<\/p>\n<p>Boolean data is that which represents &#8220;true&#8221; or &#8220;false&#8221; information. This is represented by ones and zeroes.\u00a0A character,or a char, is an array of bits that define the\u00a0visual representation of a symbol. When you see ASCII characters, this is what they are &#8212; the appropriate array of bits.\u00a0Integers, usually shortened to just &#8220;int&#8221; in programming, are the standard way to store numbers within your code. These are whole numbers, so any decimals will be truncated. Finally, there is the floating point data type. A &#8220;float&#8221; accepts up to seven decimal places via a type of scientific notation that uses of 32 bits, eight of which are devoted to the decimals.<\/p>\n<figure id=\"attachment_4246\" aria-describedby=\"caption-attachment-4246\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4246\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-600x77.png\" alt=\"A breakdown of a 32 bit float -- Image from this Wikipedia page by Fresheneesz\" width=\"600\" height=\"77\" data-wp-pid=\"4246\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-600x77.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_-225x29.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/12\/800px-Float_example.svg_.png 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-4246\" class=\"wp-caption-text\">A breakdown of a 32 bit float &#8212; Image from this Wikipedia page by Fresheneesz.<\/figcaption><\/figure>\n<p>All of these data types have their specific uses and applications, it&#8217;s just a matter of deciding which is right for your programming endeavor! For more in-depth informations, see James&#8217; <a href=\"https:\/\/digilent.com\/blog\/index.php\/true-or-false-boolean-is-a-data-type\/\">original post<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-11588 jlk' data-task='like' data-post_id='11588' data-nonce='ac068a413b' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-11588 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-11588 jlk' data-task='unlike' data-post_id='11588' data-nonce='ac068a413b' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-11588 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-11588 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Learn more about data types!<\/p>\n","protected":false},"author":7,"featured_media":4243,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1563],"tags":[],"ppma_author":[4464],"class_list":["post-11588","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\/boolean-true-false.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4464,"user_id":7,"is_guest":0,"slug":"amber_mear","display_name":"Amber Mear","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/d0fc56ab4035f79884675bde2a948e84c1d14dd33b730b4c142dde6f1a962395?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/11588","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\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=11588"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/11588\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/4243"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=11588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=11588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=11588"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=11588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}