{"id":28,"date":"2022-05-16T18:37:56","date_gmt":"2022-05-16T17:37:56","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/?page_id=28"},"modified":"2022-05-16T18:39:08","modified_gmt":"2022-05-16T17:39:08","slug":"binary","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/binary\/","title":{"rendered":"Binary"},"content":{"rendered":"<p><span data-contrast=\"auto\">Processors can only understand binary. Ultimately, everything that is processed by a computer is handled in one of two states, 1 or 0.<\/span><\/p>\n<p><span data-contrast=\"auto\">Many devices such as hair straighteners or games consoles make use of the following symbols:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-29\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183035\/GetImage-300x42.png\" alt=\"\" width=\"443\" height=\"62\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183035\/GetImage-300x42.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183035\/GetImage.png 624w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/p>\n<p><span data-contrast=\"auto\">The number 1 represents on and the number 0 represents off.<\/span><\/p>\n<h2 style=\"color:red\">Integers<\/h2>\n<p><span data-contrast=\"auto\">Binary is used to represent whole numbers so that they can be understood by the processor. An integer is a whole number.<\/span><\/p>\n<p><span data-contrast=\"auto\">Integers can be positive numbers or negative numbers. The number 173 can be represented in binary as:<\/span><\/p>\n<p><b><span data-contrast=\"auto\">10101101<\/span><\/b><\/p>\n<p><span data-contrast=\"auto\">Binary works using a number system that is based on powers of 2. To understand why 10101101 is the same as 173 look at the following table:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-30\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183654\/Screenshot-1-300x35.png\" alt=\"\" width=\"549\" height=\"64\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183654\/Screenshot-1-300x35.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183654\/Screenshot-1-768x91.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183654\/Screenshot-1-624x74.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183654\/Screenshot-1.png 913w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/p>\n<p><span data-contrast=\"auto\">When adding up all of the values that are on, the following sum is created:<\/span><\/p>\n<p><b><span data-contrast=\"auto\">128 + 32 + 8 + 4 + 1 = 173<\/span><\/b><\/p>\n<p><span data-contrast=\"auto\">In this example we are using 8 bits to represent a number. If we use 8 bits we can represent any number between 0 and 255.<\/span><\/p>\n<p><span data-contrast=\"auto\">If all of the values are off, the number is 0:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-31\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183724\/Screenshot-2-300x36.png\" alt=\"\" width=\"542\" height=\"65\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183724\/Screenshot-2-300x36.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183724\/Screenshot-2-768x91.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183724\/Screenshot-2-624x74.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183724\/Screenshot-2.png 911w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\n<p><span data-contrast=\"auto\">If all of the values are on, the number is 255:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-32\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183748\/Screenshot-3-300x36.png\" alt=\"\" width=\"542\" height=\"65\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183748\/Screenshot-3-300x36.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183748\/Screenshot-3-768x91.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183748\/Screenshot-3-624x74.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phshighercomputingscience\/uploads\/sites\/10042\/2022\/05\/16183748\/Screenshot-3.png 912w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\n<p><b><span data-contrast=\"auto\">128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Processors can only understand binary. Ultimately, everything that is processed by a computer is handled in one of two states, 1 or 0. Many devices such as hair straighteners or games consoles make use of the following symbols: The number 1 represents on and the number 0 represents off. Integers Binary is used to represent [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-28","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":2,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/28\/revisions"}],"predecessor-version":[{"id":34,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/pages\/28\/revisions\/34"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phshighercomputingscience\/wp-json\/wp\/v2\/media?parent=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}