Chapter 4 Binary, Boolean Logic, and Gates - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Chapter 4 Binary, Boolean Logic, and Gates

Description:

Convert the phrase 'Adam is not a good instructor and Math is fun' to a boolean expression ... The electronic embodiment of boolean logic. Gates. Circuits ... – PowerPoint PPT presentation

Number of Views:107
Avg rating:3.0/5.0
Slides: 17
Provided by: webhome2
Category:

less

Transcript and Presenter's Notes

Title: Chapter 4 Binary, Boolean Logic, and Gates


1
Chapter 4 Binary, Boolean Logic, and Gates
2
A Classic Joke....
  • There are 10 types of people in the world, those
    who can read binary and those who cannot

3
Two's Compliment Notation
  • A way of representing signed numbers in a
    computer
  • Algorithm
  • Convert the number to binary
  • Invert (flip) all bits
  • Add 1

4
Two's Compliment Example
  • Convert the number -20 to its 8-bit binary two's
    complement form
  • 2010 000101002
  • 00010100 inverted is 11101011
  • Adding 1 we get 11101100

5
Two's Compliment
  • One representation for 0
  • 000000002 is 010
  • 100000002 is -12810
  • 1 bit for sign, 7 bits to represent data
  • Thus what's the range of values?
  • Allows subtraction by addition

6
Boolean Logic
  • Logical expressions that always evaluate to two
    values true and false

7
Example
  • Convert the phrase Adam is not a good instructor
    and Math is fun to a boolean expression

8
Example (cont)
  • Let a represent the phrase Adam is a good
    instructor
  • Let b represent the phrase Math is fun
  • Then the boolean expression is
  • (NOT a) AND b
  • Sometimes written a b

9
Boolean Logic Operators
  • Sometimes called Truth Functional Connectives
  • a AND b
  • True only when both a and b are true
  • a OR b
  • False only when both a and b are false
  • NOT a
  • Reverses the truth-value of a

10
Precedence
  • Some expressions are ambiguous
  • NOT a AND b OR c
  • Should this be interpreted as
  • ((NOT a) AND b) OR c
  • (NOT (a AND b)) OR c
  • NOT ((a AND b) OR c)
  • NOT (a AND (b OR c))

11
Precedence (cont)
  • Typically (in the absence of parenthesis)
  • NOT is evaluated first
  • AND is evaluated next
  • OR is evaluated last
  • So example would be
  • ((NOT a) AND b) OR c

12
Truth Tables
  • Used to illustrate all the possible combinations
    of true/false values for a particular boolean
    expression
  • Ex truth table for a AND b

13
Gates
  • Text defn An electronic device that operates on
    a collection of binary inputs to produces a
    binary output
  • More concisely
  • The electronic embodiment of boolean logic

14
Gates
15
Circuits
  • Gates are the fundamental building blocks of
    circuits

16
Circuit Example
  • What is the equivalent boolean expression?
Write a Comment
User Comments (0)
About PowerShow.com