From: Martin Mares Date: Sun, 3 Feb 2008 20:09:07 +0000 (+0100) Subject: Definitions of bitwise operations. X-Git-Tag: printed~248 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c2f341d3ea11c5d944917f04c2194e88ead1ffaa;p=saga.git Definitions of bitwise operations. --- diff --git a/macros.tex b/macros.tex index 25df2b3..5b8e23f 100644 --- a/macros.tex +++ b/macros.tex @@ -55,7 +55,7 @@ \def\band{\bop{and}} \def\bor{\bop{or}} \def\bxor{\bop{xor}} -\def\bnot{\bop{not}} +\def\bnot{\mathop{\hbox{\sc not}}} % A reversed version of \ddots with extra space at the top to get good alignment of exponents. \def\rddots{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu diff --git a/notation.tex b/notation.tex index 77f174d..80ebe3f 100644 --- a/notation.tex +++ b/notation.tex @@ -51,6 +51,12 @@ \n{$\(x)$}{the position of the lowest bit set in~$x$ \[lsbmsb]} \n{$\(x)$}{the position of the highest bit set in~$x$ \[lsbmsb]} \n{$\bf x$}{a~vector with elements $x_1,\ldots,x_d$; $x$ is its bitwise encoding \[vecnota]} +\n{$\band$}{bitwise conjunction: $(x\band y)[i]=1$ iff $x[i]=1 \land y[i]=1$} +\n{$\bor$}{bitwise disjunction: $(x\bor y)[i]=1$ iff $x[i]=1 \lor y[i]=1$} +\n{$\bnot$}{bitwise negation: $(\bnot x)[i]=1-x[i]$} +\n{$\bxor$}{bitwise non-equivalence: $(x\bxor y)[i]=1$ iff $x[i]\ne y[i]$} +\n{$x \shl n$}{bitwise shift of~$x$ by $n$~positions to the left: $x\shl n = x\cdot 2^n$} +\n{$x \shr n$}{bitwise shift of~$x$ by $n$~positions to the right: $x\shr n = \lfloor x/2^n \rfloor$} } %--------------------------------------------------------------------------------