Andy C. answered 09/21/17
Tutor
4.9
(27)
Math/Physics Tutor
Logical OR and Logical AND on 8-bit integers
The operations are defined as:
1 or 1 = 1
0 or 1 = 1
1 or 0 = 1
0 or 0 = 0
and
0 and 0 = 0
0 and 1 = 0
1 and 0 = 0
1 and 1 =0
The concise definition is: A or B is 1 if EITHER A or B is 1 (or both); zero otherwise
a AND b is 0 if either A or B is 0 (or both); one otherwise
EX. X = 12 = 00001100 and
Y = -5 = 10000101 <--- sign but set
X or Y = 12 or -5 = 10001101 = - 13
x AND y =12 and -5 = 00000100 = 4
Properties of closure, associative, identity, and inverse must hold for them to be groups.
Barring a small technicality, these operators form an ABELIAN group.
I have included a "PROOF" in the document AND OR ABELINAN GROUP .txt, as the proof
is too long to post here because there are truth tables involved for the associative property.
HAPPY READING
X Y Z (X or Y) (X or Y) or Z Y or Z X or (Y or Z)
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 1 1 1 1
0 1 1 1 1 1 1
1 0 0 1 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 1 1 1 1