 Hello everyone. Welcome myself Prithviraj Pithambay. I am working as an assistant professor in electronic engineering at Valchin Institute of Technology, Solapur. Let us today learn code converters, their design and implementations. At the end of this session, students will be able to examine the working of code converters, design and implement code converters. In digital systems, variety of binary codes are used. Examples are like BCD, GRAY, ASCII, etc. So there is a need of code converters, which are often required in many digital processing systems where multiple use systems communicate together. A multi input multi output logic circuit that converts one code word to another code is you can call as a code converter. Where input pattern represents code word in one code and output pattern are corresponding representations in different code. So code converter makes two digital systems compatible even though they use different binary codes. Let us today learn 4 bit binary to GRAY code converter. So first step in any design is the requirement and specifications. So let us learn the requirement for this 4 bit binary to GRAY code converter. So 4 bit binary to GRAY code converter requires 4 binary inputs B3, B2, B1, B0 and 4 GRAY outputs G3, G2, G1, G0. Second step is truth table. So we need to derive a truth table which contains total 8 columns because we have 4 inputs and 4 output lines. But before that we need a table which contains all the code word for binary as well as GRAY code. So let us calculate total code words possible for 4 bit binary code. So yes, the relation is 2 to the 4, 16 code words are possible. So the derived truth table contains total 16 rows corresponding to each code word. So your complete code table will look like this. So we have decimal 0 to decimal 15 binary 0 0 0 0 to 111 code words and they are corresponding GRAY codes. Now next step is the simplification. So we need to derive a simplified Boolean expression for each output as a function of input variables with the help of truth table and Karnop map. So let us find optimized equation for G3. So as we have 16 code words, we require 4 variable Kmap. So after putting all the values of 0s and 1s from a code table in a Kmap, the Kmap will look like this. So here we have 8 adjacent mean terms. So when you group them, we will get an octet. So for this group we have equation B3. Let us go for G2. Again we require G2 column. So after putting all the values in Kmap, so you will see here M4, M5, M7 and M6 are the mean terms. M8, M9, M11 and M10 are the mean terms. So we have here 4 mean terms adjacent to each other and here we have again 4 mean terms adjacent to each other. So we have here now 2 groups G1 and G2. So let us write down the equations for G1. So G1 is nothing but B3 bar B2 and G2 is B3 B2 bar. So your G2 equation will become B3 bar B2 plus B3 B2 bar. For G1, again place the corresponding mean terms in the Kmap. So we have here M3, M2, M11 and M10 adjacent mean terms and second group M4, M5, M12 and M13 mean terms which are again adjacent to each other. So let us find this group 1 equation. So for group 1 we have B2 B1 bar and for group 2 we have B1 B2 bar. So your G1 equation will look like B2 B1 bar plus B2 bar B1. Now for last G0 after placing the mean terms we will have M1, M5, M9 and M13 mean terms which are adjacent to each other. M2, M6, M14 and M10 mean terms which are adjacent to each other. So we have again 2 groups. So we have here actually 2 chords. Let us write the equation for G1. So G1 is B1 bar B0 and G2 is B1 B0 bar. So our G0 equation will look like B1 bar B0 plus B1 B0 bar. So after implementation you required all 4 equations. So this is the summary from the previous slide. So G3 is equal to B3. G2 is equal to B3 bar B2 plus B3 B2 bar. G1 is B2 B1 bar plus B2 bar B1 and G0 is B1 bar B0 plus B1 B0 bar. So let us implement all these using basic gates. So we required some gates. So not and or these are the 3 basic gates. So let us calculate total number of basic gates required for this. So you will see that here for each input we required our not gate. So B3 bar B2 bar B1 bar B0 bar. Again we will see here there are 6 and terms. So 6 and terms, 4 not gates and 3 or gates. So total number of gates are 13. But still we can require what optimized implementation. So if you look each term carefully, each expression carefully you will observe that these are XOR expressions. So G2 will be actually B3 XOR with B2. B1 will be B2 XOR with B1 and G0 will be B1 XOR with B0. So our new equations will look like this B3 XOR B2 B2 XOR B1 B1 XOR B0. Now if you compare these 2 implementations you will observe that with the basic gates the circuit requires 13 gates. But with the XOR gates you require only 3 XOR gates. So here you have reduced 10 gates. So your final circuit diagram contains 3 XOR gates connected like shown in the diagram. So G3 is equal to B3. So you require direct one line from input to output. G2 is B3 XOR with B2. So this first XOR gate takes input B3 B2. G1 is B2 XOR with B1 and G0 is B1 XOR with B0. So in any design implementation is the most important step. Because in implementation we require to use minimum number of gates for optimal performance. These are the some references for further reading. Thank you.