0

我试图找出一种从奇怪的格雷码到二进制反射格雷码或正常二进制的有效方法。

The pattern goes:
000000
000001
000101
000100
000110
000111
010111
010110
010100
010101
010001
010000
010010
010011
011011
011010
011000
011001
001101
011100
011110
011111
1011111
1011110
1011100
1011101
and so on...

它最多使用 12 位。

4

2 回答 2

0

最有效的方法是使用字典/哈希表。或者,将它们排序存储在数组中并使用二进制搜索。

[编辑]

实际上,现在我想一想,按照今天的标准,一个包含 4096 个条目的查找表不会占用那么多空间。

于 2012-07-12T15:02:22.177 回答
0

Array string in [ "00001", "000011, ... etc.
Array string out [ "01" , "10" , ...

Loop through an array to find a match, use same index in other array for conversion.

Might also be nice to try conversion with a neural network; after a while it will convert it. Actually that's I think nice try, have you somewhere the full gray binary list?

Perhaps I like to give it a try in a yet to build neural network.

于 2012-07-12T13:58:02.493 回答