Reduction Operator
Reduction Operator
Reduction Operator
Reduction Operator
Keysymbols: &, ~&, |, ~|, ^, ~^, ^~. The reduction operators are and, nand, or, nor, xor xnor and an alternative xnor. They take one operand and perform a bit-by-next-bit operation, starting with the two leftmost bits, giving a 1-bit result.
mdl rdcTs; oue eutet rg[:]a b,; e 30 , c iiilbgn nta ei a=4b11 '11; b=4b11 '00; c=4b01 '01; $ipab&a;/ btiead (aea 1111,eautst 1 dsly( ) / iws n, sm s &&&) vlae o $ipab|b;/ btie o,(aea 0101,eautst 1 dsly( ) / iws r sm s |||) vlae o $ipab^b;/ btiexr (aea 0101,eautst 0 dsly( ) / iws o, sm s ^^^) vlae o ed n edoue/ rdcTs nmdl / eutet
Note: the bitwise xor and xnor are useful in generating parity checks. Please note carefully the differences in logical, bitwise and reduction operators. The symbols for bitwise and reduction overlap but the number of operands is different in those cases. EXERCISE What do the following evaluate to ?
$ipab&1b0; dsly( '1) $ipab|3b0x; dsly( '11) $ipab^4b11; dsly( '10)
www.see.ed.ac.uk/~gerard/Teach/Verilog/manual/Operators/reduction.html
1/1