need help on this question:
Draw up the list of possible inputs for a half adder and the
outputs that you expect. Implement a half adder in a few lines of python, so that the
variables o1 and o2 are based on i1 and i2.
2 i2= False
5 o2 =?
now i know the function should be something like this :h(i1, i2) =>o1, o2
i have come up with some coding but dont know the formula to put in and how to make all the coding work.
def half_adder(i1, i2):
o1 = # need formula here
o2 = # need formula here
return o1, o2
0 · ·