View Single Post
Peon666
Peon666 is offline
#1
Dec3-09, 12:18 PM
P: 110
1. The problem statement, all variables and given/known data

I need to implement a recursive code for generating the Gray code for a given number of bits. For example, if the input bit is 1 it generates Gray code for 1 bit number i.e 0 and 1. Given 2, it generates Gray code for 2 bit numbers i.e 00 and 01 and so on. I don't understand how to implement and what should be the base case.

I'd be really grateful in case of any help.

Thanks.

2. Relevant equations



3. The attempt at a solution
Phys.Org News Partner Science news on Phys.org
Simplicity is key to co-operative robots
Chemical vapor deposition used to grow atomic layer materials on top of each other
Earliest ancestor of land herbivores discovered