I was given a set of binary number to assemble it into gray code sequence: 111 000 110 011 001 100. Is their a specific way I have to do this? From What I read in the internet I think the following solution would be this:
Gray Code
000
001
011
110
111
100

Is this correct? would this be the final answer? Ive never done this before so Im not sure if this is correct.

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by gusano79

I was given a set of binary number to assemble it into gray code sequence: 111 000 110 011 001 100. Is their a specific way I have to do this? From What I read in the internet I think the following solution would be this:
Gray Code
000
001
011
110
111
100

Is this correct? would this be the final answer? Ive never done this before so Im not sure if this is correct.

The sequence you have there isn't correct--there should only be one bit of difference between each number and the one that follows.

That's basically all you need to know for this problem. Start with one of the numbers, then look through the rest for ones that only differ by one bit; those are the ones that could possibly come next. Repeat until either you've got a complete list (all six numbers), or you can't finish because you're stuck with numbers that all differ by more than one bit from the last one in your list. If you get stuck, then go back to some point where you had to choose between more than one number--this might be the first number--and choose a different one that fits.

The sequence you have there isn't correct--there should only be one bit of difference between each number and the one that follows.

That's basically all you need to know for this problem. Start with one of the numbers, then look through the rest for ones that only differ by one bit; those are the ones that could possibly come next. Repeat until either you've got a complete list (all six numbers), or you can't finish because you're stuck with numbers that all differ by more than one bit from the last one in your list. If you get stuck, then go back to some point where you had to choose between more than one number--this might be the first number--and choose a different one that fits.

Like this?
000
001
011
111
110
100

Like this?
000
001
011
111
110
100

Exactly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.