Abstract Search

ISEF | Projects Database | Finalist Abstract

Back to Search Results | Print PDF

A New Algorithm for Generating Gray Code: Chinese Rings Approach

Booth Id:
SOFT018

Category:
Systems Software

Year:
2019

Finalist Names:
Tsei, Tsz Tung (School: Maryknoll Fathers' School)

Abstract:
A Gray Code sequence is a set of 2^n binary numbers in which only one bit changes between two consecutive elements. This property helps in reduce errors in data transmission and is commonly used in rotary mechanical and optical encoding devices. Its application also extends to software engineering, such as 3D imaging scanning. However, Gray Code sequences have to be converted to binary or decimal when used in mathematical computations or for display purpose which may take time especially for a large number of n. In this project a new and revolutionary algorithm is introduced that can directly convert decimal number to Gray Code and not involving previous sequence with no recursive is needed. In traditional Gray Code conversion, it includes XOR or using mirroring method to generate the sequence. The process must first include the conversion of binary number. This new algorithm is inspired by the Chinese Rings Puzzle. The Gray Code sequence can be regarded as a set of reserved n Chinese Ring solution and a set of n -1 Chinese Ring solution. The unique algorithm is further fitted into the Gros Sequence to verify its correctness and completeness. By running the algorithm in a computer program, this new algorithm is 40% faster in generating Gray Code Sequence than traditional methods. It is hoped that when the new algorithm is used in future digital engineering applications, much faster data process can be achieved.