8 questions. Covers Building a tiny adder.
Questions 1 to 5 of 8
python def XOR(a, b): return a ^ b print([XOR(a, b) for a in (0, 1) for b in (0, 1)])
print(full_adder(1, 0, 1))
python def XOR(a, b): return a ^ b def AND(a, b): return a & b def OR(a, b): return a | b def half_adder(a, b): return XOR(a, b), AND(a, b) def full_adder(a, b, carry_in): first_sum, first_carry = half_adder(a, b) second_sum, second_carry = half_adder(first_sum, carry_in) return second_sum, OR(first_carry, second_carry)
python print(2 and 1, 2 & 1)
Use the arrows to put the steps in order.
4 question(s) left on this page.