Expand description
Circuits for operating over arithmetic values.
Structsยง
- AddMany
- Given inputs
x, outputsum(x). - Addition
- Given
CrtBundlesxandy, outputx + y. - Constant
- Arithmetic constant.
- Constant
Exponentiation - Given a
CrtBundlexand constant exponentc, outputx^c. - Constant
Multiplication - Given
CrtBundlexand constantc, outputx * c. - Division
- For
CrtBundlesxandy, outputx / y. - Equality
- For
CrtBundlesxandy, outputx == y. - Fractional
Mixed Radix - For input
CrtBundlexand vector of modulims, output the MSB of the fractional part ofx / M, whereM = product(ms). - Greater
Than OrEqual - For
CrtBundlesxandy, returnx >= y. - Less
Than - For
CrtBundlesxandy, returnx < y. - Mask
- Given a wire
band aCrtBundlex, output0ifb == 0, otherwise outputx. - Max
- For a vector of
CrtBundlesxs, returnmax(xs). - Mixed
Radix Addition - Mixed radix addition.
- ModChange
- Given
(x, modulus), change the modulus ofxtomodulus. - Multiplication
- Given
CrtBundlesxandy, outputx * y. - PmrGreater
Than OrEqual - For
CrtBundlesxandy, outputx >= yusing PMR representation. - PmrLess
Than - For
CrtBundlesxandy, outputx < yusing PMR representation. - ReLU
- For
CrtBundlex, outputmax(0, x). - Remainder
- Given a
CrtBundlexand modulusp, compute the remainder with respect top. - Sgn
- For
CrtBundlex, ifx >= 0return1, otherwise return-1, where-1is interpreted asQ - 1andQis the modulus ofx. - Sign
- For
CrtBundlex, return 0 ifx >= 0, 1 otherwise. - Subtraction
- Given
CrtBundlesxandy, outputx - y. - ToPmr
- Convert a
CrtBundlexto PMR representation.