{"id":711,"date":"2022-01-25T05:55:23","date_gmt":"2022-01-25T05:55:23","guid":{"rendered":"http:\/\/learnlearn.uk\/igcsecs\/?page_id=711"},"modified":"2022-01-25T06:00:25","modified_gmt":"2022-01-25T06:00:25","slug":"binary-shifts","status":"publish","type":"page","link":"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/","title":{"rendered":"Binary Shifts"},"content":{"rendered":"<div class=\"responsive-tabs\">\n<h2 class=\"tabtitle\">Intro<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Binary Shifts<\/h3>\n<div class=\"nv-iframe-embed\">\n<div class=\"container-lazyload preview-lazyload container-youtube js-lazyload--not-loaded\"><a href=\"https:\/\/youtu.be\/G-9fwJbgRjA\" class=\"lazy-load-youtube preview-lazyload preview-youtube\" data-video-title=\"Binary Shifts Tutorial\" title=\"Play video &quot;Binary Shifts Tutorial&quot;\">https:\/\/youtu.be\/G-9fwJbgRjA<\/a><noscript>Video can&#8217;t be loaded because JavaScript is disabled: <a href=\"https:\/\/youtu.be\/G-9fwJbgRjA\" title=\"Binary Shifts Tutorial\">Binary Shifts Tutorial (https:\/\/youtu.be\/G-9fwJbgRjA)<\/a><\/noscript><\/div>\n<\/div>\n\n<\/div><h2 class=\"tabtitle\">Logical Shifts<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Logical Left Shift<\/h3>\n<p><a href=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1445 alignleft\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift-300x64.png\" alt=\"\" width=\"300\" height=\"64\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>In a left shift each bit is simply moved to the left with the empty space on the right replaced with zero.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>000110<br \/>\n&lt;&lt; 2<br \/>\n011000<\/p>\n<p>Notice the ones have moved along 2 spaces<\/p>\n<hr \/>\n<h3>Logical Right Shift<\/h3>\n<p><a href=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/logical-right-shift.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1446\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/logical-right-shift-300x64.png\" alt=\"\" width=\"300\" height=\"64\" \/><\/a><\/p>\n<p>In a logical right shift the bits are shifted to the right and the most significant bit(empty bit to the left ) is replace with zero. The least significant bit(Any bit falling off the right) is discarded<\/p>\n<p><strong>Example<\/strong><\/p>\n<pre>0011001\r\n&gt;&gt;1\r\n0001100<\/pre>\n<div class=\"arconix-box arconix-box-gray\"><div class=\"arconix-box-content\">\n<p>Some programming languages don&#8217;t have an in-built logical right shift, they only have an arithmetic right shift.<\/p>\n<\/div><\/div>\n\n<\/div><h2 class=\"tabtitle\">Arithmetic Shifts<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Arithmetic Left Shift<\/h3>\n<h3><a href=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1445 alignnone\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift-300x64.png\" alt=\"\" width=\"300\" height=\"64\" \/><\/a><\/h3>\n<p>Arithmetic left shifts work the same as logical left shifts. The bit is shifted to the left (the sign bit is discarded) with zeroes add at the right hand end.<\/p>\n<p>Example<\/p>\n<p>000110<br \/>\n&lt;&lt; 2<br \/>\n011000<\/p>\n<hr \/>\n<h3>Arithmetic Right Shift<\/h3>\n<p><a href=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/arithmetic-right-shift.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1447\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/arithmetic-right-shift-300x63.png\" alt=\"\" width=\"300\" height=\"63\" \/><\/a><\/p>\n<p>In an arithmetic right shift the bit is shifted to the right but the <strong>most significant bit is copied<\/strong> to the next most significant bit position on the left.<\/p>\n<p>This is used when the most significant bit is the sign bit (1s\/2s Compliment) indicating + \/ &#8211; value. The least significant bit is discarded.<\/p>\n<p><strong>Example 1<\/strong><\/p>\n<pre>1011\r\n&gt;&gt;1\r\n1101<\/pre>\n<p><strong>Example 2<\/strong><\/p>\n<p>10110100<br \/>\n&gt;&gt;3<br \/>\n11110110<\/p>\n\n<\/div><h2 class=\"tabtitle\">Cyclic Shift<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Cyclic Shift<\/h3>\n<p><a href=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/Cyclic-Shift.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1448\" src=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/Cyclic-Shift-300x87.png\" alt=\"\" width=\"300\" height=\"87\" \/><\/a><\/p>\n<p>These shifts can be performed either left or right. No data is discarded as the bit that falls off one end is added to the other end.<\/p>\n<p><strong>Example\u00a0<\/strong><\/p>\n<pre>10110011\r\nShift 3 Right\r\n01110110\r\n\r\n\r\n\r\n<\/pre>\n\n<\/div><h2 class=\"tabtitle\">Resources<\/h2>\n<div class=\"tabcontent\">\n\n<h3>Resources<\/h3>\n<p><a href=\"https:\/\/docs.google.com\/presentation\/d\/1M072XDl4GQ0vT2lOw2UbSuVOrXldqMOQ2qfRGMPnLvE\/edit?usp=sharing\">Teacher Presentation<\/a><\/p>\n<p><a href=\"https:\/\/quizizz.com\/admin\/quiz\/5c632e98a6b214001b454c47\/binary-shift\">Binary Shift Quizizz<\/a><\/p>\n<p><a href=\"https:\/\/docs.google.com\/document\/d\/1-FSduadpJWqW8DI7goYTd1h3wg1bcJRLRdajsxeuJ1M\/edit?usp=sharing\">Binary Shifts, Bitwise Operations &amp; Binary Manipulation Worksheet<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Past Paper Exam Questions<\/h3>\n<p><a href=\"https:\/\/pastpapers.papacambridge.com\/viewer\/caie\/cambridge-upper-secondary-igcse-computer-science-0478-2016-nov-0478-w16-qp-12-pdf\">0478\/12 &#8211; Paper 1 Theory October\/November 2016 Qn5<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Binary Shifts https:\/\/youtu.be\/G-9fwJbgRjAVideo can&#8217;t be loaded because JavaScript is disabled: Binary Shifts Tutorial (https:\/\/youtu.be\/G-9fwJbgRjA) Logical Left Shift &nbsp; &nbsp; In a left shift each bit is simply moved to the left with the empty space on the right replaced with zero. Example 000110 &lt;&lt; 2 011000 Notice the ones have moved along 2 spaces Logical&hellip;&nbsp;<a href=\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Binary Shifts<\/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 Shifts | IGCSE Computer Science | Learnlearn.uk<\/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\/igcsecs\/binary-shifts\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Binary Shifts | IGCSE Computer Science | Learnlearn.uk\" \/>\n<meta property=\"og:description\" content=\"Binary Shifts https:\/\/youtu.be\/G-9fwJbgRjAVideo can&#8217;t be loaded because JavaScript is disabled: Binary Shifts Tutorial (https:\/\/youtu.be\/G-9fwJbgRjA) Logical Left Shift &nbsp; &nbsp; In a left shift each bit is simply moved to the left with the empty space on the right replaced with zero. Example 000110 &lt;&lt; 2 011000 Notice the ones have moved along 2 spaces Logical&hellip;&nbsp;Read More &raquo;Binary Shifts\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/\" \/>\n<meta property=\"og:site_name\" content=\"IGCSE Computer Science\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-25T06:00:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift-300x64.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\/igcsecs\/binary-shifts\/\",\"url\":\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/\",\"name\":\"Binary Shifts | IGCSE Computer Science | Learnlearn.uk\",\"isPartOf\":{\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#website\"},\"datePublished\":\"2022-01-25T05:55:23+00:00\",\"dateModified\":\"2022-01-25T06:00:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"IGCSE Computer Science Course\",\"item\":\"https:\/\/learnlearn.uk\/igcsecs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Binary Shifts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#website\",\"url\":\"https:\/\/learnlearn.uk\/igcsecs\/\",\"name\":\"IGCSE Computer Science\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnlearn.uk\/igcsecs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#organization\",\"name\":\"IGCSE Computer Science\",\"url\":\"https:\/\/learnlearn.uk\/igcsecs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnlearn.uk\/igcsecs\/wp-content\/uploads\/sites\/23\/2020\/08\/LearnLearnLogowhitenew.png\",\"contentUrl\":\"https:\/\/learnlearn.uk\/igcsecs\/wp-content\/uploads\/sites\/23\/2020\/08\/LearnLearnLogowhitenew.png\",\"width\":710,\"height\":98,\"caption\":\"IGCSE Computer Science\"},\"image\":{\"@id\":\"https:\/\/learnlearn.uk\/igcsecs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Binary Shifts | IGCSE Computer Science | Learnlearn.uk","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\/igcsecs\/binary-shifts\/","og_locale":"en_GB","og_type":"article","og_title":"Binary Shifts | IGCSE Computer Science | Learnlearn.uk","og_description":"Binary Shifts https:\/\/youtu.be\/G-9fwJbgRjAVideo can&#8217;t be loaded because JavaScript is disabled: Binary Shifts Tutorial (https:\/\/youtu.be\/G-9fwJbgRjA) Logical Left Shift &nbsp; &nbsp; In a left shift each bit is simply moved to the left with the empty space on the right replaced with zero. Example 000110 &lt;&lt; 2 011000 Notice the ones have moved along 2 spaces Logical&hellip;&nbsp;Read More &raquo;Binary Shifts","og_url":"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/","og_site_name":"IGCSE Computer Science","article_modified_time":"2022-01-25T06:00:25+00:00","og_image":[{"url":"https:\/\/learnlearn.uk\/alevelcs\/wp-content\/uploads\/sites\/20\/2021\/01\/left-shift-300x64.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\/igcsecs\/binary-shifts\/","url":"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/","name":"Binary Shifts | IGCSE Computer Science | Learnlearn.uk","isPartOf":{"@id":"https:\/\/learnlearn.uk\/igcsecs\/#website"},"datePublished":"2022-01-25T05:55:23+00:00","dateModified":"2022-01-25T06:00:25+00:00","breadcrumb":{"@id":"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnlearn.uk\/igcsecs\/binary-shifts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"IGCSE Computer Science Course","item":"https:\/\/learnlearn.uk\/igcsecs\/"},{"@type":"ListItem","position":2,"name":"Binary Shifts"}]},{"@type":"WebSite","@id":"https:\/\/learnlearn.uk\/igcsecs\/#website","url":"https:\/\/learnlearn.uk\/igcsecs\/","name":"IGCSE Computer Science","description":"","publisher":{"@id":"https:\/\/learnlearn.uk\/igcsecs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnlearn.uk\/igcsecs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/learnlearn.uk\/igcsecs\/#organization","name":"IGCSE Computer Science","url":"https:\/\/learnlearn.uk\/igcsecs\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/learnlearn.uk\/igcsecs\/#\/schema\/logo\/image\/","url":"https:\/\/learnlearn.uk\/igcsecs\/wp-content\/uploads\/sites\/23\/2020\/08\/LearnLearnLogowhitenew.png","contentUrl":"https:\/\/learnlearn.uk\/igcsecs\/wp-content\/uploads\/sites\/23\/2020\/08\/LearnLearnLogowhitenew.png","width":710,"height":98,"caption":"IGCSE Computer Science"},"image":{"@id":"https:\/\/learnlearn.uk\/igcsecs\/#\/schema\/logo\/image\/"}}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"learnlearnadmin","author_link":"https:\/\/learnlearn.uk\/igcsecs\/author\/learnlearnadmin\/"},"rttpg_comment":0,"rttpg_category":null,"rttpg_excerpt":"Binary Shifts https:\/\/youtu.be\/G-9fwJbgRjAVideo can&#8217;t be loaded because JavaScript is disabled: Binary Shifts Tutorial (https:\/\/youtu.be\/G-9fwJbgRjA) Logical Left Shift &nbsp; &nbsp; In a left shift each bit is simply moved to the left with the empty space on the right replaced with zero. Example 000110 &lt;&lt; 2 011000 Notice the ones have moved along 2 spaces Logical&hellip;&nbsp;Read&hellip;","_links":{"self":[{"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/pages\/711"}],"collection":[{"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":2,"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/pages\/711\/revisions"}],"predecessor-version":[{"id":716,"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/pages\/711\/revisions\/716"}],"wp:attachment":[{"href":"https:\/\/learnlearn.uk\/igcsecs\/wp-json\/wp\/v2\/media?parent=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}