lecture 2

40
Lecture Lecture 2 2 Dr Richard Reilly Dept. of Electronic & Electrical Engineering Room 153, Engineering Building

Upload: gwenllian-baker

Post on 30-Dec-2015

13 views

Category:

Documents


0 download

DESCRIPTION

To insert your company logo on this slide From the Insert Menu Select “Picture” Locate your logo file Click OK To resize the logo Click anywhere inside the logo. The boxes that appear outside the logo are known as “resize handles.” Use these to resize the object. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture  2

Lecture Lecture 22

Dr Richard Reilly

Dept. of Electronic & Electrical Engineering

Room 153,

Engineering Building

Page 2: Lecture  2

• The main characteristic of a Digital System is its manipulation of discrete elements of information.

• Another term for a digital system would be a discrete information processing system.

BINARY SYSTEMS

Page 3: Lecture  2

1. Most information processing systems are constructed from switches, which are binary devices.

    on-off switches are the basic building blocks of digital systems.

    inherently binary

    Two natural states : on (closed) and off (open).

Why Binary ?Why Binary ?

Off

On

switcharm

terminal

Page 4: Lecture  2

2. The basic decision-making processes required of digital systems are binary.

    Digital systems are often required to make tests.

• Is Condition C1 true ? or Is condition C2 false ?.

    Examples of such decisions are :

    Has button (switch) X been pushed ?,

    Has temperature tmax been reached ?.

    Decisions of this kind are inherently binary because their outcomes are taken from the value-pair {true, false}.

Why Binary ?Why Binary ?

Page 5: Lecture  2

• The values that the two variable take may be called by different names

True and false

Yes and no, etc.

• As engineers it is appropriate to think in terms of voltages and assign the values of 1 and 0 corresponding to voltage levels.

Concept of Binary LogicConcept of Binary Logic

Page 6: Lecture  2

• Binary logic is used to describe, in a mathematical way, the manipulation and processing of binary information

 

• Binary logic consists of binary variables and logical operations.

Concept of Binary LogicConcept of Binary Logic

Page 7: Lecture  2

Logical Operators: AND Gate Logical Operators: AND Gate

A

BC

C A B .

AND gate Symbol

 

Function   A B C

Truth-Table   0 0 0

    1 0 0

    0 1 0

    1 1 1

   

Denote C thus defined : 

read as C = A AND B

Page 8: Lecture  2

OR Gate OR Gate

CA

B

C A B

OR gate Symbol

 

Function   A B C

Truth-Table   0 0 0

    1 0 1

    0 1 1

    1 1 1

   

Denote C thus defined : 

read as C = A OR B

Page 9: Lecture  2

Inverter NOT gate

Inverter NOT gateInverter NOT gate

V c c

R

V o

A

  If A = +5v     If A = 0v 

    switch is closed  Vo is 0 v

     switch is open  Vo is +5 v

  

Page 10: Lecture  2

The truth-table for this operator configuration is

Inverter NOT gateInverter NOT gate

A

10

Vo

01

V c c

R

V o

A

Page 11: Lecture  2

Inverter Inverter

A C

C A

NOT gate (logic inverter) Symbol

 

Function :   A C  

Truth-Table   0 1  

    1 0  

   

 

Denote C thus defined : 

read as C = NOT A

Page 12: Lecture  2

NAND gateNAND gate

V c c

R

V o

A

B

  If A = +5v and B = +5v   If A = 0vand B = +5v  If A = 0vand B = +5v  If A = 0vand B = 0v  

    switches are closed  Vo is 0 v

    Vo is +5 v

     Vo is +5 v

     Vo is +5 v

  

Page 13: Lecture  2

NAND Gate NAND Gate

A

BC

C A B .

NAND gate  Symbol

 

Function   A B C

Truth-Table   0 0 1

    1 0 1

    0 1 1

    1 1 0

   

Denote C thus defined : 

Page 14: Lecture  2

NOR gateNOR gate

 If A = +5v and B = +5v   If A = 0vand B = +5v  If A = 0vand B = +5v  If A = 0vand B = 0v  

   switches are closed  Vo is 0 v

    Vo is 0 v

     Vo is 0 v

     Vo is +5 v

  

Page 15: Lecture  2

NOR Gate NOR Gate

CA

B

C A B

NOR gate Symbol

 

Function   A B C

Truth-Table   0 0 1

    1 0 0

    0 1 0

    1 1 0

   

Denote C thus defined : 

Page 16: Lecture  2

Logical expressions AND, OR and NOT are said to be logically complete, that is using these three operations it is possible to realise any function.

 Logic Gates can have more than two inputs. Thus a three-input AND gate responds when with a logic-1 output if all three input signals are logic-1.

Implementation of Logical Implementation of Logical Functions using switches. Functions using switches.

Page 17: Lecture  2

• The mathematical system of binary logic is better known as Boolean or switching algebra.

• This algebra is conveniently used to describe the operation of complex networks of digital circuits.

 

• Designers of digital circuits use Boolean Algebra to transform circuit diagrams to algebraic expressions and vice versa.

Implementation of Logical Implementation of Logical Functions using switches. Functions using switches.

Page 18: Lecture  2

George BooleGeorge Boole

• George Boole had little formal education yet was a brilliant scholar.

• Made lasting contribution to mathematics in the areas of differential and difference equations as well as algebra.

• He published in 1854 his work “An Investigation of the Laws of Thought, on which are founded the Mathematical Theories of Logic an Probability”.

• Boole generated a mathematical analysis of logic.

Page 19: Lecture  2

• Boolean algebra like any other deductive mathematical system, may be defined with• a set of elements,

• a set of operators,

• a number of unproved axioms or postulates,

• It is a mathematical analysis of logic

Why do we use Boolean Algebra ?Due to its ability for mathematical analysis of logic to study digital systems.

Boolean AlgebraBoolean Algebra

Page 20: Lecture  2

• In Boolean algebra a proposition is either true or false (no in-between state possible), these proposition are denoted by letters (usually at start of the alphabet)

 

e.g. A. The grass is green TRUE

B. 3 is an even number FALSE

 

• We can combine these propositions to get Boolean Functions denoted by letters (from the end of the alphabet).

 e.g. Z = A AND B FALSE

Boolean AlgebraBoolean Algebra

Page 21: Lecture  2

• Several advantages for having a mathematical method for description of the internal workings of a computer.

• more convenient to calculate using expressions that represent switching circuits then it is to use schematic or even logical expressions

• just as an ordinary algebraic expression may be simplified by means of basic theorems, the expression describing a given switching circuit network may be reduced or simplified.

Boolean AlgebraBoolean Algebra

Page 22: Lecture  2

• Reducing and simplifying logic networks.

enabling the designer to simplify the circuitry used

achieving economy of construction

Reliability of operation

 

SimplificationSimplification

Page 23: Lecture  2

• When a variable is used in an algebraic formula, it is generally assumed that the variable may take on any numerical value.

•  However a variable in Boolean equations has a unique characteristic .

• it may assume only one of two possible states.

these states can be represented by the symbols 0 and 1. i.e. T or F

Fundamental Concepts of Boolean Algebra

zyx 52 assume x,y and z range through the entire field of real numbers

Page 24: Lecture  2

• Boolean algebra uses the operation called complementation and the symbol of this is

means “take the complement of A”

means “take the complement of A+B”

The complement operation can be defined quite simply as

ComplementationComplementation

A

A

BA

0

1

1

0

Page 25: Lecture  2

As we have seen the complementation operation is physically realised by a gate or circuit called an inverter.

Boolean OperatorsBoolean Operators

A

A B

A B

NOT A Complement of A

A OR B Logical Sum, True if either A OR B true

A AND B

Logical Product, True if both A AND B true

Page 26: Lecture  2

Examples of Boolean Functions

• To study a logical expression, it is very useful to construct a table of values for the variables.

then evaluate the expression for each possible combination of variables.

Boolean FunctionsBoolean Functions

BCAZ

CDABY

Page 27: Lecture  2

Evaluate

Evaluate a Boolean Evaluate a Boolean FunctionFunction

CBA

Page 28: Lecture  2

• List all possible versions of the input variables in a Truth Table

Evaluate a Boolean Evaluate a Boolean FunctionFunction

CBA A

00001111

B

00110011

C

01010101

Page 29: Lecture  2

Boolean Operations : AND,OR and Boolean Operations : AND,OR and NOTNOT

A

00001111

B

00110011

C

01010101

10101010

C

CBA

Page 30: Lecture  2

Boolean Operations : AND,OR and Boolean Operations : AND,OR and NOTNOT

A

00001111

B

00110011

C

01010101

 

10101010

 

00100010

C BC

CBA

Page 31: Lecture  2

Finally ORing or Logical Addition

Boolean Operations : AND,OR and Boolean Operations : AND,OR and NOTNOT

C BC A BCA

00001111

B

00110011

C

01010101

 

10101010

 

00100010

 

00101111

Page 32: Lecture  2

Rules of Boolean Algebra

• We represent FALSE with 0 and TRUE with 1.

• If we have a large number of propositions and a complicated Boolean function we may be able to simplify it using the concept of tautology (redundancy).

e.g. always TRUEalways TRUEalways FALSE

 We can use the complete set of rules of Boolean Algebra

to simplify expressions.

AAZ ABAZ

AAZ

Page 33: Lecture  2

1.      

2.      

3.      

4.      

5.      

6.      

7.      

8.      

9.      

10.     Commutative Laws

11.     

12.     Associative Laws

13.     

14.     

Distributive Law

15.      

16.      

     

17.      

18.      

19.     De Morgan’s Laws

20    

0 A A

1 1 A

A A A

A A 10 0 A

1 A A

A A A

A A 0

A AA B B A

A B B A

A B C A B C A B C ( ) ( )

A BC AB C ABC

A B C AB AC

A AC A A A B A

A AB A B

AB BC BC AB C

A B A B

A B A B

Page 34: Lecture  2

Rules of Boolean Algebra

We can extend De Morgan’s Laws to

Example of the Application of the Rules

A truth table for each expression will verify that both are equivalent

...... CBAABC

...... CBACBA

BCBA

BCABCCBABA

BCBBACBA

BCACBAZ

 Rule 4Rule 14

Rule 15

ABCCBA 11

Page 35: Lecture  2

A Specific Design Problem

A logical network has two inputs, A and B and output C. The relationship between the inputs and outputs is as

follows :     When A and B are 0’s C is to be 1    When A is 0 and B is 1 C is to be 0    When A is 1 and B is 0 C is to be 1    When A and B are 1’s C is to be 1

Page 36: Lecture  2

A Specific Design Problem

put this into a truth table.

A

0011

B

0101

C

1011

Page 37: Lecture  2

A Specific Design Problem

• Now add a new column for the product terms : • will contain each of the input variables for each row, • with the letter complemented when input value for the

variable is 0 and

• not complemented when the input value is 1.

A

0011

B

0101

C

1011

Product Terms

    

AB

AB

AB

AB

Page 38: Lecture  2

A Specific Design Problem

• When the product term is equal to 1

product term is removed and used as a sum-of -products expansion

 in this case 1st, 2nd and 4th rows are selected.

ABBABAC

Page 39: Lecture  2

A Specific Design Problem

simplifyRule 4

Rule 18 Rule :  

BBABAC

ABAC BABAA

BAC

Page 40: Lecture  2

A Specific Design Problem

Check using the Truth-Table :

Implementation :

A

0011

B

0101

 

1010

 

1011

B A B

CAB