0% found this document useful (0 votes)
37 views

Boolean Logic

Mata Kuliah Pemrosesan Data- FTG Unpad

Uploaded by

Maria Mawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Boolean Logic

Mata Kuliah Pemrosesan Data- FTG Unpad

Uploaded by

Maria Mawar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

Boolean Logic

LOGICAL EVALUATION USING BOOLEAN OPERATOR

Comparing 2 variables
The answer:

T(RUE)
F(FALSE)

Each answer will be connected to some different


statement
Can be program termination, do another job with
or without correlated to the evaluate variable, do
another job
Usually in IF..THEN form

BOOLEAN OPERATORS & TRUTH TABLE

BOOLEAN ALGEBRA

A Boolean operator can be completely


described using a truth table.

The truth table for the Boolean


operators AND and OR are shown at
the right.

The AND operator is also known as a


Boolean product.

The OR operator is the Boolean sum.

BOOLEAN ALGEBRA

The truth table for the Boolean


NOT operator is shown at the
right.

The NOT operation is most


often designated by an over
bar. It is sometimes indicated
by a prime mark ( ) or an
elbow ().

BOOLEAN ALGEBRA

A Boolean operator can be expressing as a vent


diagram

Suppose have 2 different lithology: Limestone and


Sandstone:

Limestone

Sandstone

Searching: NOT

Search: Sandstone

Search: Limestone

Limestone

Sandstone

Limestone

Sandstone

Searching:

Search: AND

Search: OR

Limestone

Sandstone

Limestone

Sandstone

BOOLEAN ALGEBRA

Digital computers contain circuits that implement


Boolean functions.
The simpler that we can make a Boolean function, the
smaller the circuit that will result.
Simpler circuits are cheaper to build, consume less
power, and run faster than complex circuits.
With this in mind, we always want to reduce our Boolean
functions to their simplest form.
There are a number of Boolean identities that help us to
do this.

The Boolean operator (electrical)

Can be representing
as:

switch,
relay or
gate
X
Y
X
Y
X

XY

X+Y
X

10

The Boolean AND operator

0
0
1
0

0
1
1
1

11

AND (example)

INPUT LITH$, POR


IF LITH$=SST AND POR >=10% THEN

ELSE

PRINT POTENTIAL RESERVOIR ROCK


PRINT NO RESERVOIR

END
Note: Lith: vary
porosity cut off 10%

Expr-1

Expr-2

AND

F
12

The Boolean OR operator

0
0
1
0

0
1
1
1

13

OR (example)

INPUT LITH$
IF LITH$=LST OR LITH$= SST THEN

ELSE

PRINT POSSIBLE RESERVOIR


PRINT NO RESERVOIR

END

Expr-1

Expr-2

OR

F
14

The Boolean NOT operator

0
15

NOT (example)

INPUT LITH$
IF NOT LITH$= SST THEN

PRINT SOURCE ROCK

ELSE

PRINT INDETERMINITE

END

If only 2 lith=SST and SH


Expr-1

NOT

16

Derivative Boolean operator (XOR)


X

X+Y

0
0
1
0

0011

1
1

1100
0101

0100
0110

0011
0101

1010

0010

17

XOR (example)

INPUT MIN$
IF MIN$=GLAUCONITE XOR MIN$= PYRITE
THEN

ELSE

PRINT MARINE FACIES


PRINT IMPOSSIBLE

END

Expr-1

Expr-2

XOR

F
18

Derivative Boolean operator (XNOR/EQV)


X

X+Y

0
0
1
0

0011

0
1
1
1

1100
0101

0100
0110

0011
0101

1010

1001

0010

19

XNOR/ EQV

INPUT COL$
IF COL$ =BROWN EQV COL$ = RED THEN

ELSE

PRINT NONMARINE
PRINT POSSIBLE MARINE FACIES

END
Note:

How about Not Brown & not RED

Expr-1

Expr-2

EQV

T
20

IMP

INPUT LITH$
INPUT POROSITY$
IF LITH$= ARKOSE IMP LITH$= SST THEN

ELSE

PRINT RESERVOIR ROCK


PRINT NONRESERVOIR

END
Note:

If not arkose and not SST?

Expr-1

Expr-2

IMP

T
21

You might also like