Vous êtes sur la page 1sur 24

Computer Science

1.3.3 Logic
gates and
logic
circuits

Prepared by: Ramesh Basnet


AS-C
Learning Outcomes
What is a logic gate?

➢ A logic gate is an elementary building block


of a digital circuit.

➢ It has an operation matching that of Boolean


operator.
Some Useful Terms
Logic Proposition: a statement that is either TRUE
or FALSE
Problem Statement: an informal definition of an
outcome which is dependent on one logic
proposition or a combination of logic propositions
Logic expression: logic propositions combined
using Boolean operators, which may be written
with defined outcome
Truth Table : a table listing all the
combination of inputs and their respective outputs
Mathematical symbols for Logic gate

● NOT ----------------------------------------A or A’
● OR------------------------------------------A+B
● AND--------------------------------------- A•B
● NOR----------------------------------------A+B
● NAND--------------------------------------A•B
● XOR---------------------------------------------- or
A NOT gate will always give an output opposite to what the
input is e.g. 1 (not gate) 0. A NOT gate takes one boolean
input and flips it. It is possible to have a double NOT. This
will reverse the original NOT. The symbol would have an
extra bar over it.
Truth Table for NOT logic
gate
The AND output gate is at logic 1 when and
only when all inputs are at logic 1, otherwise
the output is at logic 0.
Truth Table for AND gate
The OR Logic Gate provides an output of
TRUE if either of the given inputs are
TRUE, and provides FALSE only if all of
the given inputs are FALSE.
Truth Table for OR
Logic Gate
NAND logic gate gives an output of
FALSE when both inputs are of
TRUE. It is just reverse of AND logic
gate.
Truth TAble for NAND Logic
Gate
NOR Logic Gate gives the output of true if and
only if all operands have a value of zero and
otherwise has a output of zero.
Truth Table for NOR Logic
Gate
The XOR gate (sometimes EOR gate, or EXOR
gate and pronounced as Exclusive OR gate) is a
digital logic gate that gives a true (1 or HIGH)
output when the number of true inputs is odd.
An XOR gate implements an exclusive or; that is,
a true output results if one, and only one, of the
inputs to the gate is true.
Truth Table for XOR Logic
Gate
Constructing a logic circuit from a logic statement
or logic expression
If you are given a problem statement, you should convert it into a
logic expression and then identify the individual Boolean
operations the logic expression.
Example:
Problem Statement: A bank offers a special lending rate to
customers subject to certain conditions. To qualify, a customer
should satisfy certain criteria:
1. The customer has been with the bank for two years.
2. Two of the following conditions must also apply:
~the customer is married
~the customer is aged 25 years or older
~the customer’s parents are customers of the bank
Converting into logic expression by representing
the conditions using symbols
- Let A represent an account held for two years
- Let B represent that the customer is married
- Let C represent that the customer’s age is 25 years or more
- Let D represent that the customer’s parents have an
account

The logic expression can be written as:


A AND (((B AND C) OR (B AND D) OR (C AND D))
Presenting it with outcome:
Special_rate If A AND (((B AND C) OR (B AND D) OR (C AND D))
Logic Circuit constructed from Problem Statement
Constructing a truth table using logic circuit
All possible combinations of input values should be presented in
increasing binary value.
Intermediate points should be identified in the circuit and the
values of each of them can be included in the columns headed
Workspace.
Workspace can be removed from the final truth table.
Truth Table

Vous aimerez peut-être aussi