## Gray CodeThe The gray code is a very light weighted code because it doesn't depend on the value of the digit specified by the position. This code is also called a cyclic variable code as the transition of one value to its successive value carries a change of one bit only. ## How to generate Gray code?The prefix and reflect method are recursively used to generate the Gray code of a number. For generating gray code: - We find the number of bits required to represent a number.
- Next, we find the code for 0, i.e., 0000, which is the same as binary.
- Now, we take the previous code, i.e., 0000, and change the most significant bit of it.
- We perform this process reclusively until all the codes are not uniquely identified.
- If by changing the most significant bit, we find the same code obtained previously, then the second most significant bit will be changed, and so on.
## Process of generating Gray Code## Gray Code Table
Next TopicExcess-3 Code |