{"id":207,"date":"2023-10-14T14:47:45","date_gmt":"2023-10-14T14:47:45","guid":{"rendered":"https:\/\/www.zonetronik.com\/en\/?p=207"},"modified":"2023-10-14T14:47:45","modified_gmt":"2023-10-14T14:47:45","slug":"rs-d-and-jk-flip-flops","status":"publish","type":"post","link":"https:\/\/www.zonetronik.com\/en\/rs-d-and-jk-flip-flops\/","title":{"rendered":"The RS, D, and JK flip-flops"},"content":{"rendered":"<p>Flip-flops are widely used electronic components and are essential in most circuits. Therefore, it is crucial to have an in-depth understanding of their behavior. To simplify the course, I will use the IEC symbols for flip-flops (European standards) and not Anglo-Saxon symbols, for example.<\/p>\n<p>When an input is inverted (usually denoted with a &#8216;-&#8216; above the variable), I will symbolize it as flip-flop 1.<br \/>\nA flip-flop is asynchronous when it does not depend on the clock signal (Clock or CLK). As a result, a synchronous reset will only take effect on the active edge of the next clock cycle.<\/p>\n<h2>The RS Flip-Flop<\/h2>\n<p>The RS flip-flop is a very common logic circuit used in digital electronics to store a binary information bit. It consists of two NOR gates or two NAND gates that are connected in a way to create a positive feedback circuit. The RS flip-flop can be used as a simple storage element to memorize the state of a signal or as a synchronization element to synchronize different signals in an electronic system. However, the RS flip-flop can be prone to stability issues when used in high-speed applications, and it can also suffer from critical race problems if poorly designed.<\/p>\n<p>A very basic flip-flop. It has two inputs and two outputs.<\/p>\n<p>It is possible to add a clock to synchronize it.<\/p>\n<p><strong>Its symbol<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-208\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule3.png\" alt=\"bascule3\" width=\"217\" height=\"118\" \/><\/p>\n<p>We notice that the clock is active on the falling edge (indicated by the <strong>CLK<\/strong> or the small triangle on the pin, just like in a mathematical formula). By the way, I will define the clock: It is a regular symmetrical signal (equal time in the low state as in the high state. It is &#8216;square&#8217;). Synchronous flip-flops operate on its edges.<\/p>\n<p><strong>Its equivalent in combinational logic<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-209\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule5.png\" alt=\"bascule5\" width=\"181\" height=\"113\" \/><\/p>\n<p>The inversion is symbolized here by a small circle (the circle comes from Anglo-Saxon standards and the symbol of the gate from IEC standards&#8230; enough to confuse you. In principle, in IEC, inversion is symbolized by triangles).<\/p>\n<p><strong>Truth table<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-210\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule6.gif\" alt=\"bascule6\" width=\"77\" height=\"127\" \/><\/p>\n<p>The last line is a critical situation&#8230; at the same time, we&#8217;re asking the flip-flop to set itself to 1 and to set itself to 0&#8230; so we can&#8217;t know where we&#8217;ll end up (probably in the forbidden zone). Therefore, this state is FORBIDDEN!<\/p>\n<p><strong>Timing Diagram<\/strong><\/p>\n<p>A timing diagram is a time diagram. It allows you to see the evolution of the states of a flip-flop based on clock pulses.<br \/>\nIn the following timing diagram, CLK occurs on the rising edge.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-211\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule7.png\" alt=\"bascule\" width=\"300\" height=\"184\" \/><\/p>\n<h2>The D Flip-Flop<\/h2>\n<p>The D flip-flop is another type of logic circuit widely used in digital electronics to store a binary information bit. It is also made up of two logic gates, typically NAND gates or NOR gates, connected in a way to create a feedback circuit. However, unlike the RS flip-flop, the D flip-flop has a single input that controls the state of the circuit. When this input is activated, the D flip-flop stores the state of the input and holds it in memory until it is activated again. The D flip-flop is used in many applications, including storing addresses in memory circuits and synchronizing signals in signal processing circuits.<\/p>\n<p><strong>Symbol<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-212\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule8.png\" alt=\"bascule8\" width=\"217\" height=\"118\" \/><\/p>\n<p>The advantage compared to the RS flip-flop is that we cannot have a &#8220;forbidden&#8221; state.<\/p>\n<p><strong>Equivalent in combinational logic<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-213\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule9.png\" alt=\"bascule9\" width=\"269\" height=\"126\" \/><\/p>\n<p><strong>Truth table<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-214\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule10.gif\" alt=\"bascule10\" width=\"62\" height=\"79\" \/><\/p>\n<h2>The JK Flip-Flop<\/h2>\n<p>The JK flip-flop is a type of logic circuit that can be used as an extension of the RS flip-flop. It consists of two logic gates, typically NAND gates or NOR gates, as well as two inputs: J (set) and K (reset). When both J and K are set to 0, the output of the JK flip-flop remains unchanged. If J is activated, the output becomes 1, and if K is activated, the output becomes 0. However, if both J and K are activated at the same time, the output toggles between 0 and 1 with each clock pulse. The JK flip-flop is widely used in binary counting systems, shift register circuits, and synchronization circuits. It is also used for timing and pulse generation functions.<\/p>\n<p>We are now getting into something more challenging: the JK flip-flop<\/p>\n<p><strong>Symbol<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-215\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule11.png\" alt=\"bascule11\" width=\"226\" height=\"106\" \/><\/p>\n<p><strong>Combinational Logic<\/strong><\/p>\n<p>I will provide it later; it is very similar to that of the previous flip-flops.<br \/>\nComing soon, complete examples on:<\/p>\n<p>&#8211; Divider by two, by four, &#8230;<br \/>\n&#8211; Shift Register.<\/p>\n<p><strong>Truth table<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-216\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule13.gif\" alt=\"bascule13\" width=\"79\" height=\"135\" \/><\/p>\n<p>Here is an example<br \/>\nIn a divider by two, for example, using a D flip-flop<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-217\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule14.png\" alt=\"bascule14\" width=\"300\" height=\"267\" \/><\/p>\n<p>The chronogram<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-218\" src=\"https:\/\/www.zonetronik.com\/en\/wp-content\/uploads\/2023\/10\/bascule15.png\" alt=\"bascule15\" width=\"300\" height=\"185\" \/><\/p>\n<p>With a D flip-flop at hand, it becomes very simple to divide a frequency by 2, 4, &#8230;<br \/>\nHow does it work? With each clock pulse, the output Q takes on the value of D, which is&#8230; the inverse of Q!<\/p>\n<p><span style=\"color: #808080;\"><em>Source: daskoo.org | CC<\/em><\/span><br \/>\n<span style=\"color: #808080;\"><em>Image 74LS74 : wikimedia.org | (CC BY-SA 3.0)<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flip-flops are widely used electronic components and are essential in most circuits. Therefore, it is crucial to have an in-depth understanding of their behavior. To simplify the course, I will use the IEC symbols for flip-flops (European standards) and not Anglo-Saxon symbols, for example. When an input is inverted (usually denoted with a &#8216;-&#8216; above&hellip;&nbsp;<a href=\"https:\/\/www.zonetronik.com\/en\/rs-d-and-jk-flip-flops\/\" rel=\"bookmark\"><span class=\"screen-reader-text\">The RS, D, and JK flip-flops<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":219,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"off","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":"","iawp_total_views":48,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics"],"_links":{"self":[{"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":1,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":220,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/posts\/207\/revisions\/220"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/media\/219"}],"wp:attachment":[{"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zonetronik.com\/en\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}