\hypertarget{PARITY_8h}{
\section{PARITY.h File Reference}
\label{PARITY_8h}\index{PARITY.h@{PARITY.h}}
}
Priority calculation, callable interface. 

\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{PARITY_8h_a083821df7d8853c59384bfbf5c09e0f}{PARITY\_\-K\_\-EVEN}~0x6996
\begin{CompactList}\small\item\em A vector of bits whose bit number (counting from least significant bit = 0) gives the even parity of a nibble of that bit number. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_8257452bf526e3902ef674bd547e773c}{
\#define \hyperlink{PARITY_8h_8257452bf526e3902ef674bd547e773c}{PARITY\_\-4}(\_\-nibble)~((PARITY\_\-K\_\-EVEN $>$$>$ ((\_\-nibble) \& 0xf)) \& 1)}
\label{PARITY_8h_8257452bf526e3902ef674bd547e773c}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-nibble\/} is {\em even\/}, 1 if the parity is {\em odd\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_eab1c2e6580f248e6b6c44d43d39a730}{
\#define \hyperlink{PARITY_8h_eab1c2e6580f248e6b6c44d43d39a730}{PARITY\_\-8}(\_\-byte)~PARITY\_\-4 ( ((\_\-byte ) $>$$>$  4) $^\wedge$ (\_\-byte ))}
\label{PARITY_8h_eab1c2e6580f248e6b6c44d43d39a730}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-byte\/} is {\em even\/}, 1 if the parity is {\em odd\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_79b34f70dc4bebb5270d3c6d07949931}{
\#define \hyperlink{PARITY_8h_79b34f70dc4bebb5270d3c6d07949931}{PARITY\_\-16}(\_\-hword)~PARITY\_\-8 ( ((\_\-hword) $>$$>$  8) $^\wedge$ (\_\-hword))}
\label{PARITY_8h_79b34f70dc4bebb5270d3c6d07949931}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-hword\/} is {\em even\/}, 1 if the parity is {\em odd\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_be5847d95457609761d0b1c8bb053d6b}{
\#define \hyperlink{PARITY_8h_be5847d95457609761d0b1c8bb053d6b}{PARITY\_\-32}(\_\-word)~PARITY\_\-16( ((\_\-word ) $>$$>$ 16) $^\wedge$ (\_\-word ))}
\label{PARITY_8h_be5847d95457609761d0b1c8bb053d6b}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-word\/} is {\em even\/}, 1 if the parity is {\em odd\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_3d8cccbd7eb1644cac05dc1fe15c9fe6}{
\#define \hyperlink{PARITY_8h_3d8cccbd7eb1644cac05dc1fe15c9fe6}{PARITY\_\-64}(\_\-ll)~PARITY\_\-32( ((\_\-ll   ) $>$$>$ 32) $^\wedge$ (\_\-ll   ))}
\label{PARITY_8h_3d8cccbd7eb1644cac05dc1fe15c9fe6}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-ll\/} is {\em even\/}, 1 if the parity is {\em odd\/}. \item\end{CompactList}\item 
\#define \hyperlink{PARITY_8h_cd67dc91563adedf8ecd90d77c925541}{PARITY\_\-K\_\-ODD}~0x9669
\begin{CompactList}\small\item\em A vector of bits whose bit number (counting from least significant bit = 0) gives the odd parity of a nibble of that bit number. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_d5ec14bb9850aad85fbbe6e8a269c9e8}{
\#define \hyperlink{PARITY_8h_d5ec14bb9850aad85fbbe6e8a269c9e8}{PARITY\_\-ODD4}(\_\-nibble)~((PARITY\_\-K\_\-ODD $>$$>$ ((\_\-nibble) \& 0xf)) \& 1)}
\label{PARITY_8h_d5ec14bb9850aad85fbbe6e8a269c9e8}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-nibble\/} is {\em odd\/}, 1 if the parity is {\em even\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_bb6693a1c46e7ee29a0074df2ee35654}{
\#define \hyperlink{PARITY_8h_bb6693a1c46e7ee29a0074df2ee35654}{PARITY\_\-ODD8}(\_\-byte)~PARITY\_\-ODD4 ( ((\_\-byte ) $>$$>$  4) $^\wedge$ (\_\-byte ))}
\label{PARITY_8h_bb6693a1c46e7ee29a0074df2ee35654}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-byte\/} is {\em odd\/}, 1 if the parity is {\em even\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_b3e478a952e761bbf9d49ebb393f2344}{
\#define \hyperlink{PARITY_8h_b3e478a952e761bbf9d49ebb393f2344}{PARITY\_\-ODD16}(\_\-hword)~PARITY\_\-ODD8 ( ((\_\-hword) $>$$>$  8) $^\wedge$ (\_\-hword))}
\label{PARITY_8h_b3e478a952e761bbf9d49ebb393f2344}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-hword\/} is {\em odd\/}, 1 if the parity is {\em even\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_04b44efa6cdd8e37aa15f18aef0061f4}{
\#define \hyperlink{PARITY_8h_04b44efa6cdd8e37aa15f18aef0061f4}{PARITY\_\-ODD32}(\_\-word)~PARITY\_\-ODD16( ((\_\-word ) $>$$>$ 16) $^\wedge$ (\_\-word ))}
\label{PARITY_8h_04b44efa6cdd8e37aa15f18aef0061f4}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-word\/} is {\em odd\/}, 1 if the parity is {\em even\/}. \item\end{CompactList}\item 
\hypertarget{PARITY_8h_7f116a393c9f24b6f3b48fed0d054478}{
\#define \hyperlink{PARITY_8h_7f116a393c9f24b6f3b48fed0d054478}{PARITY\_\-ODD64}(\_\-ll)~PARITY\_\-ODD32( ((\_\-ll   ) $>$$>$ 32) $^\wedge$ (\_\-ll   ))}
\label{PARITY_8h_7f116a393c9f24b6f3b48fed0d054478}

\begin{CompactList}\small\item\em Returns 0 if the parity of {\em \_\-ll\/} is {\em odd\/}, 1 if the parity is {\em even\/}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{PARITY_8h_402e60a2052fd38aef13188722777712}{
int \textbf{PARITY\_\-calc8} (unsigned char byte)}
\label{PARITY_8h_402e60a2052fd38aef13188722777712}

\item 
\hypertarget{PARITY_8h_21ebb6f91fd7cd909d253e65f39b0e2d}{
int \textbf{PARITY\_\-calc16} (unsigned short int hword)}
\label{PARITY_8h_21ebb6f91fd7cd909d253e65f39b0e2d}

\item 
\hypertarget{PARITY_8h_2746a3d02c460834fba340ebcd5c1050}{
int \textbf{PARITY\_\-calc32} (unsigned int word)}
\label{PARITY_8h_2746a3d02c460834fba340ebcd5c1050}

\item 
\hypertarget{PARITY_8h_b0f07f7b4bb950681eb18185dab83f96}{
int \textbf{PARITY\_\-calc64} (unsigned long long int ll)}
\label{PARITY_8h_b0f07f7b4bb950681eb18185dab83f96}

\item 
\hypertarget{PARITY_8h_5c559c1422771bec2d2acb2801c1a76a}{
int \textbf{PARITY\_\-calc8N} (const unsigned char $\ast$bytes, int nbytes)}
\label{PARITY_8h_5c559c1422771bec2d2acb2801c1a76a}

\item 
\hypertarget{PARITY_8h_7a918bafe3db46f4787fdfd941d34583}{
int \textbf{PARITY\_\-calc16N} (const unsigned short int $\ast$hwords, int nhwords)}
\label{PARITY_8h_7a918bafe3db46f4787fdfd941d34583}

\item 
\hypertarget{PARITY_8h_e8d9f1bb450a977da61d7ce688a45f2a}{
int \textbf{PARITY\_\-calc32N} (const unsigned int $\ast$words, int nwords)}
\label{PARITY_8h_e8d9f1bb450a977da61d7ce688a45f2a}

\item 
\hypertarget{PARITY_8h_b606b670a9e659c0401f1670945512de}{
int \textbf{PARITY\_\-calc64N} (const unsigned long long int $\ast$lls, int nlls)}
\label{PARITY_8h_b606b670a9e659c0401f1670945512de}

\item 
\hypertarget{PARITY_8h_c4a16f133dcde9d7f3e3cb3406da7091}{
int \textbf{PARITY\_\-calcOdd8} (unsigned char byte)}
\label{PARITY_8h_c4a16f133dcde9d7f3e3cb3406da7091}

\item 
\hypertarget{PARITY_8h_1b9787a89d6a249ac59a8133d90c1472}{
int \textbf{PARITY\_\-calcOdd16} (unsigned short int hword)}
\label{PARITY_8h_1b9787a89d6a249ac59a8133d90c1472}

\item 
\hypertarget{PARITY_8h_e09f157ea2691e25e3cbb1554876f371}{
int \textbf{PARITY\_\-calcOdd32} (unsigned int word)}
\label{PARITY_8h_e09f157ea2691e25e3cbb1554876f371}

\item 
\hypertarget{PARITY_8h_96f8933fa4f298fa148cb34e832dbad0}{
int \textbf{PARITY\_\-calcOdd64} (unsigned long long int ll)}
\label{PARITY_8h_96f8933fa4f298fa148cb34e832dbad0}

\item 
\hypertarget{PARITY_8h_7b3bf2860617bc9dcf949611e4050b1d}{
int \textbf{PARITY\_\-calcOdd8N} (const unsigned char $\ast$bytes, int nbytes)}
\label{PARITY_8h_7b3bf2860617bc9dcf949611e4050b1d}

\item 
\hypertarget{PARITY_8h_024ce29462c9a294ac448682baa6b077}{
int \textbf{PARITY\_\-calcOdd16N} (const unsigned short int $\ast$hwords, int nhwords)}
\label{PARITY_8h_024ce29462c9a294ac448682baa6b077}

\item 
\hypertarget{PARITY_8h_230f1df3bd5d2523393ac206c1f779a5}{
int \textbf{PARITY\_\-calcOdd32N} (const unsigned int $\ast$words, int nwords)}
\label{PARITY_8h_230f1df3bd5d2523393ac206c1f779a5}

\item 
\hypertarget{PARITY_8h_042b15702ffbe923c0046b3d249617f3}{
int \textbf{PARITY\_\-calcOdd64N} (const unsigned long long int $\ast$lls, int nlls)}
\label{PARITY_8h_042b15702ffbe923c0046b3d249617f3}

\end{CompactItemize}


\subsection{Detailed Description}
Priority calculation, callable interface. 

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


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


\begin{Desc}
\item[]For full documentation and explanation of the algorithms, see the inline versions, documented in \hyperlink{PARITY_8ih}{PARITY.ih}. For the parity calculations\end{Desc}
\begin{itemize}
\item Over immediate values (a single byte, short int, int, long long), one should the macro versions.\item Over variables values (a single byte,short int, int, long long), one should use the inline versions for the type safety they provide.\item Over arrays, one has a choice between the inlines (possibly faster) and the traditional call interface (less code) \end{itemize}


\subsection{Define Documentation}
\hypertarget{PARITY_8h_a083821df7d8853c59384bfbf5c09e0f}{
\index{PARITY.h@{PARITY.h}!PARITY_K_EVEN@{PARITY\_\-K\_\-EVEN}}
\index{PARITY_K_EVEN@{PARITY\_\-K\_\-EVEN}!PARITY.h@{PARITY.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PARITY\_\-K\_\-EVEN~0x6996}}
\label{PARITY_8h_a083821df7d8853c59384bfbf5c09e0f}


A vector of bits whose bit number (counting from least significant bit = 0) gives the even parity of a nibble of that bit number. 

\begin{Desc}
\item[]This is a bit vector whose bit number gives the even parity of that bit number. The array is {\em indexed\/} by left shifting by the bit number. This array is used to return a 0 if the parity is EVEN and a 1 if the parity is ODD.\end{Desc}
The following table maps a number {\em idx\/} into an even parity. The bottom line is the hex number representing the parity bit array.



\footnotesize\begin{verbatim}
       Idx  Parity    Index  Parity   Index Parity    Index Parity
         C       0        8       1       4      1        0      0
         D       1        9       0       5      0        1      1
         E       1        A       0       6      0        2      1
         F       0        B       1       7      1        3      0
      0x         6                9              9               6
  \end{verbatim}
\normalsize
 \hypertarget{PARITY_8h_cd67dc91563adedf8ecd90d77c925541}{
\index{PARITY.h@{PARITY.h}!PARITY_K_ODD@{PARITY\_\-K\_\-ODD}}
\index{PARITY_K_ODD@{PARITY\_\-K\_\-ODD}!PARITY.h@{PARITY.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PARITY\_\-K\_\-ODD~0x9669}}
\label{PARITY_8h_cd67dc91563adedf8ecd90d77c925541}


A vector of bits whose bit number (counting from least significant bit = 0) gives the odd parity of a nibble of that bit number. 

\begin{Desc}
\item[]This is a bit vector whose bit number gives the odd parity of that bit number, The array is {\em indexed\/} by left shifting by the bit number. This array is used to return a 0 if the parity is ODD and a 1 if the parity is EVEN.\end{Desc}
The following table maps a number {\em idx\/} into an even parity. The bottom line is the hex number representing the parity bit array.



\footnotesize\begin{verbatim}
       Idx  Parity    Index  Parity   Index Parity    Index Parity
         C       1        8       0       4      0        0      1
         D       0        9       1       5      1        1      0
         E       0        A       1       6      1        2      0
         F       1        B       0       7      0        3      1
      0x         9                6              6               9
  \end{verbatim}
\normalsize
 