convert/mod2 - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Conversion : convert/mod2

convert/mod2

convert expression to mod 2 form

 Calling Sequence convert(expr, mod2)

Parameters

 expr - expression

Description

 • The convert/mod2 function reduces an expression modulo 2.
 • The expression can contain the following Boolean operators:

 and not or xor implies

 These are converted to their equivalent modulo 2 representation.

Examples

 > $\mathrm{convert}\left(7{x}^{3}y+5,\mathrm{mod2}\right)$
 ${x}{}{y}{+}{1}$ (1)
 > $\mathrm{convert}\left({x}^{2}{y}^{2}+xy,\mathrm{mod2}\right)$
 ${0}$ (2)
 > $\mathrm{convert}\left(x\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{not}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}y,\mathrm{mod2}\right)$
 ${x}{}\left({1}{+}{y}\right)$ (3)
 > $\mathrm{convert}\left(x\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}y,\mathrm{mod2}\right)$
 ${x}{}{y}{+}{x}{+}{y}$ (4)
 > $\mathrm{convert}\left(x\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{xor}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}y⇒z,\mathrm{mod2}\right)$
 ${1}{+}{x}{+}{y}{+}\left({x}{+}{y}\right){}{z}$ (5)