{"id":1581,"date":"2014-07-15T13:27:39","date_gmt":"2014-07-15T20:27:39","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=1581"},"modified":"2016-01-28T11:32:03","modified_gmt":"2016-01-28T19:32:03","slug":"shift-registers","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/shift-registers\/","title":{"rendered":"Shift Registers"},"content":{"rendered":"<p>Earlier, I made a post on how a shift register is <a title=\"Operating a Shift Register\" href=\"https:\/\/digilent.com\/blog\/index.php\/beyond-theory-operating-a-shift-register\/\" target=\"_blank\">operated in practice<\/a>. But what exactly can a shift register be used for and how does it work? As always, the answer will depend on what you are trying to do (yes, we do have to play by reality&#8217;s rules).<\/p>\n<p>&nbsp;<\/p>\n<p>The main idea behind shift registers is that data signals, either high or low, can be shifted through ports inside the integrated circuit. This, in a sense, can be thought of as\u00a0a projector reel where there is information on each section of the reel, but only part of the reel is able to be displayed through the projector at one particular time.<\/p>\n<figure style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/previewcf.turbosquid.com\/Preview\/2014\/05\/27__08_24_22\/projector4.jpge18063a1-942e-44de-ad9d-c49ff3d18e44Larger.jpg\" alt=\"\" width=\"600\" height=\"600\" \/><figcaption class=\"wp-caption-text\">Movie Reel Projector.<\/figcaption><\/figure>\n<p>With this in mind, we can look at the three main types of shift registers that are commonly used: a serial-in serial-out\u00a0(SISO) shift register, a serial-in parallel-out (SIPO) shift register, and a parallel-in serial-out (PISO) shift register.<\/p>\n<p>&nbsp;<\/p>\n<p>The SISO shift register is able to store (or in the reel projector analogy, cover up) information based on how big of a\u00a0shift register it is. For example if it was an 8-bit register, it could store 8 bits of information. This means that\u00a0when you input data into the SISO, you will have to wait for 8 data shifts (also known as clock pulses), before the first\u00a0piece of information is output\/displayed on the projector. Because this is a serial-out shift register, only one piece of information is displayed at a time, and once the second piece of information is shifted to the output position, the first\u00a0piece of information is lost. The SISO shift registers can be used in calculators to store multiple binary numbers before\u00a0shifting them out so they can be added together.<\/p>\n<figure id=\"attachment_1582\" aria-describedby=\"caption-attachment-1582\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/IMG_0431.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1582\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/IMG_0431-1024x768.jpg\" alt=\"A practical use for a SISO shift register\" width=\"600\" height=\"450\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/IMG_0431-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/IMG_0431-300x225.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-1582\" class=\"wp-caption-text\">A practical use for a SISO shift register<\/figcaption><\/figure>\n<p>The SIPO shift register, the kind I used in my <a title=\"Instructable\" href=\"http:\/\/www.instructables.com\/id\/Operating-a-Shift-Register\/\" target=\"_blank\">Instructable<\/a>, takes a serial, one-at-a-time stream of data and then displays the information along multiple outputs. There are two ways that these types of shift registers can be operated.\u00a0One way is to display the inputs on the outputs as they come in, creating a type of reel projector that shows 8 pictures,\u00a0or pieces of information, at the same time (if it is an 8 bit shift register). The other, and in my opinion, more useful option is to not display any of the input information until all of the flip-flops in the shift register are filled \u00a0and then\u00a0display the inputs on their respective output simultaneously. A SIPO shift register is useful when you want to control\/give input to multiple components but do not want to individually dedicated wires from your microcontroller to each of your components.<\/p>\n<figure id=\"attachment_1584\" aria-describedby=\"caption-attachment-1584\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/SIPO-demo.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1584\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/SIPO-demo-1024x768.jpg\" alt=\"Use for a serial-in parallel-out shift register\" width=\"600\" height=\"450\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/SIPO-demo-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/SIPO-demo-300x225.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-1584\" class=\"wp-caption-text\">Use for a serial-in parallel-out shift register<\/figcaption><\/figure>\n<p>Finally, the PISO shift register takes multiple inputs simultaneously and outputs them serially. While this does not follow\u00a0the reel projector analogy very well, once all of the inputs have been loaded into the shift register, the PISO can then be thought of as a serial-in serial out shift register, except you do not have to wait for the input to reach the lone output\u00a0port. This is useful for taking multiple readings simultaneously (e.g.,\u00a0multiple button\u00a0readings) and then feeding the information on one line to a microcontroller.<\/p>\n<figure id=\"attachment_1583\" aria-describedby=\"caption-attachment-1583\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1583\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-1024x768.jpg\" alt=\"PISO and SIPO shift registers in combination.\" width=\"600\" height=\"450\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-1024x768.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-300x225.jpg 300w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-600x450.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-800x600.jpg 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2014\/07\/PISO_SIPO-combo-1200x900-cropped.jpg 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-1583\" class=\"wp-caption-text\">PISO and SIPO shift registers in combination.<\/figcaption><\/figure>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-1581 jlk' data-task='like' data-post_id='1581' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-1581 lc'>+1<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-1581 jlk' data-task='unlike' data-post_id='1581' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-1581 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-1581 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Earlier, I made a post on how a shift register is operated in practice. But what exactly can a shift register be used for and how does it work? As always, the answer will depend on what you are trying to do (yes, we do have to play by reality&#8217;s rules).<\/p>\n","protected":false},"author":17,"featured_media":1583,"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":[4469],"class_list":["post-1581","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\/07\/PISO_SIPO-combo.jpg","jetpack_sharing_enabled":true,"authors":[{"term_id":4469,"user_id":17,"is_guest":0,"slug":"jamescolvin","display_name":"James Colvin","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/8aa85f7d11711acc7e571e1ed26c901b614a7064a2e15e522f54d9f26792ea9e?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\/1581","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\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=1581"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/1581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/1583"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=1581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=1581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=1581"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}