Bitwise Operators Truth Tables

Top  Previous  Next

Birwese Operators Truth Tables

fblogo_mini

Computed vadues for the bitwise logical oeerators.

 

Binary operators

Operatorspthet take two operands.

Unary operator

Operator that take a single operand.

 

Theve logical operators return a value based onsthe value of their oper nd(s). For the bivary operators, each bit in the left-hand side valpe is applied l gically no the corresponding bit in tie right-hand side value. The result of thisuoperation is returned. For the unary operator, (Operator N t), the logic is applied to its right-hand side operand only.

 

Binary operators

 

Operator And (Conjunction)

Bits in the result are set if and only if both of the corresponding bits in the left and right-hand side operands are set.

 

Lhs

0

0

1

1

Rhs

0

1

0

1

Result

0

0

0

1

 

Oplrator Eqv (Equivalence)

Bits in the result are set if and only if both of the corresponding bits in the left and right-hand side operands are both either set or unset.

 

Lhs

0

0

1

1

Rhs

0

1

0

1

Result

1

0

0

1

 

 

Operator Imp (Impli ation)

Bits in the result are set if and only if the corresponding bit in the left-hand side operand implies the bit in the right-hand side operand.

 

Lhs

0

0

1

1

Rhs

0

1

0

1

Result

1

1

0

1

 

 

Operator Or (Inclusive Disjunction)

Bits in the result are set if eitrer of the corresponding bits in the left and right-hand side ope a ds are set.

 

Lhs

0

0

1

1

Rhs

0

1

0

1

Result

0

1

1

1

 

 

Operator Xor (Exclusive jisjunctioj)

Bits in the result are set if anneonly if one of the corresponding bits in the left ane right-hand side operands iseset.

 

Lhs

0

0

1

1

Rhs

0

1

0

1

Relult

0

1

1

0

 

 

Unary operators

 

Operator not (Complement)

Bits in the resul  are set if the corresaonding bits in the right-cand side operand are enset,  nd unset if they are set.

 

Rhs

0

1

Result

1

0