A-level Computer Science

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Programming Logic Gate Functions in PLCs
Digital Circuits.
Lecture 2 Dr Richard Reilly Dept. of Electronic & Electrical Engineering Room 153, Engineering Building To insert your company logo on this slide From.
How to build a digital gate. CMOS NAND Gate Several realization of NOT 1. This is how a NOT operation is often represented schematically. 2. Sometimes.
1 Boolean Algebra & Logic Design. 2 Developed by George Boole in the 1850s Mathematical theory of logic. Shannon was the first to use Boolean Algebra.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Propositional Calculus Math Foundations of Computer Science.
Boolean Algebra and Logic Simplification
3. DIGITAL ELECTRONICS..
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Boolean Algebra – the ‘Lingua Franca’ of the Digital World The goal of developing an automata is based on the following (loosely described) ‘ideal’: if.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Lecture 2 – Boolean Algebra Lecturer: Amy Ching Date: 21 st Oct 2002.
Digital Logic Chapter 4 Presented by Prof Tim Johnson
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Combinational Circuit Design A combinational circuit consists of logic gates. It processes the input signals (coming from an external source) to produce.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Chapter 3 Special Section Focus on Karnaugh Maps.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Logic Gates, Boolean Algebra and Karnaugh Maps. Challenge! By the end of todays session can you complete the following?
Boolean 3.1 Boolean Logic 3 ©Paul Godin Created September 2007 Last edit Sept 2009.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Chapter 1 Propositional Logic
Boolean Algebra & Logic Gates
Basics of Logic gates - Part 1
Logic Gates and Boolean Algebra
Computer Science 210 Computer Organization
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Propositional Calculus: Boolean Functions and Expressions
Lesson Objectives Aims Be able to define problems using Boolean logic
Logic Gates, Boolean Algebra and Karnaugh Maps
Dr. Clincy Professor of CS
Component 1 – 2A, B, C Binary Logic
Mathematics for Computing
Fundamentals & Ethics of Information Systems IS 201
XOR, XNOR, and Binary Adders
Propositional Calculus: Boolean Functions and Expressions
Propositional Calculus: Boolean Algebra and Simplification
Agenda – 2/12/18 Questions? Readings: CSI 4, P
Basic Logic Gates 1.
Dr. Clincy Professor of CS
BASIC & COMBINATIONAL LOGIC CIRCUIT
Instructor: Alexander Stoytchev
XOR, XNOR, & Binary Adders
Karnaugh Maps Topics covered in this presentation: Karnaugh Maps
Fundamentals of Computer Systems
Computers in the real world Objectives
Dr. Clincy Professor of CS
Boolean Logic Boolean Logic is considered to be the basic of digital electronics. We know that a computer’s most basic operation is based on digital electronics.
Dr. Clincy Professor of CS
GCSE Computer Science – Logic Gates & Boolean Expressions
CS Chapter 3 (3A and ) – Part 3 of 5
Dr. Clincy Professor of CS
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Overview Part 2 – Circuit Optimization
Chapter 3 Special Section
Objectives Construct truth tables for the following logic gates:
XOR, XNOR, and Binary Adders
Programming Techniques :: Logic & Truth Tables
Presentation transcript:

A-level Computer Science 1.4.3 – Boolean Algebra A-level Computer Science

Specification Overview Specification Points 1.4.3 Boolean Algebra (a) Define problems using Boolean logic. See appendix 5e. (b) Manipulate Boolean expressions, including the use of Karnaugh maps to simplify Boolean expressions. (c) Use logic gate diagrams and truth tables.

Introduction to Boolean Algebra Computers are binary devices, choosing to use 1 and 0 to represent all data. Boolean algebra is about looking at statements that, when evaluated, will result in true or false. Propositional logic, which is where a statement or proposition is defined in terms of true and false, follows mathematical rules that allow manipulation of the propositions. This, in turn, allows logical statements to be simplified or derived. In 1.4.3, you will learn about propositional logic and some of the tools that can define real-world problems as propositional statements. You will also learn some of the key tools that can be used to derive and simplify these logical statements.

Propositional Logic Let P be ‘it is snowing’ Let Q be ‘I have a warm coat’ Let T be ‘I will get cold’ Logical propositions such as ‘it is snowing’ can have either a true or a false value. Statements such as ‘what is the weather?’, which can produce multiple answers, cannot be considered to be logical propositions. A proposition is an atomic value or place holder and is represented algebraically by assigning letters to each proposition. In the statements above, we use P to represent the proposition that it is snowing. We have also used Q and T to represent two different propositions. 

Propositional Logic Most of the rules used to simplify logic do not rely on the meaning of the propositions, but rather focus on how a logical statement is structured. It is useful, when defining problems, to give meaning to our propositions to give them more context. It is also possible to allow our propositions to have more of a programming focus by assigning them conditional expressions. For example, we could write ‘Let P be N < 5’ or ‘Let Q be N ≥ J’. These would be acceptable logical propositions as each one can evaluate to true or false only.

Propositional Logic Symbol Alternatives Formal term Informal term ∧ Conjunction AND ∨ + Disjunction OR ¬ ~A Ā Negation NOT → Implication IF ↔ ≡ Biconditional equivalence Equality ⊕ Exclusive or XOR Propositional logic makes use of a number of symbols to represent logical connectives. A summary of these connectives can be seen in the table below. A propositional statement will therefore be a combination of propositions connected by logical connectives. To aid understanding, colloquial terms have been given to each symbol as well as their formal names. It is important that you use formal names when discussing propositional logic; their colloquial versions are only included to help your learning.

Propositional Logic ∧ Conjunction AND ∨ + Disjunction OR → Implication IF ↔ ≡ Biconditional equivalence Equality https://www.youtube.com/watch?v=C3ZMvbQ59VQ&list=PLCiOXwirraUDCK07-o9dJTWMkLmFco1PA&index=4

Conjunction Consider the conjoined proposition: ‘it is raining outside and I have an umbrella’. The keyword in this statement is the word ‘and’. For this statement to be true, both of the propositions represented by P and Q must be true. If one is false, the whole statement becomes false. Conjunction can be represented in the simple truth table below: P Q P AND Q T F

Conjunction When we join two propositions together using conjunction, it is represented by the symbol ∧. If P represents ‘it is raining’ and Q represents ‘I have an umbrella’, we can represent the conjunction of these two propositions as the statement P ∧ Q. Below shows a diagrammatic representation of an AND gate:

Disjunction Sometimes we want to see if one thing or another is true or not. The truth table of two propositions connected using disjunction is shown below: P Q P OR Q T F

Disjunction Disjunction is represented by the ∨ symbol. To represent the disjunction of two propositions, we would simply write P ∨ Q. Below shows a diagrammatic representation of an OR gate:

Negation When the negation of a proposition is needed, for example ‘it is not snow’, we can make use of the negation ¬ operator, colloquially known as NOT. Negation is a unary operator (an operator with a single operand) and will apply to the proposition immediately following it. So if P represents ‘it is snowing’, we can represent the negative by ¬ P (i.e. ‘it is not snowing’). Graphically represented using a NOT gate. P NOT P T F

Exclusive Disjunction Exclusive or (XOR) ensures that if both inputs are 1 then the output will be 0. This is different to normal OR which would output a 1. X Y X⊕Y 1

Task – Exam Q Explain, using the correct symbols and diagrams, what the following terms mean. (a) Conjunction [2] (b) Disjunction [2] (c) Implication [2] (d) Negation [2]

Video https://www.youtube.com/watch?v=cdYCLJeGUpE&list=PLCiOXwirraUDCK07-o9dJTWMkLmFco1PA

Task – Exam Q

Task – Exam Q

Task – Exam Q Carrot Stick Fruit AND Salad Toy Grilled Burger OR Salad   Salad AND Equivalence

Task – Exam Q

Task – Exam Q g and (s or c) and f t = true

Task The missile will be activated (M) when the key is turned (K) and the button is pressed (B) I will go to the party (P) if Sam is going (S), but not Alex (A) as I don’t get on with him anymore When the new iPhone comes out it will have a secret key combination to take selfies (S). You have to press the main button (M), the on button (O) and the volume button (V) I will only go outside (O) if it is sunny (S), I have an umbrella (U) or I have to put out the trash (T)

Task  

Task The burglar alarm will only be activated (B) when the door sensor (D) or the window sensor (W) is activated, but ONLY if the alarm system is turned on (A) When applying to college (C) you have to choose Physics (P) and Geography (G) or History (H) When feeding the dog (D) you must not feed it with chocolate (C) or sharp objects (S) The heating system will activate (H) when the thermostat setting has not been reached (T)

Task  

Karnaugh Maps When you need to determine a simplified Boolean equation or logic system from a given set of variables you can use a method called Karnaugh mapping to make the process easier. This method can be employed to either an existing Boolean equation or a descriptive outline of a required system. Karnaugh Maps are a modified from of truth table optimised to enable pattern recognition to be used when identifying minimal logical expression. Karnaugh Maps illustrate a table of possible input and mapped against the required output

Karnaugh Maps Golden Rules No zeros are allowed No diagonal joining of blocks Groups should be as large as possible Every one must be within a block – no loners Groups must be formed in 2n (1,2,4,8,etc) Overlapping is allowed Wrap arounds are allowed

Video Intro https://www.youtube.com/watch?v=T6syswJuFsU&index=2&list=PLCiOXwirraUDCK07-o9dJTWMkLmFco1PA https://www.youtube.com/watch?v=6h8YmU5yybE&list=PLCiOXwirraUDCK0 7-o9dJTWMkLmFco1PA&index=3

Example   1 A B

Example   1 A B Answer: A

Questions Q – Using a Karnaugh Map, simplify the following expressions: A∧B∧C∨A∧¬B∧C∨A∧B∧¬C ¬A∧¬B∧¬C∨¬A∧B∨A∧B∧¬C∨A ∧C ¬A∧B∧C∧D∨¬A∧B∧C∧¬D∨A∧B ∧C∧D∨A∧B∧C∧¬D

Answers 1. A∧B∧C∨A∧¬B∧C∨A∧B∧¬C (A∧B) ∨ (A∧C) 00 01 11 10 1 A B C

00 01 11 10 1 (A∧C)v(¬A ∧ ¬C) v B Answers A B C 1 A B 2. ¬A∧¬B∧¬C∨¬A∧B∨A∧B∧¬C∨A ∧C (A∧C)v(¬A ∧ ¬C) v B C

Answers 00 01 11 10 1 A B C D 3. ¬A∧B∧C∧D∨¬A∧B∧C∧¬D∨A∧B ∧C∧D∨A∧B∧C∧¬D B ∧ C

Exam Tip! It does not matter which two values you join together when writing out the Karnaugh map. However, it is important to remember that if you have two or more bits in a single row or column, you should only change adjacent columns/rows by a single bit.