This topic is useful for KTU Regulation 2019 1. EET206 Digital Electronics ( ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CST203 Logic System Design ( COMPUTER SCIENCE ENGINEERING) 3. ECT203 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EBT205 Logic Circuit and Design (BIOMEDICAL ENGINEERING) 5. ITT203 Logic System Design (INFORMATION TECHNOLOGY) 6. ECT203 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING) KTU Regulation 2015 1. EE204 Digital Electronics and Logic Design (ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CS203 Switching Theory and Logic Design (COMPUTER SCIENCE ENGINEERING) 3. EC207 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EC207 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING AND INSTRUMENTATION) 5. IC207 Design of Logic Circuit (BIOMEDICAL ENGINEERING) FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical#cse FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical
Hello students, today we are going to discuss about non-weighted code in module 1.
In the last class, we learnt about weighted code i.e. binary code, binary coded decimal
and the conversion based on it.
Today, we are going to discuss about non-weighted code.
Non-weighted code consists of XS, XS3 code and gray code.
First, let us discuss about XS3 code.
First, XS3 code.
XS3 code can be derived from a BCD code.
How? By adding 3 to it.
For example, let us see the format of XS3 code.
Let us take a decimal number and convert it to the corresponding BCD code.
Then, add 3 to it.
Then, we get XS3 code.
This is the format of XS3 code.
Let us take a decimal number and convert it to the corresponding BCD code.
Then, add 3 to it.
Then, we get XS3 code.
This is a modified form of BCD number.
Let us consider an example.
For example, let us take a decimal number 4.
Let us convert it to the corresponding BCD code.
Then, add 3 to it.
Then, we get XS3 code.
XS3 code of a decimal number 4 is 0111.
Let us consider another example.
Let us take a decimal number 8.
Let us convert it to the corresponding BCD code.
Then, add 3 to it.
Then, we get XS3 code.
If we add the 3 to this decimal number, we get 11 and
Let's look at a question based on the XS3 code.
You have to convert XS3 to decimal.
Convert the XS3 code to decimal.
This is our question.
0 1 1 0 0 1 1 1 1 0 0 0
This is given in XS3.
XS3.
Where should I convert this to?
Convert to decimal.
This is a case of XS3.
BCD is represented in terms of 4 bit.
Let's represent this in terms of 4 bit.
0 0 0 1
1 group.
Next.
0 0 1 1 1 0
Next group.
Again 0 0 0 1 1 0
Ok.
0 1 1 0 8 4 2 1
In BCD code, how can we represent 0 1 1 0?
We can write it as 6.
What is 0 1 1 1?
It is 7.
We can give 7 to this.
Next, what is 1 0 0?
It is 8.
What we are given is XS3 code.
This is a case where 3 is added.
Where should we convert this to?
Convert to decimal.
We can minus 3 from all the cases.
Ok.
What is 8 minus 3?
It is minus.
We can minus each term.
3 is added value.
So, we have to minus 3 from it.
What is 7 minus 3?
It is 4.
Then 6 minus 3?
It is 3.
The corresponding decimal value is 3 4 5 to the base 10.
This is how we convert the thing given in XS3 to decimal.
Next.
Decimal to XS3 code.
The question I asked earlier is how to convert the thing given in XS3 to decimal.
Now, let us see how to convert the thing given in XS3 to decimal.
My question.
3 4 5 to the base 10.
Where should we convert it to?
To XS3.
Write 3 4 5 below.
Then, what should be added?
Add 3.
5 plus 3 is 8.
4 plus 3 is 7.
3 plus 3 is 6.
Now, we have to convert the thing given in XS3 to 4-bit binary.
What is 4-bit binary of 6?
0 1 1 0.
What is 7?
0 1 1 1.
What is 8?
1 0 0 0.
We have converted the thing given in XS3 to BCD.
Now, we have to combine it to get the answer.
0 1 1 0.
0 1 1 1.
1 0 0 0.
We have got the answer in XS3.
This is how we have to convert the thing given in XS3 to decimal.
Next, let us see what are grey codes.
Grey codes are called as cyclic codes.
It is also called as unit distance code.
It is also called as minimum error code.
Grey codes are called as cyclic codes, unit distance codes and minimum error codes.
Grey code is the difference of one position between two numbers.
In which category does it come?
It is called as unweighted code.
Grey code is the key of unweighted or non-weighted code.
Now, let us see how to convert a binary to grey.
Grey code is a cyclic code.
It is also called as unit distance code and minimum error code.
Grey code is the difference of one position between two numbers.
It is also called as unweighted or non-weighted code.
Now, let us see a decimal.
Let us see the binary representation and grey code representation.
0 1 2 3 4 5
How is the binary representation?
0 0 0 0 0
0 0 0 1
0 0 1 0
0 0 3 is 1 1
4 is 0 1
0 0 5 is 0 1 0 1
Now, let us see the grey code representation.
0 0 0 0 is the same as grey code.
1 is also same as grey code.
0 0 0 1
2 is 0 0 1 0
3 is 0 0 1 0
4 is 0 1 1 0
5 is 0 1 1 1
Now, let us see the binary representation.
3 and 4
Let us see the binary representation of decimal 3 and 4.
1 is 0
0 is 1
Let us see the grey code representation.
There is no change in the grey code representation.
There is only one change in the grey code representation.
There are three positions in the grey code representation.
1 is 0
0 is 1
There are three positions in the binary representation.
But, there is only one change in the grey code representation.
Now, let us see the application of the grey code representation.
Application of grey code
Where is it?
It is in KMAP design.
The application of grey code is in KMAP design.
Grey code is a non-weighted code.
It has no weightage.
It is a non-weighted code.
It is a cyclic code.
It is a unit distance code.
It is a minimum error code.
The application of grey code is in KMAP design.
We can understand this by looking at the table.
There are three positions in the binary representation.
But, in the case of grey code,
there is only one change in the grey code representation.
Now, let us see how to convert a binary to grey code.
In the case of non-weighted code and weighted code,
there is a chance to ask only about the conversions.
There is a chance to ask only about the conversions.
Let us see an example.
Where should we convert this binary to?
We should convert it to grey code.
Step 1 is
Record the MSB as it is.
The MSB here is 1.
Write the same number.
Record the MSB as it is.
Step 2 is
Add the MSB to the next bit.
What should we do with the next bit?
We should add the MSB.
Step 3 is
Repeat the process.
There are three steps.
When we convert a binary to grey code,
we can write the question below.
1, 0, 0, 1, 1.
This is my question.
The MSB here is 1.
Write the same number below.
Step 4 is
Add the MSB to the next bit.
1 plus 0 is 1.
Step 5 is
0 plus 0 is 0.
Step 6 is
0 plus 1 is 1.
1 plus 1 is 0.
In case there is a carry,
we should neglect the carry.
These are the steps.
When we convert a binary to grey code,
write the MSB below.
Add the MSB to the next bit.
In case there is a carry,
we should neglect it.
Ignore it.
When we convert 1, 0, 0, 1, 1 to the base 2 to grey code,
the answer is 1, 1, 0, 1, 0.
The next question is
1, 1, 0, 0, 1 to the base 2 to grey code.
Write the question below.
1, 1, 0, 0, 1.
For this 1,
I am marking it as A0.
For this 0, I am marking it as A1.
For this 0, I am marking it as A2.
For this 0, I am marking it as A3.
For this 0, I am marking it as A4.
For this A4, I am marking it as MSB.
Write the same answer below.
The next step is
A4 exclusively or A3.
For this,
XOR 1.
What is 1 XOR 1?
It is 1.
For an XOR operation,
what are the values?
In the case of the same input,
the answer is 0.
In the case of different inputs,
the answer is 1.
For an XOR operation,
in the case of the same input,
the answer is 0.
In the case of different inputs,
the answer is 1.
Here, A4 XOR A3.
What is the value of A4?
1 XOR A3.
For the same input,
the answer is 0.
For 1 XOR 1,
the answer is 0.
Next,
A3 XOR A2.
What is the value of A3?
It is 1.
In the case of different inputs,
the answer is 1.
For 0 XOR 0,
in the case of the same input,
the answer is 0.
For 0 and 1,
in the case of different inputs,
the answer is 1.
The answer is 10101.
We got the gray code for this.
The gray code.
Ok.
For 11001,
the answer is 10101.
We got the gray code.
Ok.
Next,
Gray code.
Gray code to
binary
conversion.
Let's see how.
Ok.
Step 1. Record the msb as it is.
Step 2. Add msb to the next bit of grey code.
Step 3. Repeat the process.
Step 4. Record the msb as it is.
Step 5. Add msb to the next bit of grey code.
Step 6. Record the msb as it is.
Step 7. Add msb to the next bit of grey code.
Step 8. Record the msb as it is.
Step 9. Record the msb as it is.
Step 10. Record the msb as it is.
Step 11. Record the msb as it is.
Step 12. Record the msb as it is.
Step 13. Record the msb as it is.
Step 14. Record the msb as it is.
Step 15. Record the msb as it is.
Step 16. Record the msb as it is.
Thank you for watching this video.