Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

counting in grey code

Status
Not open for further replies.

patchquinn

Junior Member level 1
Joined
Jan 7, 2003
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
ireland
Activity points
163
what is grey code with example

hi, this might seem like a dumb question, but is there a convention for counting in the grey code for an arbitrary number of bits? For example with 3 bits there are number of possibilities , 000, 001, 011, 010, 110,111,101,100
0r
000,001,011,010,110,100,101,111
when you get to four bits it gets more confusing, I assume you try to have the lower value numbers first. But there must be some sort of algorithm. cant seem to find one on the web
cheers
 

dsp_

Member level 3
Joined
Mar 2, 2002
Messages
58
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Location
right here ... right now ...
Activity points
525
recursive grey code

Take the line 00,01,11,10
Reverse it 10,11,01,00
write a zero before each element of the first line 000,001,011,010
write a one before each element of the reversed line 110,111,101,100
and concatenate both
000,001,011,010,110,111,101,100

EDIT: but u cant say that finding generation rules on gray code is very hard.. google:"gray code" -> the fifth entry leads to http://yagni.com/graycode/

but thanks to you now i dont only know the recursive approach thanks :D


HTH
dsp_
 

patchquinn

Junior Member level 1
Joined
Jan 7, 2003
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
ireland
Activity points
163
thanks dsp_,
and regarding google search, being Irish I have been spelling it grey code rather than gray code, doh! :oops:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top