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. Microchips (processors) do exactly whatever instructions are fed into it, and that too without a single mistake. Boolean Logic was first introduced by George Boole. The basic Boolean operation can be further mapped into operations using bits and bytes. The most basic idea of Boolean Logic can be explained using logic gates. When the logic required becomes complex, these logic gates can be combined into more complex forms to get the required output.
Boolean Algebra Boolean algebra is a mathematical system for the manipulation of variables that can have one of two values. In formal logic, these values are “true” and “false.” In digital systems, these values are “on” and “off,” 1 and 0, or “high” and “low.” Boolean expressions are created by performing operations on Boolean variables. Common Boolean operators include AND, OR, and NOT.
Truth Values Some statements can be seen to be either true or false For example… you are in a Computer Science lesson this slide has a White background it is Friday Other statements are a matter of opinion, e.g. it’s warm today that’s a nice hat you’re wearing TRUE FALSE
What About Computers? true = on = 1 false = off = 0 Computers don’t understand the idea of truth, but they can detect whether a circuit or switch is on or off. Circuits being on and off can also represent 1 and 0 as we learnt in the binary lesson. When designing logic circuits for computers: true = on = 1 false = off = 0 False and true are also often represented by zero and non-zero numbers when programming.
Boolean Algebra/truth tables
AND Gate The AND operator gives a true result if everything is true, e.g. false AND false = false false AND true = false true AND false = false true AND true = true For example… it is evening AND it is Monday this slide is White AND the text is orange it is tuesday AND this is a Computing lesson FALSE TRUE
AND Gate As with all components, when we draw a circuit diagram, we need to use standard symbols so that other people can understand the circuit. The symbol shown on the left is an AND gate. The output Z is high when input A AND input B is high.
AND Gate The AND can be described as the output Z being high when input A AND input B are high. However we can also use truth tables to show what the output Z is doing for each combination of the inputs A and B. The truth table on the left is for an AND gate, in the table you can see the only combination that the output is 1 is when input A and input B are both 1.
NOT Gate The NOT operator toggles the truth value to its opposite value, e.g. NOT true = false NOT false = true For example… you are NOT in a Computing lesson this slide’s background is NOT blue it is NOT Friday FALSE TRUE
NOT gate The NOT gate or inverter only has one input. The output of the gate is always the opposite value to the input. The symbol and truth table for this gate are shown on the left. With all logic a little circle on the end of the gate shows that it is a NOT. The NOT operation is most often designated by an overbar. It is sometimes indicated by a prime mark ( ‘ ) or an “elbow” ().
NAND gate The NAND gate is a NOT AND gate, which is shortened to NAND. The output is on for all conditions, except when A and B are high. Hence it is the inverse of the AND gate.
NAND Gate NOT-AND X Y Z X Y W Z 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 W
OR gate The OR operator gives a true result if any of the input values is true, e.g. false OR false = false false OR true = true true OR false = true true OR true = true For example… it is Saturday OR Sunday it is a weekday OR a weekend it is tuesday OR this is a Computing lesson FALSE TRUE
OR gate The output of an OR gate is 1 if either input is 1.
NOR gate The NOR gate is a NOT OR. So as with the NAND, we take the normal gate and NOT the output. Hence with the NOR gate the output is 0 when either input is 1.
NOR Gate NOT-OR X Y X Y W Z 0 0 0 1 0 1 1 0 1 0 1 0 1 1 1 0 Z W
XOR gate The XOR gate or exclusive OR, is similar to the OR gate however the output is a 1 when only 1 of the inputs is a 1.
Summary
Summary
Logic gate questions (Activity/homework) Complete the truth tables to show the truth tables for the different Logic Gates
Exam Questions
Truth tables and gates
Truth tables and gates (Activity/Homework) Complete the Truth tables and gates activity showing the output from the truth table.
Writing Boolean Algebra
Writing Boolean Algebra Suppose we need to implement some logic where the output is on if the inputs (A and B) or C are on. We can use an AND gate as well as an OR gate and connect them together, as shown below:
Writing Boolean Algebra For the circuit below we could write Z = (A AND B) OR C If we had a complicated expression that we wanted to write that used lots of gates then writing it out could take up lots of space and use lots of brackets and could get quite confusing. Boolean algebra allows logic to be written in a simple way, where: AND = . (or nothing in-between) OR = + NOT = 𝐴 a line over the letter which is being inverted
Summary
Writing Boolean Algebra Z=(A.B)+C
Writing Boolean Algebra P=? Q=? X=?
Writing Boolean Algebra P=A+B Q=B.C X=(A+B)+(B.C)
Writing Boolean Algebra
Writing Boolean Algebra
Writing Boolean Algebra
Writing Boolean Algebra
Exam Questions