From c2f341d3ea11c5d944917f04c2194e88ead1ffaa Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 3 Feb 2008 21:09:07 +0100 Subject: [PATCH] Definitions of bitwise operations. --- macros.tex | 2 +- notation.tex | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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$} } %-------------------------------------------------------------------------------- -- 2.39.5