GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-10

Constituent: test_parity     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

test_parity.c File Reference

Unit test of the PARITY facility. More...


Detailed Description

Unit test of the PARITY facility.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id

The PARITY facility consists of a collection of routines used to generate the parity of bytes, shorts, ints and arrays of the same. The method is a seriers of divide and conquer XORs. For example, to calculate the overall parity of an array of integers, the integers are all first XOR'ed together, then the remaining two 16 bit halves of the integer are XORed, followed by XOR'ing the remaining to bytes, etc. (Well, not quite, once one gets down to the byte level, another even faster techique is used; see the PARITY routines themselves for details if you are interested.)

Because the routines are both compact and very efficient, they are available, not only in traditional callable form, but also as inline routines.

The test can be run from the command line by typing

   $ test_parity

Generated on Mon Nov 20 05:18:11 2006 by  doxygen 1.4.4