 Hello everyone, I am Dr. Asha Thurngay and today we are going to discuss state diagram and state table for sequence detector using Moore model. At the end of this session, you will be able to draw state diagram and state table for the non-overlapping type sequence detector using Moore machine model. These are the contents we will be covering in this session. Now, before moving ahead, pause this video and try to tell what is sequence detector? Well, a sequence detector is a sequential state machine which takes an input bit stream and generates an output logic 1 whenever the target sequence has been detected. Depending upon the method used to detect the sequence, sequence detector are of two types non-overlapping and overlapping type. In non-overlapping sequence detector, there is no overlapping between the bits of one sequence with the bits of next sequence. In an overlapping sequence detector, one or more than one bits of one sequence can become the part of the next sequence that is there is some sort of overlapping among the sequence. Now, consider the example of a sequence detector to detect a sequence 101. First, consider the non-overlapping case. Let us assume that this is the input bit stream that is available. So, as per the sequence, once the complete sequence 101 is received, output bit becomes 1. So, let us try to trace the input. So, this is a 0 bit. So, it is not a start of a sequence. This is 1, it can be possibly the start of the sequence, but next bit immediately is 1. So, here the sequence got broken. So, again this one is assumed to be the start of the bit and then we will again the sequence is traced. So, 101. So, here the sequence received is complete. So, this is the last bit of the sequence, hence the output is made 1. Next, the next bit received is 0. So, this is not the start of the bit. So, again the next bit received is 1. So, this can be possibly the start of the sequence. So, 101. So, here the sequence is complete. So, output becomes again 1. So, this is the last bit of the sequence. This particular 101. Again the next incoming bit is 1. So, again this is the start of the sequence. So, 101. So, here this is the end of the sequence. Again output bit is made 1. So, you can see here the last bit and the first bit of the next sequence there is no overlapping. It means the next sequence starts after the end of the previous sequence. So, there is no overlapping between the bits of the first sequence and the next sequence. On the other hand, consider the overlapping case. Let us assume this is the input bit stream. So, again 0 it is not the start of the sequence 1 possibly, but the next bit is 1. So, we will not assume this as the start of the sequence. So, 1 this can be the start of the sequence 101. So, here the sequence is complete. So, output is made 1. This is the last bit of the sequence 101. Similarly, now this one bit can act as a first bit for the next sequence. So, here the next sequence starts from the same bit. So, this is 101. So, this is the end of the sequence this 101 and output is made 1. So, this is the last bit for the sequence this 101. Similarly, this one can again be treated as the start bit of the next sequence. So, this is the first bit of the next sequence. So, 101 and the output is made 1 again. So, this is the last bit of this particular sequence. Similarly, the next bit is again 1. So, this cannot be the start bit for the next sequence. So, let us assume this as the start bit. So, 101. So, finally this is the last bit of the sequence 101 and the output is made 1. So, you can see here in these 2 cases 2 to 3 cases here the last bit of the previous sequence is acting as the first bit of the next sequence. That is here 1 bit overlap is taking place thus this method is known as a overlapping type. So, 1 or more than 1 bits can overlap here. Now, let us see how the state diagram for the sequence detector using Moore model is obtained. Let us consider an example to detect the sequence 101 using the Moore model for non-overlapping type. Now, as shown here the number of states required to detect a sequence is always one unit more than the number of bits used in the sequence. For example, here the sequence has 4 bits. So, the total number of states required to implement this sequence detector for Moore model is 4 plus 1 that is total of 5 states required. Now, we know that in Moore model output depends only on the present state. So, output is specified here along with the state itself. In Moore model for a sequence detector the output is becomes high in the last state only. So, for all other states output is 0. Now, initially as soon as you apply the reset the initial state is obtained that is it moves into the S0 state. Now, consider the input bit stream received is as per the sequence. So, whenever it is in state S0 if input bit is 1 it moves to the next state. The next bit obtained if it is 0 it moves to the next state again. Let us assume the next state again obtained is the third bit. So, it will move again to the next bit and finally, the fourth bit obtained is 1. So, it moves to the next state. So, here if the incoming bit stream is as per the sequence always the state transition takes place from the one state to its immediate adjacent state. So, S0 is waiting for the first bit, S1 is waiting for the second bit of the stream, S2 is waiting for the third bit, S3 is waiting for the fourth bit of the sequence. And once all the 4 bits are received finally, in the S4 bit the output becomes 1. So, this is the first step. Now, again consider the individual state S0. What else if the first bit arriving is instead of 1 it is 0. So, here no start of the sequence will take place and the state will remain in the same state. So, here the next state is same as the present state it will remain in the same state. So, whenever in S0 if input is 0 the next state is S0 only. Now, let us assume that I have received 1 and it will move to the S1 state. Now, S1 state is waiting for the second bit that is 0. If the next bit received is 0 it will move to S2 state else the incoming bit is 1 it means thus is sequence got broken and now I can assume that the bit received at S1 is as if like the first bit. So, here after receiving that it still waits in the same state to receive the 0 bit. So, in S1 if the incoming bit is 1 it will remain in the same state to receive or to wait for the 0 to appear. Similarly, now S2 if in S2 if it receives 0 bit it will move to the next state, but what else if it receives 1. So, if the incoming bit is say 1, 0, 1 it means the sequence got broken. So, again I have to start with as if like the received bit 1 as the start bit and I have to wait for the 0 bit ok. So, here if 1 is received at S2 the next bit it will be waiting for is 0. So, here it will move back to the S1 state. Now, let us assume that the incoming bit is now again after 1 it has received 0 it will move to S2. Now, again it has received 1 more 0 it is moved to S3. Now, it is waiting for the fourth bit. If the fourth bit received is 1 it will move to S4 state, but what else if the fourth bit received is 0 it means it has received 1, 0, 0 and 0. So, if a 0 is received at this point it means the sequence got broken again. So, it has to again start tracing the sequence right from the first bit. So, here if in S3 it receives 0 bit it will move back again to the initial state and start counting from the first bit itself or start tracing from the first bit itself. So, this is how at S3 the state transition takes place. Similarly, let us assume that now all 4 bits has been received. So, 1, 0, 0, 1 is received. Now, if the next bit incoming bit is 1 then it will assume that this is the first bit of the next sequence. So, it will wait for the second bit and we know that S1 is the state where it is waiting for the second bit to receive. So, here in S4 state if the input bit is 1 the next bit received is 1 then it will move to S1 state else if in S4 if the incoming bit is 0 then it means it has to start again from the initial state that is it will move to S0 state. So, this is how the state diagram is completed for the Moore model. Now, once the state diagram is obtained based on this the state table is obtained. So, here as it consists of 5 states here the 5 states are represented in the present state and based on these 5 states based on the present state and the input value the next state is obtained and the output is obtained based on the state diagram. Let us consider the example S0. If the present state is X0 and input bit is A is equal to 0 then as per this diagram the next state is S0. So, here next state is S0 also if the input bit is 1 the next state is S1. So, here the next state is S1. Similarly, since it is a Moore model my output depends only on the present state. So, when present state is 0 the output is 0 as specified here. So, here the output becomes 0. Similarly, the outputs and the next state for all the states are obtained based on the state diagram as shown. So, this is how the final state table is obtained from the state diagram. Now, pause this video and based on the method discuss try to draw the state diagram and state table for the sequence 111 using the Moore model. So, this is the output. These are the references used. Thank you.