Presentation is loading. Please wait.

Presentation is loading. Please wait.

Component 1 – 2A, B, C Binary Logic

Similar presentations


Presentation on theme: "Component 1 – 2A, B, C Binary Logic"— Presentation transcript:

1 Component 1 – 2A, B, C Binary Logic
Mr Petford

2 Thinking Task What can you tell me about this?

3 Thinking Task What can you tell me about this?
If there are CLOUDS and COLD there will be RAIN

4 Thinking Task What can you tell me about this?
If A and B are TRUE then Q is TRUE

5 Thinking Task

6 Thinking Task Q=1 when A is not 1 Only 1 and 1 = 1
1 and 0 = 0 (or does not = 1)

7 Learning Intentions 2A – Draw truth tables for Boolean expressions consisting of AND, OR, NOT, XOR, NAND and NOR logical operations 2B – Apply logical operations to combinations of conditions in programming, including clearing registers, masking, and encryption 2C - Simplify Boolean expressions using Boolean identities, rules and De Morgan’s laws

8 Binary Logic – Not Gate Logic Diagram If 0 is input it outputs 1
Boolean Algebra: P = A’ P = A Logic Diagram

9 Binary Logic – AND Gate Logic Diagram
If both inputs are 1 then the output is 1 Otherwise the output is 0 INPUT A B OUTPUT P Boolean Algebra: P = A.B P = AB P = AxB Logic Diagram

10 Boolean Algebra: P = A + B
Binary Logic – OR Gate If either input is 1 then the output is 1 Otherwise the output is 0 INPUT A B OUTPUT P Boolean Algebra: P = A + B Logic Diagram

11 Boolean Algebra: P = A ⊕ B
Binary Logic – XOR Gate If either input is 1 then the output is 1 UNLESS! Both are 1! Otherwise the output is 0 INPUT A B OUTPUT P Boolean Algebra: P = A ⊕ B Logic Diagram

12 Binary Logic – NAND Gate
NAND stands for NOT AND If both inputs are 1 then the output is 0 Otherwise the output is 1 A B P 1 INPUT A B OUTPUT P Boolean Algebra: P = A.B P = AB P = AxB Logic Diagram

13 Boolean Algebra: P = A+B
Binary Logic – OR Gate NOR stands for NOT OR If either input is 1 then the output is 0 Otherwise the output is 1 A B P 1 INPUT A B OUTPUT P Boolean Algebra: P = A+B Logic Diagram

14 Combining Logic Gates Logic Gates can be combined to produce logic systems. Consider the following examples and notice how the diagrams can be turned into expressions by “labelling the branches”.

15 Is your logic efficient?
It is possible to Evaluate a series of logic gates to see if the amount of them can be reduced. Lets consider the following example 1. Get the expression for this logic gate 2. Draw a truth table to show each part 3. Look for inefficiencies (This can be difficult just by looking)

16 How do I simplify Boolean Algebra?
In your exam you may be asked to simplify Boolean Algebra. That should be done using + Boolean Algebra Laws + De morgans Law Using conventional Algebra we can simplify expressions such as… simplify 2x + 6y. Giving an answer of 2(x+3y). OR.. + abc + bcd = bc(a+d) + 2xy – 4yz = 2y(x+2z) etc.

17 How do we simplify? Boolean algebra is very similar, we try to remove common elements to simplify the expression. There are a few things that we can do to enable the expression to become much simpler if we can remember some basic combinations that help to reduce terms significantly. These special terms are called identities, and you will have to remember them as they are not reproduced on the information sheet of the examination paper.

18 De Morgan's Law De Morgan did a lot of the work in the 19th Century that allows logic systems to exist today. His law is relating to NOT, OR and AND gates and allows us to use less gates. Less gates in a computer system makes it more efficient and allows us to use less space. Try these out and discover for yourself!

19 Algebra Laws - identity
The Sum(OR) of anything and Zero is the same as the original The sum (OR)of anything and One is always 1. The Sum(OR) of Anything and its self is the same as the original

20 Algebra Laws - identity
Next we can find complimenting inputs. Since either input must be 1 the sum(OR) is also 1.

21 Algebra Laws - identity
Just as there are four Sum (OR) identities There are also 4 multiplicative identities Which can be seen below

22 Algebra Laws - identity
Finally we have to consider double compliment. We can simply remove any double compliment to be left with the underlying expression

23 Algebra Laws - identity
To simplify…

24 Algebra Laws - commutative
The next law applies equally to both addition(OR) and Multiplication (AND). This basically states that the order of input does not effect the output.

25 Algebra Laws - distributive
This is the law that explains how to expand an expression formed by the product(AND) of a Sum(OR).

26 Algebra Laws - associative
This tells us that we can associate groups of added or multiplied parentheses without altering the truth of the equation.

27 Algebra Laws - redundancy law
This states that in some instances gates are redundant and can be removed altogether. This also applies to A · (A + B) = A

28 Simplifying Boolean Expressions (1)
Simplify the following expression. Simplification can begin by looking for common terms, in this case A is common to all terms so we can remove this outside a bracket as shown below:

29 Simplifying Boolean Expressions (2)
Now we can see that B is common to the first two terms inside the bracket, but it is not common to the last term so we cannot include this in the simplification, which now becomes: Using our sixth identity the term so the expression now becomes:

30 Simplifying Boolean Expressions (3)
Using our sixth identity the term so the expression now becomes: Using the first identity B.1 = B so the expression becomes

31 Simplifying Boolean Expressions (4)
Using our sixth identity again the term so the expression now becomes: Using the first identity A.1 = A so the expression finally becomes

32 De Morgans Law DeMorgan’s theorem allows the logic functions of NAND and NOR to be simplified. We do not have to go into in depth analysis of how De Morgan arrived at his theorem, just be able to use the result which is surprisingly simple. The rules are as follows: 1 - If you break a ‘bar’ change the sign underneath the break. 2 - If you complete a ‘bar’ change the sign underneath where the bar is joined.

33 Find out how! Draw the truth tables for the following…

34 If we start with , DeMorgan’s theorem suggests that this can be written as . The ‘bar’ has been broken and the sign changed underneath the break in the bar. We can check this by looking at the truth table below. This shows that the two logic expressions are the same. The rule seems to work, according to the truth tables but we have only used very basic logic expressions here to prove the rule. If we looked at a more realistic problem then this would involve more terms and a more complex expression.

35 Have a go… Find the Boolean Expressions for the following…

36 Have a go… Find the Boolean Expressions for the following…

37 Using De Morgans Theorm we can break this.
If we look at the first term we can see that there is a double ‘bar’ over the expression. This means that the term is inverted and then inverted again, which will return the original state of the term. Therefore the double inversion as it is called can be removed. We now apply DeMorgan’s theorem again to the second term to give the following: Again we have a double inversion, applied only to the variable C, which can be removed to leave the final expression as:

38 Homework – Pre-Reading
Chapter 3: Algorithms Flow Charts Pseudocode Variables and Constants Self-documents identifiers, annotation program layout


Download ppt "Component 1 – 2A, B, C Binary Logic"

Similar presentations


Ads by Google