You are on page 1of 21

Boolean Constants and Variables

Boolean Agebra
• Boolean algebra differs in a major way from ordinary
algebra because Boolean constants and variables are
allowed to have only two possible values, 0 or 1.
• A Boolean variable is a quantity that may, at different
times, be equal to either 0 or 1. Boolean variables are
often used to represent the voltage level present on a
wire or at the input/output terminals of a circuit.
• For example, in a certain digital system, the Boolean
value of 0 might be assigned to any voltage in the
range from 0 to 0.8 V, while the Boolean value of 1
might be assigned to any voltage in the range 2 to 5 V.*
Digital Logic Circuits
• Thus, Boolean 0 and 1 do not represent actual
numbers but instead represent the state of a
voltage variable, or what is called its logic level.
• A voltage in a digital circuit is said to be at the
logic 0 level or the logic 1 level, depending on its
actual numerical value. In digital logic, several
other terms are used synonymously with 0 and 1.
• Throughout this course, We will use the 0/1 and
LOW/HIGH designations most of the time.
Digital Logic Circuits
Boolean Algebra
• Boolean algebra is a means for expressing
• the relationship between a logic circuit’s
inputs and outputs. The inputs are considered
logic variables whose logic levels at any time
determine the output levels.
Truth Tables
• A truth table is a means for describing how a
logic circuit’s output depends on the logic
levels present at the circuit’s inputs. Figure 3-
1(a) illustrates a truth table for one type of
two-input logic circuit. The table lists all
possible combinations of logic levels present
at inputs A and B, along with the
corresponding output level x.
Truth Tables
Truth Tables
• Note that there are 4 table entries for the two-input
truth table, 8 entries for a three-input truth table,
and 16 entries for the four-input truth table.
• The number of input combinations will equal 2N for
an N-input truth table.
• Also note that the list of all possible input
combinations follows the binary counting sequence,
and so it is an easy matter to write down all of the
combinations
• without missing any.
Or OperatiOn With Or gates
• An example can be found in the kitchen oven.
The light inside the oven should turn on if
either the oven light switch is on OR if the
door is opened.
• The letter A could be used to represent the
oven light switch is on (true or false) and B
could represent door is opened (true or false).
• The letter x could represent the light is on
(true or false).
Or OperatiOn With Or gates
• Figure 3-2 (a) Truth OR table defining the OR
operation; (b) circuit symbol for a two-input
OR gate.
Or OperatiOn With Or gates
• The Boolean expression for the OR operation is x = A + B
• In this expression, the + sign does not stand for ordinary
addition; it stands for the OR operation. The OR
operation is similar to ordinary addition except for the
case where A and B are both 1; the OR operation produces
1 + 1 = 1, not 1 + 1 = 2.
• In Boolean algebra, 1 is as high as we go, so we can never
have a result greater than 1. The same holds true for
combining three inputs using the OR operation. Here we
have x = A + B + C. If we consider the case where all three
inputs are 1, we have x = 1 + 1 + 1 = 1
Or OperatiOn With Or gates
Summary of the Or Operation

• The important points to remember concerning


the OR operation and OR gates are:
• 1. The OR operation produces a result (output)
of 1 whenever any input is a 1. Otherwise the
output is 0.
• 2. An OR gate is a logic circuit that performs an
OR operation on the circuit’s inputs.
• 3. The expression x = A + B is read as “x equals
A OR B.”
AND OperatiOn With AND gates

• Figure 3-7 (a) Truth table for the AND operation;


• (b) AND gate symbol.
AND OperatiOn With AND gates
Summary of the AND Operation

• 1. The AND operation is performed the same as


ordinary multiplication of
• 1s and 0s.
• 2. An AND gate is a logic circuit that performs the
AND operation on the circuit’s inputs.
• 3. An AND gate output will be 1 only for the case
when all inputs are 1; for all other cases, the output
will be 0.
• 4. The expression x = AB is read as “x equals A AND
B.”
NOT Operation
• The NOT operation is unlike the OR and AND
operations because it can be performed on a
single input variable. For example, if the
variable A is subjected to the NOT operation,
the result x can be expressed as
• x=A
NOT Operation

You might also like