\hypertarget{PARITY_8ih}{
\section{PARITY.ih File Reference}
\label{PARITY_8ih}\index{PARITY.ih@{PARITY.ih}}
}
Priority calculation, inline interface and implementation. 

{\tt \#include \char`\"{}PBI/Inline.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par
{\tt \#include \char`\"{}PARITY.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{PARITY_8ih_9603e267d3761e9e98b7145bbdcb835d}{
\#define \textbf{PARITY\_\-\_\-EXP\_\-PROTO}~INLINE\_\-USR\_\-EXP\_\-PROTO}
\label{PARITY_8ih_9603e267d3761e9e98b7145bbdcb835d}

\item 
\hypertarget{PARITY_8ih_c6f7bdaed69959fb9aa673a5816a7d8c}{
\#define \textbf{PARITY\_\-\_\-LCL\_\-PROTO}~INLINE\_\-USR\_\-LCL\_\-PROTO}
\label{PARITY_8ih_c6f7bdaed69959fb9aa673a5816a7d8c}

\item 
\hypertarget{PARITY_8ih_472e85ea453b2b21c0f4f6035999c9b5}{
\#define \textbf{PARITY\_\-\_\-EXP\_\-FNC}~INLINE\_\-USR\_\-EXP\_\-FNC}
\label{PARITY_8ih_472e85ea453b2b21c0f4f6035999c9b5}

\item 
\hypertarget{PARITY_8ih_d12c1d69fe0001d79484f98bfc3ac845}{
\#define \textbf{PARITY\_\-\_\-LCL\_\-FNC}~INLINE\_\-USR\_\-LCL\_\-FNC}
\label{PARITY_8ih_d12c1d69fe0001d79484f98bfc3ac845}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_8a8b389f51157438014ab9a7c6cc06b1}{PARITY\_\-\_\-calc8} (unsigned char byte) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over the 8 bits in the specified byte. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_5bdcce0cc49707dead4058bcc23fc62d}{PARITY\_\-\_\-calc16} (unsigned short int hword) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over the 16 bits in the specified half word. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_df09136f76de98194e8096e3ee786a7f}{PARITY\_\-\_\-calc32} (unsigned int word) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over the 32 bits in the specified word. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_ee7c9793d76a7a6734b41ba0fae99e79}{PARITY\_\-\_\-calc64} (unsigned long long int ll) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over the 64 bits in the specified long long. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_3c188e64baa49edf1e20ea74e53e9d93}{PARITY\_\-\_\-calc8N} (const unsigned char $\ast$bytes, int nbytes) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over all the bits in the specified array of bytes. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_e38ba11229da784d2065910974e044ef}{PARITY\_\-\_\-calc16N} (const unsigned short int $\ast$hwords, int nhwords) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over all the bits in the specified array of half words (16-bit integers). \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_cc2f44b11de0ab22bd482118a2e09d49}{PARITY\_\-\_\-calc32N} (const unsigned int $\ast$words, int nwords) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over all the bits in the specified array of words (32-bit integers). \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_4b7653fb2d7cc925d593578cea134361}{PARITY\_\-\_\-calc64N} (const unsigned long long int $\ast$lls, int nlls) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the parity over all the bits in the specified array of long long words (64-bit integers). \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_12227e079017145093abfa8aedf56ded}{PARITY\_\-\_\-calcOdd8} (unsigned char byte) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over the 8 bits in the specified byte. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_a28ba968a0e6489a6af9d48c93255b01}{PARITY\_\-\_\-calcOdd16} (unsigned short int hword) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over the 16 bits in the specified half word. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_cec2e0b0537df0398e5fb729f590fe2a}{PARITY\_\-\_\-calcOdd32} (unsigned int word) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over the 32 bits in the specified word. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_7ee4a3453deb3a21bd8a965f037d5a78}{PARITY\_\-\_\-calcOdd64} (unsigned long long int ll) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over the 64 bits in the specified long long. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_a2f313bd0d18461cc6b9adbe0abdd210}{PARITY\_\-\_\-calcOdd8N} (const unsigned char $\ast$bytes, int nbytes) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over all the bits in the specified array of bytes. \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_431a6a00ea6aaea689816314fddaa7e8}{PARITY\_\-\_\-calcOdd16N} (const unsigned short int $\ast$hwords, int nhwords) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over all the bits in the specified array of half words (16-bit integers). \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_edf62004e33a477537934b0537c24900}{PARITY\_\-\_\-calcOdd32N} (const unsigned int $\ast$words, int nwords) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over all the bits in the specified array of words (32-bit integers). \item\end{CompactList}\item 
PARITY\_\-\_\-EXP\_\-PROTO int \hyperlink{PARITY_8ih_a4be745c84d4adf7bf12f4c8b2f8ea5f}{PARITY\_\-\_\-calcOdd64N} (const unsigned long long int $\ast$lls, int nlls) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Calculates the odd parity over all the bits in the specified array of long long words (64-bit integers). \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Priority calculation, inline interface and implementation. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

    CVS $Id: PARITY.ih,v 1.1 2009/05/07 00:33:59 russell Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[SYNOPSIS]This defines the inline implementation of the parity routines. Routines are provided to calculate the parity over\end{Desc}
\begin{enumerate}
\item A byte (8 bits)\item A short (16 bits)\item An int (32 bits)\end{enumerate}


as well as arrays of the same.

\begin{Desc}
\item[ALGORITHM]The parity is simply defined as 0 if the count of set bits is even and odd if the count of set bits is odd. One could add all the bits together, but all that is really needed is the low bit of the sum, This is simply the XOR of all the bits.\end{Desc}
Consider the following straightforward way to XOR all the bits in a 32 bit word.



\begin{Code}\begin{verbatim}    .
    .
    parity = (word   >> 16) ^ (word);
    parity = (parity >>  8) ^ (parity);
    parity = (parity >>  4) ^ (parity);
    parity = (parity >>  2) ^ (parity);
    parity = (parity >>  1) ^ (parity);
    return  parity & 1;
\end{verbatim}
\end{Code}



This takes advantage of the fact that the XORs can be done in parallel. However, there is a small improvement that can be made on this algorithm. Consider building an array is that as big as the value of an input value and whose value at an given index is a single bit giving the parity of the value. Of course such an array for a 32-bit integer would be prohibitively large. Even if this was not true, on RISC machines, one should avoid referencing uncached memory for performance reasons.

There is an variation on this theme that does work. First, execute the above algorithm until only 4 bits remain. Now the range of these 4 bits is modest, 0-15, so one could consider an array. The array that will be {\em indexed\/}, however is not as a traditional memory array, but as a bit array built in a single 16-bit number. The {\em indexing\/} is accomplished by simply right shifting this 16-bit numer and masking off the low order bit.



\begin{Code}\begin{verbatim}    .
    .
    index  =  word;
    index ^= (index >> 16);   / * Reduce to 16 significant bits  * /
    index ^= (index >>  8);   / * Reduce to  8 significant bits  * /
    index ^= (index >>  4);   / * Reduce to  8 significant bits  * /
    index &= 0xf;             / * Pick off the lower 4 bits      * /
    return 0x6996 >> index;   / * Index the answer array         * /
\end{verbatim}
\end{Code}



Note another nice feature of this algortihm. If one desires a logical functions that returns TRUE if the parity is EVEN, or equivalently one that returns the ODD parity then one simply replaces the 0x6996 with 0x9669.

The above sequence should cost approximately 8 integer instructions on a PowerPC. Narrower widths cost less; a 16-bit value should cost about 6 instructions and a byte should cost 4 instructions.

\begin{Desc}
\item[CALLABLE VERSIONS]Callable versions of these routines are also available. The names of the callable versions are the same as these, except the double underscore is replaced with a single underscore.\end{Desc}
Note also that the implementation of the callable versions of the array routines may or may not be the same as the inline versions. There are various techniques that can speed up the calculation on large arrays. Because of the additional logic these techniques add, it would not be appropriate to use them in the inline versions.

The best advise here is, if one is calculating the parity over arrays less than say $\sim$10 elements, use the inline versions. If one is calculating the parity over larger arrays, use the callable versions. The overhead of the call will be compensated by speedier routines. This statement is particularly true when calculating the parity over arrays of bytes and half words (short ints). 

\subsection{Function Documentation}
\hypertarget{PARITY_8ih_5bdcce0cc49707dead4058bcc23fc62d}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc16@{PARITY\_\-\_\-calc16}}
\index{PARITY__calc16@{PARITY\_\-\_\-calc16}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc16 (unsigned short int {\em hword})}}
\label{PARITY_8ih_5bdcce0cc49707dead4058bcc23fc62d}


Calculates the parity over the 16 bits in the specified half word. 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over the 16 bits the specified half word.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hword}]The half word (short int) to calculate the parity of. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_e38ba11229da784d2065910974e044ef}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc16N@{PARITY\_\-\_\-calc16N}}
\index{PARITY__calc16N@{PARITY\_\-\_\-calc16N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc16N (const unsigned short int $\ast$ {\em hwords}, int {\em nhwords})}}
\label{PARITY_8ih_e38ba11229da784d2065910974e044ef}


Calculates the parity over all the bits in the specified array of half words (16-bit integers). 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over all the bits in the specified array of half words (16-bit integers). If a length of 0 is specified, 0 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hwords}]The array of half words (16-bit integers) to calculate the parity over. \item[{\em nhwords}]The number of half words (16-bit integers) in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_df09136f76de98194e8096e3ee786a7f}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc32@{PARITY\_\-\_\-calc32}}
\index{PARITY__calc32@{PARITY\_\-\_\-calc32}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc32 (unsigned int {\em word})}}
\label{PARITY_8ih_df09136f76de98194e8096e3ee786a7f}


Calculates the parity over the 32 bits in the specified word. 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over the 32 bits the specified word.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em word}]The word to calculate the parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_cc2f44b11de0ab22bd482118a2e09d49}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc32N@{PARITY\_\-\_\-calc32N}}
\index{PARITY__calc32N@{PARITY\_\-\_\-calc32N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc32N (const unsigned int $\ast$ {\em words}, int {\em nwords})}}
\label{PARITY_8ih_cc2f44b11de0ab22bd482118a2e09d49}


Calculates the parity over all the bits in the specified array of words (32-bit integers). 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, of the specified array of words. If a length of 0 is specified, 0 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em words}]The array of words (ints) to calculate the parity over. \item[{\em nwords}]The number of words (ints) in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_ee7c9793d76a7a6734b41ba0fae99e79}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc64@{PARITY\_\-\_\-calc64}}
\index{PARITY__calc64@{PARITY\_\-\_\-calc64}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc64 (unsigned long long int {\em ll})}}
\label{PARITY_8ih_ee7c9793d76a7a6734b41ba0fae99e79}


Calculates the parity over the 64 bits in the specified long long. 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over the 64 bits of the specified long long .\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ll}]The long long to calculate the parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_4b7653fb2d7cc925d593578cea134361}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc64N@{PARITY\_\-\_\-calc64N}}
\index{PARITY__calc64N@{PARITY\_\-\_\-calc64N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc64N (const unsigned long long int $\ast$ {\em lls}, int {\em nlls})}}
\label{PARITY_8ih_4b7653fb2d7cc925d593578cea134361}


Calculates the parity over all the bits in the specified array of long long words (64-bit integers). 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, of the specified array of long longs If a length of 0 is specified, 0 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lls}]The array of long longs to calculate the parity over. \item[{\em nlls}]The number of long longs in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_8a8b389f51157438014ab9a7c6cc06b1}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc8@{PARITY\_\-\_\-calc8}}
\index{PARITY__calc8@{PARITY\_\-\_\-calc8}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc8 (unsigned char {\em byte})}}
\label{PARITY_8ih_8a8b389f51157438014ab9a7c6cc06b1}


Calculates the parity over the 8 bits in the specified byte. 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over the 8 bits in the specified byte.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em byte}]The byte to calculate the parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_3c188e64baa49edf1e20ea74e53e9d93}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calc8N@{PARITY\_\-\_\-calc8N}}
\index{PARITY__calc8N@{PARITY\_\-\_\-calc8N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calc8N (const unsigned char $\ast$ {\em bytes}, int {\em nbytes})}}
\label{PARITY_8ih_3c188e64baa49edf1e20ea74e53e9d93}


Calculates the parity over all the bits in the specified array of bytes. 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over the specified array of bytes. If a length of 0 is specified, 0 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bytes}]The array of bytes to calculate the parity over. \item[{\em nbytes}]The number of bytes in array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_a28ba968a0e6489a6af9d48c93255b01}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd16@{PARITY\_\-\_\-calcOdd16}}
\index{PARITY__calcOdd16@{PARITY\_\-\_\-calcOdd16}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd16 (unsigned short int {\em hword})}}
\label{PARITY_8ih_a28ba968a0e6489a6af9d48c93255b01}


Calculates the odd parity over the 16 bits in the specified half word. 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, over the 16 bits the specified half word.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hword}]The half word (short int) to calculate the parity of. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_431a6a00ea6aaea689816314fddaa7e8}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd16N@{PARITY\_\-\_\-calcOdd16N}}
\index{PARITY__calcOdd16N@{PARITY\_\-\_\-calcOdd16N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd16N (const unsigned short int $\ast$ {\em hwords}, int {\em nhwords})}}
\label{PARITY_8ih_431a6a00ea6aaea689816314fddaa7e8}


Calculates the odd parity over all the bits in the specified array of half words (16-bit integers). 

\begin{Desc}
\item[Returns:]The parity, either 0 or 1, over all the bits in the specified array of half words (16-bit integers). If a length of 0 is specified, 1 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hwords}]The array of half words (16-bit integers) to calculate the odd parity over. \item[{\em nhwords}]The number of half words (16-bit integers) in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_cec2e0b0537df0398e5fb729f590fe2a}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd32@{PARITY\_\-\_\-calcOdd32}}
\index{PARITY__calcOdd32@{PARITY\_\-\_\-calcOdd32}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd32 (unsigned int {\em word})}}
\label{PARITY_8ih_cec2e0b0537df0398e5fb729f590fe2a}


Calculates the odd parity over the 32 bits in the specified word. 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, over the 32 bits the specified word.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em word}]The word to calculate the odd parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_edf62004e33a477537934b0537c24900}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd32N@{PARITY\_\-\_\-calcOdd32N}}
\index{PARITY__calcOdd32N@{PARITY\_\-\_\-calcOdd32N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd32N (const unsigned int $\ast$ {\em words}, int {\em nwords})}}
\label{PARITY_8ih_edf62004e33a477537934b0537c24900}


Calculates the odd parity over all the bits in the specified array of words (32-bit integers). 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, of the specified array of words. If a length of 0 is specified, 1 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em words}]The array of words (ints) to calculate the odd parity over. \item[{\em nwords}]The number of words (ints) in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_7ee4a3453deb3a21bd8a965f037d5a78}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd64@{PARITY\_\-\_\-calcOdd64}}
\index{PARITY__calcOdd64@{PARITY\_\-\_\-calcOdd64}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd64 (unsigned long long int {\em ll})}}
\label{PARITY_8ih_7ee4a3453deb3a21bd8a965f037d5a78}


Calculates the odd parity over the 64 bits in the specified long long. 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, over the 64 bits of the specified long long.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ll}]The long long to calculate the odd parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_a4be745c84d4adf7bf12f4c8b2f8ea5f}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd64N@{PARITY\_\-\_\-calcOdd64N}}
\index{PARITY__calcOdd64N@{PARITY\_\-\_\-calcOdd64N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd64N (const unsigned long long int $\ast$ {\em lls}, int {\em nlls})}}
\label{PARITY_8ih_a4be745c84d4adf7bf12f4c8b2f8ea5f}


Calculates the odd parity over all the bits in the specified array of long long words (64-bit integers). 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, of the specified array of long log words (64-bit integers). If a length of 0 is specified, 1 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lls}]The array of long long's to calculate the odd parity over. \item[{\em nlls}]The number of long long's in the array. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_12227e079017145093abfa8aedf56ded}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd8@{PARITY\_\-\_\-calcOdd8}}
\index{PARITY__calcOdd8@{PARITY\_\-\_\-calcOdd8}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd8 (unsigned char {\em byte})}}
\label{PARITY_8ih_12227e079017145093abfa8aedf56ded}


Calculates the odd parity over the 8 bits in the specified byte. 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, over the 8 bits in the specified byte.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em byte}]The byte to calculate the odd parity over. \end{description}
\end{Desc}
\hypertarget{PARITY_8ih_a2f313bd0d18461cc6b9adbe0abdd210}{
\index{PARITY.ih@{PARITY.ih}!PARITY__calcOdd8N@{PARITY\_\-\_\-calcOdd8N}}
\index{PARITY__calcOdd8N@{PARITY\_\-\_\-calcOdd8N}!PARITY.ih@{PARITY.ih}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}PARITY\_\-\_\-EXP\_\-FNC int PARITY\_\-\_\-calcOdd8N (const unsigned char $\ast$ {\em bytes}, int {\em nbytes})}}
\label{PARITY_8ih_a2f313bd0d18461cc6b9adbe0abdd210}


Calculates the odd parity over all the bits in the specified array of bytes. 

\begin{Desc}
\item[Returns:]The odd parity, either 0 or 1, over the specified array of bytes. If a length of 0 is specified, 1 is returned.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bytes}]The array of bytes to calculate the odd parity over. \item[{\em nbytes}]The number of bytes in array. \end{description}
\end{Desc}
