 Assalamu alaikum students, I am Vasim Iqram. This is the 18th lecture in a series of 45 lectures on digital logic design. How are you? InshaAllah, it will be good. In the last lecture, we started the discussion on multiplexers. We had discussed multiplexers for data selection. Even today, the discussion will continue on that topic. But before that, let us talk about the topics which we discussed in the last lecture. In the last lecture, we talked about decoders. What are these decoders? Basically, we have selected an important application for device selection. In a computer system or in a digital system, there are different devices. How will we select them? We will use a decoder. Basically, what is a decoder? It has some inputs and some outputs. You will apply a 3-bit code or a 4-bit code or a 2-bit code on the input. Because of that, one output pin will be selected on the output. If you connect the output pin with a device, with its chip enabled, then the device will be selected. In the last lecture, we talked about a 3-8 decoder. What is a 3-8 decoder? Basically, it has 3 inputs and 8 outputs. If you apply any 3-bit code on the input, then one corresponding output will be selected. For example, you apply 010. So, output 2 will be selected because 010 represents the code 2. Similarly, if you apply 111, which represents 7, the 7th output would be selected. If you want more outputs, there are only 8 outputs in the 3-8 decoder. If you want 16 outputs, then what will you do? Basically, you can combine 2 3-8 decoders and make a 4-16 decoder. So, there will be 4 inputs. Apply a 4-bit binary code. One of them will be selected. After that, we talked about an interesting application. If we use a decoder, we can generate a function as well. Again, we take the example of a 3-8 decoder. Let's say, we apply 010. What is selected from 010? The second output is selected. We apply 111. What is happening? The 7th output is selected. Let us suppose that we have a Boolean expression, in which the momentum is 2 and the momentum is 7. So, what will we do? Decoder, the 3-8 decoder, the 2nd output and the 7th output will connect them through an OR gate. So, whenever we apply the input 2 or 7 at the input of the decoder, the OR gate output would be A1. So, basically, what are we doing? The Boolean expression is implementing using the 3-8 decoder. Similarly, the product of some form, the Boolean expression, we can implement it with the decoder. After this, we talked about the BCD to 7-segment decoder. The BCD to 7-segment decoder is a little different from the rest of the decoders. In the rest of the decoders, one output is selected. In the BCD to 7-segment decoder, multiple outputs are activated. So, we said that if you want to display the digit 7, then you will apply the input of the BCD 7. And the corresponding segments which should be on will be active high or 1. So, BCD to 7-segment decoders have multiple inputs and multiple outputs. But multiple outputs at a time activate which is not happening in the rest of the decoders. In the BCD to 7-segment decoder, we took out expressions in the beginning with each segment. So, with simple AND or inverters, you can implement 7 circuits for each of the 7 segments. In the previous lecture, we studied that if you have an MSI, a medium-scale integrated form, there is a BCD to 7-segment decoder which is very optimized. If you look at the Boolean expressions which we derived for the different segments, there are many common terms. So, the MSI form and BCD to 7-segment decoder are optimized and the common terms are removed. The last decoder we looked at was BCD to decimal decoder. Similarly, the rest of the inputs are 4-bit and BCD. Outputs are 10-outputs and decimals. So, if you apply a 4-bit number from 0 to 9 on the input, one output line will be activated out of 10 outputs. After the decoders, we talked about encoders. Encoders are basically the opposite of decoders. Encoders have multiple inputs and multiple outputs. So, let's say, there is an 8 to 3 encoder. There will be 8 to 3 inputs and 3 outputs. How does it work? Basically, you have to activate one of the 8 inputs. Whatever input you activate, there will be a code on the output. So, let's say you have activated the third input on the output. It will be 0, 1, 1 indicating that the third input has been selected. Similarly, let's say, you select the fifth input and the output will be 101 code representing the input 5. In the simple encoder, we discussed a problem. If simultaneously more than one input is selected, let's say the second and sixth input is selected, then what will be the code? Basically, both the codes will be together. So, the second input code should be 0, 1, 0, 1. What about the sixth? It should be 0, 1, 1. So, the resultant will be 0, 1, 1. Which is incorrect. So, to finish this problem, what we talked about was the priority encoders. Priority encoders are basically a priority assigned to every input. How has it been done? We derived a Boolean expression and we are assigning a priority through it. So, the seventh input line has more priority compared to sixth. Similarly, sixth's priority is fifth. So, let's say sixth and two inputs are simultaneously selected. So, the sixth input code will be selected. Similarly, we talked about if you have two encoders, let's say 8 to 3 and you want to make 16 to 4, how will you do that? Basically, you can combine two 8 to 3 encoders and implement 16 to 4 encoders. One interesting encoder was basically Decimal to BCD encoder. Decimal to BCD encoder will have 10 inputs and 4 outputs. So, any of those 10 inputs you will select one input. Let's say, let's select the third input. What will come on the output? 0, 0, 1, 1. Because it is a 4-bit output, the code will come representing the third input. Where are we using it? In this case, digits are 0 to 9. If you have a digital system or a computer, you want to input data. So, you will have to connect a keypad or a keyboard. The button you press should have a 4-bit code that can process the digital system. So, the main purpose of Decimal to BCD encoder is to connect a keypad to its inputs. Whatever key you press to BCD encoder will come on the output. After the encoders, we started discussing multiplexer. We told multiplexer that again, there are multiple inputs and one output. There are some select lines and input select lines which help us to select one input. Whatever information is there, 1 has 0, they root on the output. That is why we are saying there are two sources and one destination. If you have a computer there is an ALU important circuit with two inputs. The information on which ALU has to perform operation is read on different registers or in different storage spaces. So, you can connect two pieces of information on the input of ALU. Basically, these multiplexers are being used. If you have four storage spaces then you should have a four into one multiplexer which will be connected with the four storage spaces and the output will be connected to the ALU input. Last time, we talked about four to one. After that, we saw an MSI commercial available chip. Basically, in that chip there are two four to one multiplexers. So, there are four inputs and two input selects and one chip is enabled. Multiplexers are available in different configurations in different sizes. Different multiplexers are connected according to your requirements. So, today we will see some more configurations and we will connect them and expand them. Let's say you have four to one multiplexer if you want eight to one okay. Let's say the data type is of multiple bits. You must have read it in different courses that information is used in byte form and process. It is a collection of bits basically. It is enabled. There is a quantity of four bits or eight bits of byte. There is a word or a long word. There are two bytes in the store. You have to select one of them and use it. Basically, you need a multiplexer with two inputs and each input should be of eight bits. Let's start by looking at a two input four bit multiplexer. Two input four bit multiplexer. How many inputs should be connected? Well, it is a two input so that means two inputs are possible two different data you can connect on multiplexer input. It is four bit input that means both the inputs are four bit each. So that means total input lines are eight. What is the output? Four bit output. If it is zero, the first input will be selected. If it is one, the second input will be selected. Apart from this, you need a general chip select line which will activate or deactivate the chip. So let's suppose you have two four bit quantities. One quantity is let's say input A which is of four bit. The other quantity is of four bit which is of input B. Select input is zero. The quantity A is of four bit will come to you. If select input is one, the quantity B is of four bit. Let's have a look at two input four bit multiplexer. Let's see its function table and its circuit. Let's have a look at the function table of a two input four bit multiplexer. In the input, you see two columns G and S. It presents the chip select. It's active low. So whenever it is one, the chip is not selected. Whenever it is zero, the chip is selected. S input selects two inputs. A input selects or B input selects. So if S is zero, input A is selected. If S is one, input B is selected. In the first row, you see when G is one, when S is zero, it doesn't matter because the chip is not selected. On outputs, you see one Y, two Y, three Y, four Y. These four bits are four output bits. So when S is zero and G is zero, you see one A, two A, three A, four A at the output. Similarly, when G is zero, the chip is selected and S is one. The second input is available at the output. B, two B, three B and four B are seen at the output. Let us now have a look at the circuit diagram of a two input four bit multiplexer. Four more gates are seen at the output, one Y, two Y, three Y and four Y. These four more gates have two two AND gates connected. The above AND gates have one A, two A, three A and four A. With these two gates, you see one B, two B, three B and four B. On the top left corner, you see two AND gates which have bubbles on them. These two are NOR gates. When G is zero and S is zero, the first AND gate which has bubbles on two inputs will be one at the output. What will happen with this? The AND gate at the input of two A, three A, four A will be activated. Whatever the input at one A, two A, three A, four A would be routed to the output. It would be available at one Y, two Y, three Y and four Y respectively. Similarly, if G is zero and S is one, the second gate on the top left will be activated and the second gate on the other gate is one B, two B, three B and four B will be selected. The second input will be available at one Y, two Y, three Y and four Y. We have looked at a two input, four bit multiplexer which has two inputs and four bits and one output. As I have said before, there are different types of multiplexers so you can just connect them together to form larger multiplexers. So, let us have a look at a few examples how we can form large multiplexers. Last time, if you remember we had seen a MSI chip in which four, two, one four inputs and one output were in the same IC. Now, let us suppose that you have an application or a requirement in which you need eight to one multiplexer. There should be one output. We have studied four to one multiplexer. We had seen a MSI chip in which two four to one multiplexers were in one chip. Can we connect them and form an eight to one? Yes, we can. If you remember four to one of course there are four inputs one output, two select inputs A and B and one chip select. Because you have four to one multiplexer which A and B select inputs are connected together. And eight to one multiplexer has eight inputs. So, to select one of them how many select inputs do you need? You need three. So, A and B should be C. Now, from where will we get C? Basically, if you connect the two chip selects G and G to each other with one inverter and connect them in the same way. And the input pin is called C. So, basically, A, B, C will be three inputs. If C is zero then one multiplexer the first one will be selected. If C is one, the second one will be selected. A and B will be used to select the first four inputs and the other four inputs. The output of both four to one multiplexers has two outputs. So, what will we do there? Basically, you will put a two input or gate. So, the two outputs of both multiplexers will connect them with the gate. And you have eight to one multiplexer. How will we make 16 to one multiplexer? Again, it is quite easy. You will connect four to one multiplexer like this. How will we connect? Basically, there are 16 inputs. So, how many input selects do you need? A, B, C and D you need four. Of course, the output should be one. So, first of all, let's say we combine four and make one. How will we do it? Basically, we will take a four input or gate from which we will connect four inputs and one output will come. Now, the four four to one multiplexers have four chip select inputs. G is the one. If you have to select from one input, that means you will have to select the first multiplexer. If you have to select one input from the next four inputs, that means you will have to select the second one, third or fourth. So, first, second, third or fourth. How will we select these four multiplexers? Basically, you need a decoder, two to four decoder. You will give two singles on the input of two to four decoders. They are C and D. If C, D is zero, then what will be the output of the decoder? The first output will be zero or one. It will be activated. If you have one one on the input of the decoder, then the fourth output of the decoder will be activated. The four outputs of the decoder are connected with the four multiplexer chip selects. So, now, if C, D is zero, the first multiplexer is going to be selected. How will we select its inputs? If the input C, D is one one, which multiplexer will be selected? The fourth multiplexer will be selected. From A, B, you can select one of the four inputs. So, let us have a look at the eight to one multiplexer and sixteen to one multiplexer. Let us first have a look at eight to one multiplexer using two four to one multiplexer. As you can see, A, B inputs select both the multiplexer and their inputs. The input C is directly connected to the first multiplexer with the chip select and the second one is selected through an ORT gate. So, if C is zero, the first multiplexer whose inputs are one C zero, one C one, one C two and one C three will be activated. The first multiplexer's output is one Y and is written out one. The second multiplexer whose output is two Y and is written out two. Because the multiplexer has one output, therefore you use a two input OR gate and both the outputs are connected through the OR gate and you have F output. Let us have a look at the function P. Let us have a look at the function table of a A to one multiplexer. You have three columns C, B and A on which you apply three-bit combination from 0, 0, 0 to 1, 1, 1. F output represents the output of the A to one multiplexer. So, if C, B, A are 0, 0, 0, then the first multiplexer's first input is selected so it is coming on the output of one C zero output. It is 1, 0, 0, C, B, A is 1, 0, 0. So, the first output of the second multiplexer is activating two C zero. Similarly, if input C, B, A is 1, 1, 0, the third input of the second multiplexer is selected. Now, let us have a look at the implementation of a 16-input multiplexer. The 16-input multiplexer has 16 inputs. It uses 4, 4 to 1 multiplexers. The first chip has two multiplexers and inputs are 1, C zero, 1, C1, 1, C2, 1, C3. And the second multiplexer has two C zero, 2, C1, 2, C2 and 2, C3. The second chip has two more multiplexers, 4, 2, 1. So, altogether, you have 16 inputs. A, B connects the two multiplexer chips. One decoder uses two to four decoders which have active high inputs and active low outputs. Two to four decoders have four outputs. The four outputs and the four chip selects are connected to them. Similarly, the four multiplexers are connected with a four input or gate. So, now let us suppose C, D is zero, zero. G is active low. The decoder is selected. So, if C, D is zero, zero, the first output of the decoder will be zero and the other three will be one. If the first output is zero, it is connected with the first multiplexer. So, it will be selected. The other three multiplexers will be deactivated. Now, it depends on A, B. If A, B is zero, zero, the first input will come on the F output of the gate. Similarly, if C, D is one, zero. Because of this, the first output and the second output will be one. It will be inactive. The third output will be activated and zero. Because active low outputs are there. And the fourth output will be one. It will be deactivated. If the third output is low, the third multiplexer will be selected. What will be on its output? It depends on what A, B you selected. So, that means the fourth input of the third multiplexer will be available on the output. So, if the fourth input is one, the output will be one. The other gate is connected with the output. So, that information will come on the output of the other gate. Let us have a look at the function table of a 16-bit multiplexer. The G input, which is the chip select input of the decoder. If it is set to one, when the decoder is not selected, none of its outputs are active. Therefore, none of the four multiplexers would be selected. C or D inputs are the inputs of the decoder. So, if CD is zero, the first multiplexer is selected. So, you get one C zero, one C one, one C two, one C three outputs which are connected to the first multiplexer. Similarly, if CD is one, zero, that means the second multiplexer of the first chip is selected. So, two C zero, two C one, two C two, two C three outputs which are connected to the first chip. Which input will come on the output depends on A and B. Similarly, if the input of the decoder is CD is zero, one, then the first multiplexer of the second chip will be selected. So, you get one C zero, one C one, one C two and one C three in the output. Similarly, if the input of CD is one, one, then the second multiplexer of the second chip is selected. You get two C zero, two C one, two C two and two C three from the output. It depends on what is on A and B. Let us look at the last example of multiplexers. Let us suppose you have two quantities. Both quantities are eight bit quantities. Basically, there are two byte values. You have to select one of them and send it to another circuit's input. So, what kind of multiplexer do you want? Basically, you need two input eight bit multiplexer. So, let us say quantity A will apply to input A, quantity B will apply to input B. Whatever quantity you have to send to output, select it. We have two input four bit multiplexer. So, to implement two input eight bit multiplexer, two of these multiplexers have to be connected together. What are the connections? Basically, both of them have a select input. Because there are two inputs, if the select input is zero, the input A will be selected. If the input B is one, the input B will be selected. So, the select inputs of two multiplexers are connected. If it is zero, the four bit input A of the first multiplexer will be selected Similarly, if the select input is one, the input B of the first and the input B of the second will be selected. Do you want to connect the output with some other gate? Basically, there is no need to connect any other gate. Because you are getting eight bits on the output. So, the first four bits are to be met with multiplexer. The other four bits are to have a look at the circuit diagram of a two input eight bit multiplexer. The circuit diagram of the two input eight bit multiplexer is shown. There are two chips. The select input of both the chips is connected together. So, when select is zero, the input A of both the chips is selected. When S is one, the input B of both the chips is selected and it is available at the output. The select input the chip select input of both the chips has to be activated. So, the chip select input G of both the chips is connected together. When G is set to zero, both chips are activated. When it is set to one, both chips are deactivated. Let us now have a look at the applications of a multiplexer. There are several very interesting applications. For example, we are talking about data routing. Basically, you have several inputs. We will select one of them and the data will go to the output. The second example is parallel to serial conversion. There is parallel data in byte form. If you want to transmit it on a remote location, then you have to do it in serial form. The multiplexer can be used there. Function generator. We have also seen that you can configure the decoder to generate a certain function. You can also use a multiplexer to implement a boolean function. The last example we will see is operation sequencing. When we do operation sequencing, I will explain in more detail. Let us start by looking at the data routing aspect of the multiplexer. Consider a two-digit display circuit. Let us say you have a counter with which two digits are being displayed in seven segments. How will the circuit be made? You should have two digits and two seven-segment digits. What will be the circuit on both the inputs? Basically, BCD to seven-segment decoder. With each two digits, there will be two BCD to seven-segment decoder circuits. Let us say you have to display 28. The most significant digit is on the input of BCD to seven-segment decoder. On the input of BCD to seven-segment decoder, you will apply BCD to two, which will convert to appropriate segments. You would see the digit two. The eight you display on the least significant digit on the input of BCD to seven-segment decoder, you will apply eight. You will see eight, which is the seven-segment display. Let us suppose you have to make a digital clock. In the digital clock, two digits will tell you minutes. So, you should have four seven-segment displays. And on the inputs of these four, four BCD to seven-segment decoder circuits should be done. Now, you can implement the same four-digit display unit using a multiplexer and a single BCD to seven-segment decoder. Basically, how will it be? We will look at the circuit diagram in this. We need to understand the seven-segment display. Two types of seven-segment displays are common cathode and common anode. What is common cathode? Basically, if you look at the seven-segment display, there are seven segments and they are made of LEDs, seven LEDs. If you connect all the LEDs to the cathode and ground it, and if you have to burn it, then on the other end, if you give it five volts, that segment will turn on. So, if all the cathodes are common, you will call them common cathode display unit, seven-segment display unit. Similarly, if all the seven-segment LEDs are common, then to use them, you will have to apply five volts to that common point. If you want to turn on any segment on the other end, you will have to. This is common anode. Let us have a look at the two-digit decimal display circuit. You see two seven-segment displays. Each seven-segment display is connected to a BCD to seven-segment decoder. So, the most significant display is connected to the most significant BCD to seven-segment decoder and the least significant seven-segment display is connected to another BCD to seven-segment decoder. The output of both the decoders are connected to the respective segments of both the digits. So, to display any two-digit number, the two digits are applied at the inputs of the two BCD to seven-segment decoders. The appropriate output segments are activated and the two digit number is displayed on the two-digit displays. Let us now have a look at the common anode and common displays. The figure on the left shows the common anode. The anodes of all the seven-segments are connected together and to use this particular seven-segment display, the common anode has to be connected to plus 5V. In order to display the digit 7, segment A, B and C have to be activated. So, the input A, B and C have to be connected to ground or 0V. De, F and G have to be connected to 5V. Similarly, looking at the circuit on the right-hand side, which is a common cathode circuit, all the cathodes of the seven-segments are connected together. In order to use this circuit, the common cathode has to be connected to the ground and the inputs are applied at the segments A, B, C, D, E, F and G. So, to display the number seven-segment A, B and C has to be activated since this is a common cathode. Therefore, A, B and C has to be connected to logic 1 or 5V. Segments D, E, F and G would be connected to 0. We have looked at the common cathode and common anode seven-segment displays. Now, let us have a look at the implementation of the two-digit display circuit using a multiplexer. Basically, the multiplexer is being used as a data-rooting unit. There are two numbers on the input of the multiplexer and they are being routed on the output. What is the circuit? Basically, a B, C, D to seven-segment decoder will be placed on the input of the two-input four-bit multiplexer. So, you will apply one digit on the input A. The input B will be applied on the second digit. So, let us say we have to display 28, A 2, B input 8. Now, if the B, C, D to seven-segment decoder has active high outputs, then what kind of seven-segment display are you connecting? Common cathode or common anode? Well, if the output of B, C, D is active high, that means to turn on any segment, it is sending 5V or logic 1. So, that means the common cathode display unit will activate. So, common cathode display unit will activate. Just like we were saying, you activate different chips by selecting the enable line of that particular chip. You activate it and the chip activates. So, the common cathode display, seven-segment display, will activate it. If the common cathode is connected to the ground, if it is high, it will be disabled. Now, looking at the circuit, you would select the input A of the multiplexer using the select input line. The same select input line is connecting the common cathode to the most significant digit. Similarly, the second digit, the least significant digit, is also connecting the select line through an inverter in an ORT gate. So, if you apply one, then input B multiplexer will be selected and the least significant digit will be selected. So, you have to do it again and again. Once you select the most significant digit with the select input, that means input A will be selected and the most significant digit will be displayed. If you select input 1, input B will be selected and the least significant digit will be selected and displayed. So, you have to do it again and again so that you can see both the digits at a time. Let us have a look at the circuit diagram of the multiplexer based 2 digit display circuit. A 2 digit decimal display circuit using a multiplexer is shown. A single 2 bit 4 input multiplexer is connected to a BCD to 7 segment decoder. The outputs of the BCD to 7 segment decoder are all active high. Two common cathode 7 segment displays are connected. The 7 segments of both the displays are connected to the outputs of the BCD to 7 segment decoder. The select input of the 2 bit 4 input multiplexer is connected to the common cathodes of both the 7 segment displays. The most significant display is connected directly to the select input whereas the least significant display the common cathode of the least significant display unit is connected through the not gate. Now let us assume that select input is set to 0. This means that input A, the number applied at input A would be made available at the output of the multiplexer. The BCD to 7 segment decoder would convert that into the appropriate segments. That information would be available at both the 7 segment displays. Now since the select input is 0 therefore the most significant 7 segment display is activated whereas the least significant 7 segment display is disabled. Therefore the number would be displayed on the most significant digit. When the select input is set to 1 the B input is selected. It is available at the output of the multiplexer. The BCD to 7 segment decoder would convert it into appropriate segments. That information is available at both the 7 segment displays. Since the select input is 1 therefore through the inverter the common cathode of the least significant digit is activated or set to ground whereas the common cathode of the most significant digit is set to high therefore it is deactivated. So the information at input B of the multiplexer is displayed on the least significant digit. In order to display both the digits continuously the select input has to be changed rapidly from 0 to 1. The multiplexer based display circuit can be expanded to 4 digits or 6 digits. A single multiplexer would be used with appropriate number of inputs. A single BCD to 7 segment decoder would be used. Now if it is a 4 digit display 4 inputs would be applied at the 4 inputs of the multiplexer and the multiplexer inputs have to be rapidly switched. So first A will be selected then B then C then D then again A, B, C, D or A, C sequence would be used. So you would see all the 4 digits displayed on the 4 digit display circuit. Now let us have a look at another application of the multiplexer. Parallel to serial conversion. We talked about parity bits to generate. We said that you have some information that you are trying to transmit from one end to another so there could be some mistake so you have to use parity bits. Basically when you are trying to send something on long distances you will not send it in parallel form but in series. Generally all your digital systems, computers are processing with parallel data they are storing processing in parallel data. For example your byte value basically it is a combination of 8 bits which are in parallel. The byte store in the byte form will be stored in parallel and the processing will be subtracted or subtracted If you want to send this information in a remote location then you will need 8 wires so you will be sending 1 bit on each wire. If you have a 16 bit value then you should have 16 wires. These 16 wires where 8 wires have a communication length which is not practical means you will send 8 wires from one end to another end 16 will be more expensive. All the communication systems are sent serially. So basically you have to change the digital data in series and transmit 1 bit at a time. So first let us say a byte data how to convert it in serial data. Let us suppose you have an 8 input multiplexer 8 input and 1 output. The information you have to send let us suppose it is 1111000 4 ones and 4 zeros. Where will you apply that? 8 to 1 multiplexer on its input. Now this 8 to 1 multiplexer's select lines will be 3 because you have to select 1 out of 8. So let us suppose your 3 select input lines attach a 3 bit counter to it. If you initialize the counter then the output of the counter will be 000. Which input multiplexer will be selected the first input will come to your output. Let us say 1 millisecond the counter is increasing. What will come to the output of the counter? 001. 001 because the select lines of the multiplexer are connected to it. The next input will be selected of the multiplexer. The information on that will come to your output. After the second millisecond the counter will increment again. The third input of the multiplexer will come to the output. After 8 milliseconds the 8 inputs of the multiplexer are selected and the information on that is coming to the output. So basically you started with a 8 bit parallel value which you changed in the serial value. So these 8 bits will be transmitted on the other remote location and you will convert it again in parallel. So let us have a look at the circuit which changes or rather converts this parallel data into serial data. The parallel to serial conversion circuit is shown and 8 to 1 multiplexer is used. The 8 inputs are connected to the information 11100101 The enable input of the multiplexer is activated it is set to 0 and the output is selected. A 3 bit counter is connected to the 3 select inputs of the multiplexer. So the counter C2 is connected to the select input A2 similarly the counter output C1 and C0 are connected to A1 and A0 select inputs of the multiplexer respectively. The output of the multiplexer is connected to the serial transmission line. So the parallel information will be available at the output 1 bit at a time. A clock is applied to the counter input. So let us assume that the clock increments after every 1 millisecond. So initially the circuit is reset the output C0, C1, C2 is 0, 0, 0 the I0 input of the multiplexer is selected. What is the data at the input? It is 1. So 1 would be available at the output basically 1 is transmitted. In the next millisecond the counter output would be 1, 0, 0. C0 is 1 C1 and C2 are both 0s. This would select I1 input of the multiplexer at I1 input of the multiplexer we have the data value 1 or bit 1 which is rooted to the output. So again another 1 is transmitted. Similarly in the 8 time periods starting from 0, 0, 0 and ending at 1, 1, 1 the 8 values 1, 1, 1, 0, 0 1, 0, 1 are transmitted 1 after the other. Let us have a look at the timing diagram of the parallel to serial conversion circuit. C0, C1, C2 indicate the outputs of the counter. So they are incrementing from 0 to 1, 2, 3, 4 and 7. This shows the output of the multiplexer. So during time interval 0 or the first millisecond input 1 is selected. So the output y of the multiplexer is 1. Similarly for intervals 1 and 2 the output is 1. For intervals 3 and 4 the output is 0 and similarly for intervals 5, 6 and 7 the output is 1, 0, 1. We have looked at the use of the multiplexer to serial data for onward transmission. Another interesting application of the multiplexer is used as a function generator. When we studied the decoder we saw that we can use the decoder to generate a function, to implement a function. Let us assume that you have a 3 variable boolean function a, b and c. There are 3 minterm 1 is 0, 1 is 3 and 1 is 7. So basically minterm 0 is a bar, b bar, c bar minterm 3 should be a bar, b, c and minterm 7 should be a, b, c. So if you write in SOP form these 3 product terms will come. Whenever any of these 3 minterm will be present the output should be 1. If you use multiplexer then how it will be implemented? 3, 2, basically 8 input multiplexer you are using. Minterm 0 input 0, the first input you have to connect it to 1. Similarly the term input 3 minterm 3 which is present you have to connect it to 1. Similarly the last input, 7 input you have to connect it to 1. The rest of the inputs which you are connecting. Now the output depends on which input you have selected. Let's say you apply 0, 0, 0 on the selected input lines. So the first input will be selected and the output will be 1. Let's say on the selected input you are applying 0, 1, 0, 2. 2 input will be selected and what you have connected will be 0 on the selected output. So that means this minterm is not included in the function. So that means any function which has a standard SOP form the minterm present will apply the inputs of the multiplexer. The minterm absent will connect 0 on the input of the multiplexer. Let's have a look at the circuit which implements this function. Let's have a look at the three variable logic function table. The inputs are A, B and C. The output is Y. The minterms 0, 0, 0 0, 0, 1 0, 1, 0, 1, 1, 1 are present. They are marked by 1s at the output. So minterm 0, minterm 1, minterm 2, minterm 5 and minterm 7 are present. Now how is this function implemented using a multiplexer? The multiplexer is selected. The eight inputs are connected to 1, 1, 1, 0, 0, 1, 0, 1. These inputs represent the output of the function as seen in the function table. The enable input is set to 0 to activate the chip. The select inputs A2, A1, A0 are connected to the three variables A, B and C. Now if the A, B, C inputs are set to 0, 0, 0 the first input I0 is selected which is connected to 1. The output Y would be giving A1. Similarly, if A, B, C inputs are set to 0, 0, 1, I1 input is selected, I1 input is connected to 1. The output would again be A1. Let us suppose A, B, C inputs are connected to or set to 1, 1, 0. 1, 1, 0 would select the second last input I6. Now I6 is connected to 0 so the output would be A0. Therefore, you can implement any three-variable function using an 8-input multiplexer. We have just looked at the implementation of a 3-variable Boolean function using an 8-input multiplexer. If you have four-variable Boolean expression how will you implement with multiplexer? Basically, you will use 16-input multiplexer. Similarly, if you have a Boolean expression, you can implement it using a four-input multiplexer. Now let us have a look at the last application. It is quite interesting. Operation sequencing. Any work you do, you do it in steps. First step when it is done, then you start with the second step. When the second step is done, the third step is done, then the fourth, fifth and so on. The duration of every step can be different. The duration is different. The second is two minutes, the third is 15 minutes and so on. Industrial processes are also in the same steps. Let us suppose we have a juice making factory. So, in the first step, you have to extract your juice. In the second step, let us suppose that the juice is put in a vessel and boiled it. In the third step, add some sweetness, preservatives so that the shelf life increases. In the fourth step, let us manage. So, to make fruit juice, you have to go through four steps. Until the first step is completed, you cannot start the second step, you cannot complete the third step and so on. The duration of every step is different. It depends on the quantity. Let us suppose in the first batch, there is one ton of fruit, then it takes half an hour to extract the juice. The second batch is half a ton, then it will take you 15 minutes. So, the duration of every step is different due to different conditions. Now, how would you control this sequence of steps? We are going to be looking at an example which simulates a four step process. Basically, in this circuit, we are using a decoder and a multiplexer and a counter. The two-bit counter counts from 0, 0, 0, 1, 0 and 1, 1. The counter output is connected to a two to four decoder. When the counter is 0, 0, the first output will be activated. When the counter output is 0, 1, 2, output decoder will be selected and so on. The counter output is again connected with the selected lines of the multiplexer. So, you are using four input multiplexer. So, when the counter output is 0, 0, the first input is selected and the information is coming to the output. Similarly, when the counter output is 0, 1, 2, the input of the multiplexer is coming to the output. And so on. The output of the decoder has four processes or four steps in which the process is going on. There will be a machine in every process that is doing this. Let's say, a machine of fruit extraction, juice extraction which has to be on. So, the four decoders are activating the machines in every process. So, when the counter is 0, 0, the first output of the decoder has been activated. The machine that is in process 1 has been activated. Now, when will the process 1 or step 1 end? Whenever the machine was going on, it would send out a signal. Who is receiving the signal? We have selected the first multiplexer input. So, the output of the first process is connected to the input of the multiplexer. Whatever is activated, the logic level will come. The output is connected to the clock input of the counter. So, whatever is the one the counter will increment on the next step. What will be increment on the next step? The second output of the decoder will be selected. Which will select the other process. Similarly, when the other process will end, an active logic level will come on the output. The second input is selected because the counter has been incremented. So, the active level will come on the output of the multiplexer. It will increment the counter. It will go on the next step. Let us have a look at the circuit which implements this operation sequencing using a multiplexer, a decoder and a counter. Let us have a look at the circuit diagram representing the control of a manufacturing process through operation sequencing. We have used a 2-bit counter which has 2 outputs C0 and C1. It has a clock input. So, each time the clock input is activated the counter increments to the next higher count. Initially, the 2-bit counter is reset to 0, 0. The output of the 2-bit counter C0, C1 is connected to the select input of the 421 multiplexer M0 and M1. And similarly, C0, C1 the output of the counter is connected to D0 and D1 of the 2-to-4 decoder. The 4 steps or the 4 processes are defined by the blocks process 1, process 2, process 3 and process 4. Each process is activated when it receives an active high signal from the decoder. Similarly, each process ends when it activates a signal at the output. The signal is active high. Now, consider the operation sequence. The 2-bit counter is reset the output C0, C1 are both set to 0, 0. The output 0, 0 selects the first input of the multiplexer I0 to be available at the output of the multiplexer. Similarly, the counter 0, 0 the counter information 0, 0 selects the first output of the decoder as soon as Y0 is activated process 1 starts. Now, process 1 might execute for 30 minutes. At the end of the 30 minutes process 1 would activate its output. Since I0 is connected to the output of process 1, therefore the output of the multiplexer would have a 1. When the process 1 is executing the output is 0, therefore the output of the multiplexer would have a 2 value. So, as soon as process 1 ends the output of the multiplexer sets to 1 which increments the counter to the next higher value which would be 0, 1. Now, 0, 1 selects the input I1 of the multiplexer. Similarly, the decoder output Y1 is selected. Therefore, process 1 has stopped process 2 is selected it is activated. Now, process 2 executes for 10 minutes. As soon as process 2 completes it activates its output to 1. The output, the active high output is available at the output of the multiplexer which again increments the 2 bit counter to the next higher value which again selects Y2 output of the decoder and I2 input of the multiplexer. Similarly, process 3 might run for 20 minutes as soon as it ends it sets its output to 1. The output is available at the output of the multiplexer which again increments the counter for the last time. The counter output is set to 1, 1. This activates Y3 output of the decoder which selects process 4. Process 4 it runs let us suppose for 10 minutes as soon as it completes the output is set to 1. The output of the multiplexer is also set to 1. The counter is again incremented to 0, 0 completed. We have looked at the applications of the multiplexer. One last topic I get, the multiplexer which we will do in the lecture. Till the next lecture, Khuda hafiz nasalaam aleykum.