Digital Logic
December 0s and 1s As we have already considered, a computer operates on 0’s and 1’s Why? Because the power on a line can be either off (0) or on (1). We do not consider in-between values! How does a computer carry out calculations on these 0’s and 1’s? It uses logic
December Logic By logic, we mean the process of testing the input on one or more input lines, to produce output on one or more output lines We use the terms AND, OR, NOT, NAND, NOR, and XOR
December AND I will go to the beach, if it is sunny AND it is warm I will not go to the beach if it is sunny, but not warm I will not go to the beach if it is warm, but not sunny I will not go to the beach if it is neither sunny or warm
December AND True False True FalseTrueFalse Go to beachWarmSunny
December AND (Digital logic) Go to beachWarmSunny
December The Truth Table We call this a truth table. It is more usually drawn as follows: ABBA Truth table for AND Note signifies AND
December OR I will go to the beach, if it is sunny OR it is warm I will go to the beach if it is sunny, but not warm I will go to the beach if it is warm, but not sunny (even if it’s raining!) I will not go to the beach if it is neither sunny or warm
December OR True FalseTrue False Go to beachWarmSunny
December OR (Digital logic) Go to beachWarmSunny
December The Truth Table The truth table for OR is as follows: A+BBA Note + signifies OR
December Just like in English! Except, beware: I would like a cup of tea, OR a cup of coffee (but I don’t want both!) This is called the Exclusive OR (XOR) English uses the word OR to signify both the logical OR and the logical XOR ABAB BA
December NOT The simplest of all. It just inverts the input AA We signify NOT by a line over the corresponding letter(s)
December NAND This is simply the opposite of AND ABBA BA
December NOR Similarly, this is the opposite of OR A+BBA BA
December Formal logic (…)(negation) (…) (not) (disjunction) + (or) (conjunction) (and) T (true)1 (true) F (false)0 (false) Formal logicDigital logic
December Logic Gates A logic gate is a device (e.g. on a chip) which takes one or more inputs, performs a logical operation on them (such as AND, OR, etc) and produces an output On a circuit diagram, we have special symbols for these
December Logic Gates ANDNANDNOT ORNORXOR
December Multiple Input Logic Gates All the logic gates on the previous slide, except the NOT gate, may have multiple inputs. What do you think the truth table would be for a three-input AND gate?
December Revision Make sure you know what each gate symbol stands for Know the truth tables for each logic gate Learn the digital logic expressions for each gate