2. Arith Package

The Arith package implements some functions that correspond to infix operators.

function Arith::booland(Bool x1, Bool x2) → Bool

Returns logical “and” of inputs. Named to avoid conflict with the Verilog keyword “and”.

function Arith::boolor(Bool x1, Bool x2) → Bool

Returns logical “or” of inputs. Named to avoid conflict with the Verilog keyword “or”.

function Arith::eq(a x1, a x2)) → Bool
function Arith::add(a x1, a x2) → a

Returns sum of inputs. Requires Arith#(a).

function Arith::mul(a x1, a x2) → a

Returns product of inputs. Requires Arith#(a).

function Arith::rshift(Bit#(b) x1, Integer i) → Bit#(b)

Returns input right shifted by i bits.

function Arith::a) vadd(Vector#(n, a) x1, Vector#(n, a) x2) → Vector#(n,

Returns sum of input vectors.

function Arith::a) vmul(Vector#(n, a) x1, Vector#(n, a) x2) → Vector#(n,

Returns element-wise product of input vectors.

function Arith::Bit#(b)) vrshift(Vector#(n, Bit#(b)) x1, Integer i) → Vector#(n,

Right shifts the elements of the input vector by i bits.