Gray code:-
- Gray code is a unit distance binary code. In this code two consequtive numbers differs by only one bit. It is also known as mirror code. It is an unweighted code since each bit doesnot have any positional value where as the whole pattern represent a number.
To design any combinational circuit we have to follow the steps given below.
- Construct the truth table for the given problem.
- Derive the boolean expressions for the required outputs and simplify the boolean expressions if necessary.
- Construct the combinational circuit.
- Construct the truth table for the given problem.
Inputs |
Outputs |
B3 |
B2 |
B1 |
B0 |
G3 |
G2 |
G1 |
G0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
* Derive the boolean expressions for the required outputs and simplify the boolean expressions if necessary.
- Construct the combinational circuit.
Operation:-
- From the truth table of the problem we see that when the inputs are 0011 i.e B3=0, B2=0, B1=1 and B0=1 then the output is 0010 i.e.G3=0, G2=0, G1=1 and G0=0. When the inputs are 0011 then the MSB is transferrred as it is i.e G3 = B3 = 0. G2 is obtained by Ex-OR of B3 and B2 i.e. 0 EX-OR 0 = 0 thus G2=0 . G1 is obtained by Ex-OR of B2 and B1 i.e. 0 EX-OR 1 = 1 thus G1=1 .G0 is obtained by Ex-OR of B2 and B1 i.e. 1 EX-OR 1 = 0 thus G0=0 . So the final output for given input is G3=0, G2=0, G1=1 and G0=0.
- From the truth table of the problem we see that when the inputs are 1010 i.e B3=1, B2=0, B1=1 and B0=0 then the output is 0010 i.e.G3=1, G2=1, G1=1 and G0=1. When the inputs are 1010 then the MSB is transferrred as it is i.e G3 = B3 = 1. G2 is obtained by Ex-OR of B3 and B2 i.e. 1 EX-OR 0 = 1 thus G2=1. G1 is obtained by Ex-OR of B2 and B1 i.e. 0 EX-OR 1 = 1 thus G1=1 .G0 is obtained by Ex-OR of B2 and B1 i.e. 0 EX-OR 1 = 1 thus G0=1 . So the final output for given input is G3=1, G2=1, G1=1 and G0=1.
- The remaining rows can be verified in the similar manner.