 Welcome to the session design of modern counter. At the end of this session students will be able to analyze and design modern counters. Modulus counter. Now before starting take a pause here and recall what is counter and types of counters. So counter is a digital circuit which counts number of events, objects, operations in terms of clock pulses which may be used in various applications in industries and there are different types of counters such as asynchronous counter, synchronous counter, up counter, down counter and a counter which has both facilities as up counting and down counting known as up down counter then modulus counter. So in today's session we are going to see modulus counters. The number of states through which the counter passes before returning to the starting state is called as a modulus of the counter. Modern counter means it is a counter circuit which passes through n number of states before returning to the starting state. And for mod n counter the number of lipflops required is calculated using equation n less than or equal to 2 raised to n. So let us see design steps in synchronous counter. Steps to design synchronous counters are first of all you have to find out number of lipflops required using the equation n less than or equal to 2 raised to n where capital n stands for number of states and small n stands for number of lipflops. In the next state we are writing consequence in the truth table and based on the truth table we are writing excitation table for selected lipflops and then we are drawing a K-map and obtaining the equation for lipflop inputs and hence we are drawing a logic circuit based on the obtained equation from the K-map. Now let us have an example here to design mod 3 counter. So mod 3 counter means it will go through 3 different states. So for 3 different states we require at least 2 lipflops because 2 raised to 2 will give us 4 different states. So the states let us consider as 0 0, 0 1 and 1 0. So if the counter is in a 0 0 state next state will be 0 1 and when it is in 0 1 state next state will be 1 0 and finally when it is in a 1 0 state the next state will be the starting state that is 0 0. So based on this state diagram let us write the state table but before that we have to write an excitation table as we are using J K-flip-flop here. The excitation table for the J K-flip-flop is as first column is state transition and next column is flip-flop inputs. Now in the state transition you can see this is the present state represented as Qn and next state is represented as Qn plus 1. So for 0 to 0 transition J K-input should be 0 do not care. For 0 to 1 transition J K-input should be 1 do not care and for 1 to 0 transition J K-input should be do not care 1 and for 1 to 1 transition J K-input should be do not care 0. So based on this excitation table we are writing state table for mod 3 counter. So which includes present state, next state and flip-flop excitation inputs. So here you can see present state which is a combination of two flip-flops Q2 and Q1 and the next state is nothing but Q2 and Q1 with n plus 1 represented as a next state and then we have flip-flop inputs for two J K-flip-flops as J2 K2 and J1 K1. So from present state to next state for Q2 0 to 0 the excitation input should be 0x for 0 to 1 it should be 1x for 1 to 0 it is x1 for 1 to x it is xx. For transition of first flip-flop from 0 to 1 it is 1x that is do not care for 1 to 0 it is x1 for 0 to 0 0x and for 1 to x it is xx that is do not care do not care according to this excitation table. Now in the next step we are writing K-map for all this flip-flop inputs. So here you can see for J2 we are getting output high that is 1 for 0 1 combination. So here in the K-map you can see 1 is written in the cell 1 and we have do not cares for this input combination 1 0 and 1 1. So marking this do not cares with the help of this do not care we can make a pair and that gives us J2 is equal to Q1. Similarly for the K2 we are getting output 1 for 1 0 combinations. So here we have entered 1 and other 3 are do not care conditions. So we have marked do not care in the respective cell and this gives us quad and quad gives us K2 is equal to 1. Similarly for the J1 we are getting output high for 0 0 and 2 do not cares as marked here and this will give us pair and equation J1 is equal to Q2 bar and for K1 we have K-map as this where we are getting output 1 for 0 1 and other are do not care conditions. So this is again giving us a quad. So K1 becomes 1 and based on this equation J2 is equal to Q1, K2 is equal to 1, J1 is equal to Q2 bar and K1 is equal to 1. So based on these equations we are drawing logic diagram here. For example if it is in a state 0 0 so 0 0 then as soon as we give the clock here so 0 is already passed to the J2 so it will not change the state of Q2. So Q2 remains 0 only but the Q2 bar is 1 so it will give 1 input to the J1 and that will change the Q1 output because it comes in a toggle mode as J1 and K1 are 1 1 to the next to that when next clock is given both triple up will change its input because J1, J2, K1, K2 are all 1 1 so it will toggle so it is nothing but next state and when next clock is given so it should repeat the cycle. So it will not go to the state 1 1 because as the Q1 is 0 and Q2 is 1 so 0 is already given to the J2 and here as Q2 is 1 and Q2 bar will be 0 that is given to the J1. So J1 and J2 will be 0 0 with respect to K1 and K2 1 1 there will be only change for the Q2 as J2 having input 1 so it will toggle the Q2 only will toggle and Q1 remains same so it comes to the first state as 0 0. So you can see here in the timing diagram so when first clock is given there will be change from the 0 0 to 0 1 to the next that 1 0 and after third clock again it repeats the cycle so this counter goes through 3 different states and works as a mod 3 counter. So in the timing diagram you can see here initially output is 0 0 when next clock is given then output will be 0 1 to the next to that clock we have 1 0 and when next clock is given instead of having the state as 1 1 it goes to 0 0 because of this excitation input given to the flip-lops it resets when next state comes that is 1 1. So in this way we can design mod encounter these are references thank you.