 Namaste, welcome to the session design of a priority encoder. At the end of this session students will be able to design a priority encoder. In this session we are going to design an encoder circuit and then we are going to design a priority encoder circuit. Now what do you mean by encoder? Encoder is also a combinational circuit where it generates the output as a binary code corresponding to one of the input value at a time which is active. For example the encoder may be octal to binary encoder where there are 8 octal numbers which are encoded by using 3 binary bits. So an encoder has 2 raised to n or less than 2 raised to n input lines and n output lines. So this is the block diagram for 2 raised to n 2n encoder. For example 2 raised to n input lines are fewer than that means it may be a decimal to BCD encoder where 10 decimal inputs are there and which are encoded by using 4 binary bits. The encoder is also known as binary encoder and it performs inverse operation of decoder. So decoder we have already discussed in one of the video lecture. So let us proceed further. Let us design an encoder. So let us design 8 to 3 encoder which is also known as octal to binary encoder. So very first step to design any combinational circuit is to draw the block diagram. So as we know that 8 is to 3 means there are 8 octal inputs which are denoted by D0, D1, D2, D3 and so on, D7 and 3 binary bits required to encode the octal number and here we are using x, y, z as 3 binary bits. In the next step we are going to write the true table for the 8 is to 3 encoder where it includes 8 octal inputs D0 to D7 and 3 binary bits indicated as x, y, z. So here you can see in encoder only one input is active. So for example if D0 is there it is encoded in binary as 0, 0, 0. If suppose it is octal 5 is active then it is encoded as 1, 0, 1. So hence this table is get completed for all 8 octals we have respective binary code. In the next step we are going to write logic equation for 8 is to 3 encoder outputs. So as we know that we have 3 bits here x, y, z we have to write equation for x, y and z. So here x is obtained from D4 plus D5 plus D6 plus D7 then the bit y is obtained from D2 plus D3 plus D6 plus D7 and the z bit is obtained by D1 plus D3 plus D5 plus D7. So in this way we have obtained logical equation from the true table. So in the next step we are going to draw the logic circuit for 8 is to 3 encoder. The logic circuit is drawn based on the logic equations x, y and z. So if you observe these 3 equations we require OR gate for each of these x, y, z and respect to input D0 to D7. So here we have octal inputs D0 to D7 and OR gates will give us x, y, z bit of the binary. So here you can see the x is obtained from D4, D5, D6, D7 and then y is obtained from D2, D3, D6 and D7 and by combining D1, D3, D5, D7 we will get z bit. Now for example if D2 bit is active it means that octal 2 is there then it is encoded as 0 1 0. Now take a pause here and find out what if more than one input is active. So if suppose D2 and D5 is present at the same time so what will be the output of this encoder and also find out what if there will be no input is active. Suppose there is no input then what will be the output here. So the solution to this problem is priority encoder. So priority encoder is also a combinational noise circuit where if more than one input is active the one with the highest order decimal digit will be active and the higher order is encoded at the output. So this is the solution for what if more than one input is active and what if no input are active then for this we are using a valid bit indicator which is included in the circuit where it is set to 0 if all inputs are 0. So it means that input is not valid and the valid input indicator V is set to 1 when one of the input or more than one input is equal to 1. So it is indicating that input is valid. So let us design a priority encoder. So here we are going to design 4 is to 2 priority encoder. So first step is to draw the belong diagram. So in 4 is to 2 we have 4 inputs let us consider D02 D3 and 2 outputs as XY whereas V is a valid indicator which indicates whether input is valid or not as we are discussed. And in the truth table we are going to include all the inputs and respective output. So here you can see when there is no input present or active then it is not valid. So it is indicated or set to 0 and XY is not going to be encoded. So here we are writing as tone care. When D0 is active then it is encoded as 001. Now if D0 and D1 both are active then highest priority is given to the D1. So it will be get encoded as 01 at that time D0 is tone care and it is valid. So when D0, D1, D2 are active then D2 is getting encoded as per highest priority and D0 and D1 are considered as tone care. So here we get XY as 10 and valid output when all the 4 inputs are present then highest priority is given to the D3 and it is encoded as 11 whereas D0, D1, D2 are considered as tone care and it is also valid input. So based on truth table we are going to write the equation for X which is obtained because of this combination XX10 and due to the combination XXX1 and we are getting output Y because of combination X100 where tone care may be 01 then we are getting Y output because of XXX1 and we are getting valid output whenever D0, D1, D2 and D3 are present. So based on this truth table we are going to write logic equation for forest truth priority encoder. So here to get a logic equation we have to solve it by Kmap. So here X100 represents 0100 and 1100. So similarly XX00 will give us 4 combinations and XXX0 will give us 8 combinations. So by including these tone cares considering these tone cares we are writing Kmap for X and Y so that we will get equation XY whereas valid input we already got that equation as it is a combination of D0, D1, D2, D3. So here by putting the ones and tone care we will get two octets. So one octet will give you D2 and other octet will give D3. So equation for X becomes X is equal to D2 plus D3 and the Kmap for Y will give us one quad and one octet which will give us the equation as Y is equal to D3 because of this octet and D1 D2 bar because of this quad. So based on this equation we are drawing logic circuit for forest truth encoder. So based on these three equations the logic circuit is like this. So in this way we can design any priority encoder. These are references. Thank you.