Software Layers 2 Introduction to unix 2



Download 0.58 Mb.
Page14/26
Date28.01.2017
Size0.58 Mb.
#10070
1   ...   10   11   12   13   14   15   16   17   ...   26

Boolean Algebra


Week 6


  • Boolean Algebra = formal system of describing Boolean logical statements (functions)  invented by Geoge Boole (1800’s)

  • Algebra = a set of elements (the carrier of the algebra), and operators defined on the carrier

  • Calculus = a method of reasoning by calculation with symbols...


The 7 Boolean Operators:

  • NOT: NOT X = 0 if X is 1, = 1 otherwise (X')

  • AND: X AND Y = 1 if X and Y are 1, = 0 otherwise (X*Y or X.Y)

  • NAND: X NAND Y = 0 if X & Y are 1, = 1 otherwise

  • OR: X OR Y = 0 if X & Y are 0, = 1 otherwise (X+Y)

  • NOR: X NOR Y = 1 if X & Y are 0, = 0 otherwise

  • XOR: X XOR Y = 0 if X & Y are the same, = 1 otherwise

  • XNOR: X XNOR Y = 1 if X & Y are the same, = 0 otherwise




INPUTS

BASIC OPERATORS

X

Y

X AND Y

X NAND Y

X OR Y

X NOR Y

X XOR Y

X XNOR Y

0

0

0

1

0

1

0

1

0

1

0

1

1

0

1

0

1

0

0

1

1

0

1

0

1

1

1

0

1

0

0

1


Analysing Boolean functions:


Method 1: Truth Tables

Given a function: F = (X OR (X AND Y)) OR (Y AND (Y OR (NOT Z)))



note: operator precedence is: NOT > AND > OR


Inputs

Intermediate computations...

Output

X

Y

Z

X AND Y

X OR (X AND Y)

NOT Z

Y OR (NOT Z)

Y AND (Y OR (NOT Z))

F

0

0

0

0

0

1

1

0

0

0

0

1

0

0

0

0

0

0

0

1

0

0

0

1

1

1

1

0

1

1

0

0

0

1

1

1

1

0

0

0

1

1

1

0

1

1

0

1

0

1

0

0

0

1

1

1

0

1

1

1

1

1

1

1

1

1

1

1

0

1

1

1


note: we can deduce that F = X OR Y
Method 2: Boolean algebra

Typical shorthand: *  AND +  OR '  NOT
F = (X OR (X AND Y)) OR (Y AND (Y OR (NOT Z)))

= (X + (X * Y)) + (Y * (Y + Z'))


F is a combination of: the logic operators (+, *, ') & operands (X, Y, Z)

Many operators (and functions) can be constructed from these basic ones:



  • X NAND Y = (X * Y)'

  • X NOR Y = (X + Y)'

  • X XOR Y = (X' * Y) + (X * Y')


eg: Evaluate: F = (X + (X * Y)) + (Y * (Y + Z')) when X = 1, Y = 0, Z = 1

= (1 + (1 * 0)) + (0 * (0 + 1'))

= (1 + 0) + (0 * (0 + 0))

= 1 + (0 * 0)

= 1 + 0

= 1
To simplify F we can use some laws:



  • Law 1: P * P = P

  • Law 2: P * (Q + R) = (P * Q) + (P * R)

  • Law 3: P + (P * Q) = P

F = (X + (X * Y)) + (Y * (Y + Z'))

= X + (Y * (Y + Z')) {using Law 3}

= X + ((Y * Y) + (Y * Z')) {using Law 2}

= X + (Y + (Y * Z')) {using Law 1}

= X + (Y) {using Law 2}

= X + Y




Download 0.58 Mb.

Share with your friends:
1   ...   10   11   12   13   14   15   16   17   ...   26




The database is protected by copyright ©ininet.org 2024
send message

    Main page