Introduction Gray code is a binary numeral system where two successive values differ in only one bit (binary digit). Today, Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems. This code was originally designed to prevent spurious output from electromechanical switches. 2-bits4-bits bits /14
Motivation DecimalBinary DecimalBinaryGray Gray As Decimal /14
Grey code for 23: (23) 10 = ( ) 2 Function: Result = Num (Num / 2) // (div 2) 10 == (>> 1) 2 Example = (28) 10 4/14
Function: a n −1 = g n −1 a i = g i ⊕ a i +1, i = n − 2,..., 0 g: a: = (23) 10 Example (inverse) 5/14
Grey Code (Implementation) 6/14
Grey Code Inverse (Implementation) 7/14
8/14 CpuStreamCpuCode.c
9/14 CpuStreamKernel.maxj
10/14 CpuStreamManager.maxj
11/14 Build & Run
Conclusion Unfortunately, DFE algorithm implementation does not cause speedup in most of the cases... 12/14
References The Gray Code by R. W. Doran Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007). “Section 22.3.GrayCodes”. Numerical Recipes: The Art of Scientific Computing (3rd ed.). New York: Cambridge University Press. Wilf, Herbert S. (1989). "Chapters 1–3". Combinatorial algorithms: an update. SIAM.ISBN /14
14/14 Professor: dr Veljko M. Milutinović Student: Petar Ristić 32/2012 Software engineering School of Electrical Engineering University of Belgrade Microprocessor Systems (MIPS)