Trait snarkvm_wasm::traits::bits::FullAdder [−][src]
pub trait FullAdder<'a, F> where
F: Field, { fn add<CS>(
cs: CS,
a: &'a Self,
b: &'a Self,
carry: &'a Self
) -> Result<(Self, Self), SynthesisError>
where
CS: ConstraintSystem<F>; }
Expand description
Single bit binary adder with carry bit https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder sum = (a XOR b) XOR carry carry = a AND b OR carry AND (a XOR b) Returns (sum, carry)
Required methods
fn add<CS>(
cs: CS,
a: &'a Self,
b: &'a Self,
carry: &'a Self
) -> Result<(Self, Self), SynthesisError> where
CS: ConstraintSystem<F>,