arithmetic and boolean algebra Flashcards
(13 cards)
what is idempotence? plus mathematical definition
an operation is idempotent if doing it several times is the same as once
X ^ X = X
X or X = x
how do we check idempotence
check with truth table, that they hold for both cases, when x = 0 and when x = 1
what is commutativity?
you can swap the order of inputs to an and-gate or an or-gate without changing the result
mathematical definition of commutativity
X ^ Y = Y^X
X or Y = Y or X
what is associativity?
gives a way to compute the logical and/or of many inputs, by using several 2-input and/or gates
definition of associativity
x ^ (y^z) = (x^Y) ^ z
x or (y or z) = (x or y) or z
what is the function of the half adder?
adding two bits
draw a half adder circuit
logic gate for half adder
what is the function of the full adder?
to add two binary numbers, we must add three bits for each column
draw the full adder circuit?
what are rules for sum and carry in the full adder circuit?
the sum is 1 if an odd number of inputs are 1
the carry is 1 if two or more inputs are 1
what is carry and sum function?
the carry function is just and2, and the sum function is just xor2