Binary And Hexadecimal Numeration And Logical Operations Worksheet - Object Oriented Programming In Java, Marian Manyo Page 11

ADVERTISEMENT

J A V A
L A B
M A N U A L
OR
P
Now consider the logical operation OR. The statement
OR
Fa;se
True
December 25 is Christmas Day OR February 13 is Valentine's Day
False
F
T
is
. That is, P OR Q is
.
true
true
Q
In fact, P OR Q is only
if both P and Q are
.
false
false
True
T
T
When using binary digits, this translates into:
0
1
0
1
OR 0
OR 0
OR 1
OR 1
0
1
1
1
XOR
P
The XOR operation is read as exclusive or.
The statement P XOR Q is
if exactly one of P and Q is
.
true
true
XOR
Fa;se
True
If both P and Q are
, P XOR Q is
.
true
false
False
F
T
For example, the statement.
Q
True
T
F
December 25 is Christmas Day XOR February 13 is Valentine's Day
is
. But, the statement
true
December 25 is Christmas Day XOR February 14 is Valentine's Day
is
.
false
When using binary digits, this translates into:
0
1
0
1
XOR 0
XOR 0
XOR 1
XOR 1
0
1
1
0
NOT
There is one more logical operation that is applied to only one Boolean operand and that is NOT. NOT
negates the value of an expression. That is,
or rather
NOT (December 25 is Christmas Day)
December 25 is not Christmas Day
is
. That is, if P is
, NOT P is
. And, if P is
, NOT P is
. When using binary digits,
false
true
false
false
true
this translates into:
NOT 0
1
NOT 1
0
Each of these operations is implemented in a computer with a device called a gate. An AND, OR, or XOR
gate has two inputs and outputs one value, a NOT gate has one input and outputs one value. The
circuitry of a computer is built using these gates as the lowest level building blocks.
M A R I A N M A N Y O , M A R Q U E T T E U N I V E R S I T Y
P A G E 1 . 1 1

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education