hdl-util / gray-code

Generate a gray code of arbitrary width in SystemVerilog
https://purisa.me/blog/arbitrary-width-gray-codes/
Other
2 stars 1 forks source link

Balanced gray codes #1

Open sameer opened 4 years ago

sameer commented 4 years ago

There are methods to produce balanced gray codes: gray codes where the transitions of each bit are evenly distributed across the mapping.

Wikipedia entry describes it better in more concrete mathematical terms.

One algorithm I thought of:

I read some papers about it, but I don't have an algorithm that would be simple enough to implement in SystemVerilog.

Butterwell commented 1 year ago

See: https://electronics.stackexchange.com/questions/446249/circuit-balanced-gray-code-binary