Digital Logic & Number Systems
Digital Logic & Number Systems
LESSON ONE
Overview
It is necessary for us to understand what digital logic is all about and what necessitates its study as
a computer course. Digital logic according to Techdictionary is the underlying logic system that
drives electronic circuit board design. Basically it is the manipulation of binary values through
printed circuit board technology that uses circuit and logic gates to construct the implementation
of computer operations. As a prerequisite for this course we have to review Numbers and symbols,
number system and conversions from one base to another.
Numbers and Symbols
We often take for granted the expression of numerical quantities is something we tend to take for
granted. The good aspect of this in study of electronics is that we are used to the use and
manipulation of numbers for many calculations used in analyzing electronic circuit, but in the other
hand, the system of notation we are accustomed to, is not the system used in the modern electronic
computing devices.
Differentiating Numbers from Symbols
Number
A number is a mathematical quantity, usually associated to a physical quantity such as voltage,
current, or resistance in electronics
Example of numbers
Whole numbers (numbers use for counting)
1, 2, 3, 4, …9
Integer (necessary when the negative part of the whole number is need)
-9, -8, -7, -6, … 0 1, 2, 3, 4, …9
Irrational numbers (numbers are numbers that cannot be exactly expressed as the ratio of two
integers)
π (approx. 3.1415927), e (approx. 2.718281828), square root of any prime
Real numbers: (All one-dimensional numerical values, negative and positive, including zero,
whole, integer, and irrational numbers). The non-integer quantities of voltage, current, and
resistance in DC circuits can be expressed as real numbers, in either fractional or decimal form.
For AC circuit analysis, however, real numbers fail to capture the dual essence of magnitude and
phase angle, and so complex numbers can be used in either rectangular or polar form.
Complex numbers (numbers expressed in form of a+ib, where a,b are real numbers and i is an
imaginary number called iota, 𝑖 = √1
1
Examples of complex number: , 1 + 𝑖, 23 + 2𝑖, −3 + 𝜋𝑖
Symbols
For us to use numbers to understand physical processes in our world, make scientific predictions,
or balance our checkbooks, they must be denoted symbolically. In other words, we may know
how much money we have in our account, but for record keeping, we need a working system that
can quantify it with symbol. Two basic ways of quantifying numbers are analog and digital.
Analog Representation
With analog representation, the quantity is symbolized in a way that is infinitely divisible. Number
can be represented using analog as is shown in the diagram where money collected is shown by
calibrations on a thermometer.
2
Analog Device
Figure3: Abacus.
Numerical quantities in abacus are represented by discrete positions of beads.
It seems that problem of exactness in analog numeration make people to generally settle upon
digital symbols for representing numbers, especially whole numbers and integers, which find the
most application in everyday life. Using the fingers on our hands, we have a ready means of
symbolizing integers from 0 to 10. We can make hash marks on paper, wood, or stone to represent
the same quantities quite easily:
5 + 5 + 3 = 13 can be represented thus: as the number increases, it
becomes difficult to be represented using hash marks.
Numbering System
The Romans numeral was a substantial improvement over hash marks, because it
used a variety of symbols (or ciphers) to represent increasingly large quantities. The capital letter
I represents 1 and V represents 5. Other ciphers possess increasing values:
X = 10
L = 50
C = 100
D = 500
M = 1000
If a cipher is accompanied by another cipher of equal or lesser value to the immediate right of it,
with no ciphers greater than that other cipher to the right of that other cipher, that other cipher’s
3
value is added to the total quantity. Thus, VII symbolizes the number 7, and CLVII symbolizes
the number 157. On the other hand, if a cipher is accompanied by another cipher of lesser value to
the immediate left, that other cipher’s value is subtracted from the first. Therefore, IX symbolizes
the number 9 (X=10 minus I=1), and CM symbolizes the number 900 (M=1000 minus C=100).
Disadvantages
• Difficulty in representing large numbers
• Confusion in addition vs subtraction of values based on right vs left placemnt.
• No provision for zero and negative number representation
The most important ideas in counting was credited to the ancient Babylonians, who
were the first to develop the concept of cipher position, or place value, in representing larger
numbers. Instead of inventing new ciphers to represent larger numbers, as the Romans did, they
re-used the same ciphers, placing them in different positions from right to left. The decimal number
system uses this concept, with only ten ciphers (0,1, 2, 3, 4, 5, 6, 7, 8, and 9) used in ”weighted”
positions to represent very large and very small numbers.
Each cipher represents an integer quantity, and each place from right to left in the notation
represents a multiplying constant, or weight, for each integer quantity. For example, the decimal
notation ”5206”, can be broken down into its constituent weight-products as such:
5206 = 5000 + 200 + 6
5206 = (5 x 1000) + (2 x 100) + (0 x 10) + (6 x 1)
Each cipher is called a digit in the decimal number system, and each weight, or place value, is ten
times that of the one to the immediate right. So, we have a ones place, a tens place, a hundreds
place, a thousands place, and so on, working from right to left.
The reason for the review of the numbering system we are already used to is to help us understand
binary number system which is the foundation for this course.
4
In as much as the decimal system is easy for counting, the binary number system is used in modern
electronic computers because of the ease of representing two cipher states (0 and 1) electronically.
With relatively simple circuitry, we can perform mathematical operations on binary numbers by
representing each bit of the numbers by a circuit which is either on (current) or off (no current).
Just like the abacus with each rod representing another decimal digit, we simply add more circuits
to give us more bits to symbolize larger numbers. Binary numbers are also good for storage and
retrieval of numerical information: on magnetic tape (spots of iron oxide on the tape either being
magnetized for a binary ”1” or demagnetized for a binary ”0”), optical disks (a laserburned pit in
the aluminum foil representing a binary ”1” and an unburned spot representing a binary ”0”), or a
variety of other media types.
Before we go on to learning exactly how all this is done in digital circuitry, we need to become
more familiar with binary and other associated numbering systems.
It is obvious from Table 1 that neither Hash mask nor Roman numeration is efficient for
representing large numbers rather place weighted numeration like decimal or binary is better. We
also notice that decimal notation is much more shorter than its binary equivalent as is seen from
two to ten. Now question rises, how large quantity can be represented by few symbols/cipher
positions? The crude hash mark uses the largest numbers of places since each integer or count must
be represented by a mark. But for decimal and binary system, the place-weight comes to play. This
is done using the numbering system base, (10 for decimal and 2 for binary )and raising it to the
110112
10000 = 1 *24
1000 = 1 *23
000 = 0 * 22
10 = 1 * 21
1= 1 * 20
5
power of its position moving from right to left. For instance, In 45678 the digits has the following
place values or weight in decimal and binary numerations.
40000 = 4*104
5000 = 5 * 103
600 = 6 * 102
70 = 7 *101
With each additional place position to the number field, the capacity for representing numbers
increases by a factor of the base (10 for decimal, 2 for binary).
The designers of the first electronic digital computers, Eniac chose to represent numbers in decimal
form, digitally, using a series of circuits called ”ring counters” instead of the binary number system
in effort minimize the number of circuits required to represent and calculate very large numbers.
This approach failed, so virtually all digital computers since then have been purely binary in
design.
To convert a number in binary to its equivalent in decimal form, all you have to do is calculate the
sum of all the products of bits with their respective place-weight constants.
Let us convert 110112 to its decimal form.
bits = 1 1 0 1 1
weights = 16 8 0 2 1
In dec. = 16 + 8 + 0 + 2 + 1
= 27
The bit on the far right side is called the Least Significant Bit (LSB), because it stands in the place
of the lowest weight (the one’s place). The bit on the far left side is called the Most Significant Bit
(MSB), because it stands in the place of the highest weight. Remember, a bit value of ”1” means
that the respective place weight gets added to the total value, and a bit value of ”0” means that the
respective place weight is not added to the total value. With
If we encounter a binary number with a dot (.), called a ”binary point” instead of a decimal point,
we follow the same procedure, realizing that each place weight to the right of the point is one-half
the value of the one to the left of it (just as each place weight to the right of a decimal point is one-
tenth the weight of the one to the left of it). For example:
Convert 101.0112 to decimal form:
.
Bits = 1 0 1 . 0 1 1
weight = 22 21 20 . 2-1 2-2 2-3
410 + 110 + 0.2510 + 0.12510 = 5.37510
Remember, 0 bits are not added,
6
Other systems of place-weighted number system to and from which binary can easily be converted
have been made to lessen the tedious task associated with programming digital circuitry using long
strings of 1s and 0s which is “native language” of any digital circuit.
One of those number systems is called octal, because it is a place-weighted system with
a base of eight. Valid ciphers include the symbols 0, 1, 2, 3, 4, 5, 6, and 7. Each place weight
differs from the one next to it by a factor of eight.
Another system is called hexadecimal, because it is a place-weighted system with a base of
sixteen. Valid ciphers include the normal decimal symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, plus
six alphabetical characters A, B, C, D, E, and F, to make a total of sixteen. As you might have
guessed already, each place weight differs from the one before it by a factor of sixteen.
Let’s count again from zero to twenty using decimal, binary, octal, and hexadecimal to
differentiate these systems of numeration:
The Octal and hexadecimal number systems allow easy conversion to and from binary notation.
Their primary purpose is to serve as a ”shorthand” method of denoting a number represented
electronically in binary form. Because the bases of octal (eight) and hexadecimal (sixteen) are even
multiples of binary’s base (two), binary bits can be grouped together and directly converted to or
from their respective octal or hexadecimal digits. With octal, the binary bits are grouped in three’s
(because 23 = 8), and with hexadecimal, the binary bits are grouped in four’s (because 24 = 16):
7
Binary to octal conversion
Convert 10110111.12 to octal:
010 110 111. 100 (group the bits in 3’s)
Convert each group of bits ### ### ### . ###
to its octal equivalent: 2 6 7 4
.Answer: 10110111.12 = 267.48
We had to group the bits in three’s, from the binary point left, and from the binary point
right, adding (implied) zeros as necessary to make complete 3-bit groups. Each octal digit was
translated from the 3-bit binary groups.
Here the bits are grouped in four’s, from the binary point left, and from the binary point right,
adding (implied) zeros as necessary to make complete 4-bit groups:
Likewise, the conversion from either octal or hexadecimal to binary is done by taking each
octal or hexadecimal digit and converting it to its equivalent binary (3 or 4 bit) group, then
putting all the binary bit groups together.
Incidentally, hexadecimal notation is more popular, because binary bit groupings in digital
equipment are commonly multiples of eight (8, 16, 32, 64, and 128 bit), which are also multiples
of 4. Octal, being based on binary bit groups of 3, doesn’t work out evenly with those common
bit group sizing.
The technique for converting hexadecimal notation to decimal is the same, except that each
successive place-weight changes by a factor of sixteen. Simply denote each digit’s weight,
multiply each hexadecimal digit value by its respective weight (in decimal form), then add up
all the decimal values to get a total.
Conversion from decimal to other number system
8
Converting decimal to binary numbers
Step:
• Continuously divide the integral part by 2, and note the remainder
• Collect the remainders from down to top, and present your number in base 2.
For example, convert 8510 to binary
The same applies to other bases, simply divide continuously by base number and collect the
remainders at the end from bottom to up.
9
Therefore 27.056 10 to binary = 11011.000011102
BINARY ARITHMETICS
To understand how operations are carried out in digital circuit using binary numbers, we need to
review the basics of binary arithmetic.
.
Binary addition
Binary numbers addition is similar to addition of decimal numbers. As with decimal numbers, you
start by adding the bits (digits) one column, or place weight, at a time, from right to left. Rules for
the addition of binary bits:
0+0=0
1+0=1
0+1=1
1 + 1 = 10
1 + 1 + 1 = 11
Just as with decimal addition, when the sum in one column is a two-bit (two-digit) number, the
least significant figure is written as part of the total sum and the most significant figure is “carried”
to the next left column. Consider the following examples:
1001101 1001001 1000111
+ 0010010 + 0011001 + 0010110
. --------- --------- ---------
. 1011111 1100010 1011101
As we see later, electronic circuits can be built to perform this very task of addition, by
representing each bit of each binary number as a voltage signal (either ”high,” for a 1; or ”low”
for a 0). This is the very foundation of all the arithmetic which modern digital computers perform.
10
negative counterparts and we’ll be able to subtract.
Since binary notation is for constructing on/off circuits that represent bit values in terms of of
voltage ( only two value state, “high” or “low” there is no space for third value (ie. “+” or “–“)
sign. The only way to represent negative or positive values is reserving a bit(circuit) that does
nothing but “Usually we represent a negative decimal number by placing a minus sign directly to
the left
of the most significant digit, just as in the example above, with -5. However, the whole purpose
of using binary notation is for constructing on/off circuits that can represent bit values in
terms of voltage (2 alternative values: either ”high” or ”low”). In this context, we don’t have
the luxury of a third symbol such as a ”minus” sign, since these circuits can only be on or off
(two possible states). One solution is to reserve a bit (circuit) that does nothing but represent
the mathematical sign:
1012 = 510 (positive)
Extra bit, representing sign (0=positive, 1=negative)
01012 = 510 (positive). |
11012 = -510 (negative)
This number 11012 could be misinterpreted as thirteen while it is representing sign, so to check
this, the bit field length must be considered, that extra bit now becomes the sign magnitude. The
leftmost bit is read as the sign bit.
We can also represent positive and negative number using complement. In complement, one part
completes the other. The detail we should study in another course, Fundamentals of Data structure.
11
The second stage is to find the two’s complement of the number by adding 1 to least significant
bit (LSB). Remember we are using four bits, the fifth bit is sign bit. After summation, the extra bit
which is the 6th bit is discarded.
.
Overflow
Overflow is one caveat with signed binary numbers. This is where sum or difference of two binary
numbers exceeds the magnitude which can be represented with the alloted number
of bits. Considering our previous example where we used four bits number, the fifth bit is the sign
bit which has fixed position. With four bits to represent magnitude, it means that we can represent
24 or sixteen integer steps from 0 to maximum, that is we can represent a number as high as
+15(011112) and as low as -16 (100002). When we have a number beyond +15 or lower than -16,
the problem of overflow comes, our answer cannot be correct using the magnitude.
Let’s try adding 1410 and 1310 to see how this overflow condition works for excessive
positive numbers:
1410 = 11102; 1310 = 11012
(Showing sign bits) 01110
. + 01101
. --------
. 11011
The answer (11011), interpreted with the fifth bit as the -1610 place, is actually equal
to -510, not +2710 as we should get with +1410 and +1310 added together! Obviously, this is
not correct. This is because of the restrictions of the five-bit number field within which we’re
working Since the magnitude of the true and proper sum (2710) exceeds the allowable limit for our
designated bit field, we have an overflow error. Simply put, five places doesn’t give enough bits
to represent the correct sum, so whatever figure we obtain using the strategy of discarding the left-
most ”carry” bit will be incorrect.
A similar error will occur if we add two negative numbers together to produce a sum that
is too low for our five-bit binary field. To arrive at the correct number, we need to use bit fields
large enough to handle the magnitude of the sum.
To check overflow in electronic circuits, we need not double-check the numbers by adding their
decimal forms as we did in the examples, the circuit should be able to check itself for overflow
without the supervision of a human being who already knows what the correct answer is.
What we need is a simple error-detection method that doesn’t require any additional arithmetic.
The checking for the sign of the sum and compare it against the signs of the numbers added.
Obviously, two positive numbers added together should give a positive result, and two negative
numbers added together should give a negative result. Recall that whenever we had a condition of
overflow in the example problems, the sign of the sum was always opposite of the two added
numbers. So checking the signs alone can detect the conditions of overflow. This technique of
overflow detection is easily implemented in electronic circuitry, and it is a standard feature in
digital adder circuits. Note that the addition of two opposite numbers cannot produce overflow, it
occurs with identical signed numbers. The sum of two identically-signed numbers may very well
exceed the range of the bit field of those two numbers, and so makes overflow a possibility.
Bit groupings
The singular reason for learning and using the binary numeration system in electronics is to
understand how to design, build, and troubleshoot circuits that represent and process numerical
quantities in digital form. Since the bivalent (two-valued) system of binary bit numeration
12
lends itself so easily to representation by ”on” and ”off ” transistor states (saturation and cutoff,
respectively), it makes sense to design and build circuits using this principle to perform
binary calculations.
If we were to build a circuit to represent a binary number, we would have to allocate enough
transistor circuits to represent as many bits as we desire. So, in designing a digital circuit, we must
first decide the maximum bits that can be represented, since each bit requires one on/off circuit to
represent it. This is analogous to designing an
abacus to digitally represent decimal numbers: we must decide how many digits we wish to
handle in this primitive ”calculator” device, for each digit requires a separate rod with its own
beads.
A 10-rod abacus
Each rod represents a single decimal digit. A ten-rod abacus would be able to represent a ten-digit
decimal number, or a maximum value of 9,999,999,999. A larger number cannot be represented
on abacus unless additional rods could be added it.
In digital, electronic computer design, it is common to design the system for a common ”bit
width:” a maximum number of bits allocated to represent numerical quantities. Early digital
computers handled bits in groups of four or eight. More modern systems handle numbers in
clusters of 32 bits or more. To more conveniently express the ”bit width” of such clusters in a
digital computer, specific labels were applied to the more common groupings.
Common grouping
Four bits------------ a nibble (four bits grouped together as one binary quantity)
Eight bits ---------- A byte (character, eight bits grouped together as one binary quantity)
2 Bytes ------------Word (standard bits grouping within a particular digital system
DIGITAL LOGIC
The dramatical changing of the society by digital circuits and its technologies has made digital
logic a pervasive vocabulary. It is incorporated in most areas of life such as computers,
automobiles, robots , medical sciences, technology, transportation, telecommunication and so on.
We have already studied the numerical representation which is one of the underlying concepts in
digital technology which deals with how quantities in every area of life is measured, monitored,
recorded or manipulated mathematically. This representation as we have discussed is done in two
ways; Analog and Digital.
Analog quantities are represented by voltage, current or meter movement as we can see in
automobile speedometer, Mercury thermometer and audio microphone.
One general characteristics of analog values is that they vary over a continuous range of values.
For example, the speedometer value can vary from 0km/hr to 180km/hr.
Digital values in the other hand is represented by symbols called digits. For example digital
clock/watch presents time in form of decimal digits representing hrs. mins. and secs.
13
Do not have exact values hence more difficult Has exact values, easier to read
to read
2. Information storage is easy. Billions of bits of information can be stored in a relatively small
physical space while analog storage capabilities are, by contrast, extremely limited.
3. Accuracy and precision are easier to maintain throughout the system. Once a signal is
digitized, the information it contains remains stable as it is processed. In analog systems, the
voltage and current signals tend to be distorted by the effects of temperature, humidity, and
component tolerance variations in the circuits that process the signal.
4. Operation can be programmed. It is fairly easy to design digital systems whose operation is
controlled by a set of stored instructions called a program. Analog systems can also be
programmed, but the variety and the complexity of the available operations are severely limited.
5. Digital circuits are less affected by noise. Spurious fluctuations in voltage (noise) are not as
critical in digital systems because the exact value of a voltage is not important, as long as the noise
is not large enough to prevent us from distinguishing a HIGH from a LOW.
6. More digital circuitry can be fabricated on IC chips. It is true that analog circuitry has also
benefited from the tremendous development of IC technology, but its relative complexity and its
use of devices that cannot be economically integrated (high-value capacitors, precision resistors,
inductors, transformers) have prevented analog systems from achieving the same high degree of
integration.
14
LOGIC CIRCUIT
In logic, only two possible conditions exist for any input or output: true and false. The binary
number system uses only two digits, 1 and 0, so it is perfect for representing logical relationships.
Digital logic circuits use predefined voltage ranges to represent these binary states. Using these
concepts, we can create circuits that make consistent, intelligent, logical decisions.
BOOLEAN ALGEBRA
Boolean algebra is simple mathematical tool that can be used to describe a relationship between
logic circuit output and its input as an algebraic equation. It is used not only for simplifying and
analyzing logic systems but to create logic circuit that will produce desired input/output
relationship. The process is known as Synthesis of Logic Circuit.
Unlike ordinary algebra, Boolean algebra is allowed to have only two possible values of 0 or 1. It
is often used to represent the voltage level present on a wire or input/output terminals of a circuit.
For instance, Boolean value of 0 can be assigned to any voltage in the range of 0 to 0.8 volt while
1 may be assigned to voltage range of 2-5volts. The values between 0.8 and 2.0 are undefined and
cannot appear at any normal circumstance. The Boolean values 0 and 1 does not represent actual
number, but states of voltage variables called logic level. Logic 0 can represent False, off, Low,
No, Open switch while Logic 1 represents True, On, High, yes, close switch.
Boolean algebra has only three basic operations: AND, OR and NOT.
The two values state of Boolean algebra makes it relatively easy to work with compared with
ordinary algebra. In Boolean algebra, there are no fractions, decimals, negative numbers, square
roots, cube roots, logarithms, imaginary numbers, and so on. There are only three basic operations:
OR, AND, and NOT in Boolean algebra. These are also known as logic operations.
LOGIC GATE
15
This section is concerned with practical application of the concept of binary bits in circuits. Binary
numeration is so important to the application of digital electronics because of easy representation
of bits in physical terms due to its two state values of either 0 or 1. Any physical medium that can
switch between two saturated states may be used to represent a bit. Any physical system that can
represent binary bits can represent numerical quantities, and potentially has the ability to
manipulate those numbers. This is the basic concept underlying digital computing. Digital circuits
are called logic gates and can be constructed from diodes, transistors and resistors connected such
that output is a result of basic operations on inputs.
NOT Operations
NOT operations because are 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:
where the overbar represents the NOT operation. This expression is read as “x equals NOT A” or
“x equals the inverse of A” or “x equals the complement of A.” Each of these is in common usage,
and all indicate that the logic value of is opposite to the logic value of A. The truth table in Figure
6 clarifies this for the two cases A = 0 and A = 1. That is,
because 1 is not 0
both symbols recognize inversion operation
16
Inverter, or NOT gate
The triangular shape of the gate symbol, is symbol of operational amplifier, while the small circle
or bubble on either side of input or output terminal represents inversion function. Without the
bubble or small circle, the symbol represents direct amplification and the gate will then be referred
to as a buffer.
Gate circuits as amplifiers require a source of power to operate. With minimized lines of
connections, gate circuit can be shown as below:
Vcc stands for Constant voltage
supplied to the collector of a bipolar
junction transistor circuit in reference
to ground.
Those points in a gate circuit marked by the label ”Vcc” are all connected to the same point, and
that point is the positive terminal of a DC voltage source, usually 5 volts.
There are other types of logic gates, most of which have multiple input terminals for accepting
more than one signal. The output of any gate is dependent on the state of its input(s) and its logical
function. The particular function of a gate circuit can be expressed using truth table which shows
all combinations of input conditions in terms of logic level states (either ”high” or ”low,” ”1” or
”0,” for each input terminal of the gate), along with the corresponding output logic level, either
”high” or ”low.”
For the inverter, or NOT, circuit just illustrated, the truth table is very simple as shown in Figure
17
Figure 7: A NOT gate indicating a button is not pressed when its output is true. (Tocci etal. 10th
edition).
The push button is wired to produce a logic 1 (true) when it is pressed. Sometimes we want to
know if the push button is not being pressed, and so this circuit provides an expression that is true
when the button is not pressed, because when not pressed, the input to the inverter is LOW (0)
which gives HIGH output (0)
TRUTH TABLES
A gate’s truth table is a tool for describing how logic circuit’ output depends on the logic level
present at the circuit’s input. It must have as many rows as there are possibilities for each input
combinations. For a single-input gate like the NOT gate, there are only two possibilities, 0 and
1. For a two-input gate, there are four possibilities (00, 01, 10, and 11), and thus four rows to
the corresponding truth table. For a three-input gate, there are eight possibilities (000, 001,
010, 011, 100, 101, 110, and 111), and thus a truth table with eight rows are needed.
Mathematically it can be expressed that the number of truth table rows needed for a gate is
equal to 2 raised to the power of the number of input terminals. If n is number of input terminals
for the gate, the rows = 2n . Truth table numbering follows binary numbering sequence.
Other multiple inputs gate include. OR gate, AND gate, NAND and NOR gate.
Recalls
i. In digital circuits, bit values 0 and 1 are represented by voltage signals measured in
reference to a common circuit point called ground. “0” represents an absence of voltage
and “1” represents the presence of full DC supply voltage.
ii. A logic gate, or simply gate, is a special form of amplifier circuit designed to input and
output logic level voltages (voltages intended to represent binary bits). Gate circuits are
most commonly represented in a schematic by their own unique symbols rather than by
their constituent transistors and resistors.
iii. Just as with operational amplifiers, the power supply connections to gates are often omitted
in schematic diagrams for the sake of simplicity.
iv. A truth table is a standard way of representing the input/output relationships of a gate
circuit, listing all the possible input logic level combinations with their respective output
logic levels.
18
If two inverter gates are connected together such hat the output of one is the input of another, the
two inversion functions would ”cancel” each other out so that there final output will be the same
as initial input:
The practical application of double inversion is in boosting weak signal source. Recall
that gate circuits are signal amplifiers, regardless of what logic function they may perform.
A weak signal source (one that is not capable of sourcing or sinking very much current to a
load) may be boosted by means of two inverters like the pair shown in Figure 8. The logic level is
unchanged, but the full current-sourcing or -sinking capabilities of the final inverter are available
to drive a load resistance if needed.
For this purpose, a special logic gate called a buffer is manufactured to perform the same
function as two inverters. Its symbol is simply a triangle, with no inverting ”bubble” on the
output terminal:
Input Output
0 0
Figure9: Buffer gate 1 1
Multiple-input gates
Inverters and buffers exhaust the possibilities for single-input gate circuits. Single logic can only
be buffered or inverted. With single-input gate like inverter or buffer, there can only be two input
possible states, either high (1) or low (0). To increase the number of input possibilities we must
add more input terminals to a logic gate. This increase in the number of possible input states allows
for more complex gate behavior. Instead of merely inverting or amplifying (buffering) a single
”high” or ”low” logic level, the output of the gate will now be determined by whatever combination
of 1’s and 0’s is present at the input terminals.
There are many different types of multiple input logic gates, as we are going to study in the next
subsequent sections.
The Boolean expression for the OR operation is x = A+B. In this expression, the + sign stands for
the OR operation not for ordinary addition; it. 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 instead of 2 as
in ordinary addition operation. 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
The expression is read as “x equals A OR B,” which means that x will be 1 when A or B or both
are 1. Likewise, the expression is read as “x equals A OR B OR C,” which means that x will be 1
when A or B or C or any combination of them are 1. To describe this circuit in the English
language we could say that x is true (1) WHEN A is true (1) OR B is true (1) OR C is true (1).
OR Gate
In digital circuitry, an OR gate* is a circuit that has two or more inputs and whose output is equal
to the OR combination of the inputs. Figure 8b is the logic symbol for a two-input OR gate. The
inputs A and B are logic voltage levels, and the output x is a logic voltage level whose value is the
result of the OR operation on A and B; that is, In other words, the OR gate operates so that its
output is HIGH (logic 1) if either input A or B or both are at a logic 1 level. Its output will be
LOW (logic 0) only if all its inputs are at logic 0.
This same idea can be used in multiple inputs
20
Figure 11a: OR gate Figure 11b: Truth table
Using the language of Boolean algebra, the output x can be expressed as x= A+B+C, recall that +
represents the OR operation. The output of any OR gate, then, can be expressed as the
OR combination of its various inputs.
21
Figure14: Timing Diagram
Solution
Whenever any input is HIGH the OR gate output will be HIGH. Between time t0 and t1, both inputs
are LOW, so OUTPUT is LOW. At t1, input A goes HIGH while B remains LOW. This causes
OUTPUT to go HIGH at t1 and stay HIGH until t4 because, during this interval, one or both inputs
are HIGH. At t4, input B goes from 1 to 0 so that now both inputs are LOW, and this drives
OUTPUT back to LOW. At t5, A goes HIGH, sending OUTPUT back HIGH, where it stays for
the rest of the shown time span.
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
Figure15a: Two-inputs AND gate Figure 15b: Truth table
and . . .) are ”high” (1). If any input(s) are ”low” (0), the output is guaranteed to be in a ”low” state
as well.
AND gate with three or more inputs is less common than the simple two-input variety.
Truth table for two-inputs AND gate. Truth table for three-inputs AND gate
A B C Output
0 0 0 0
0 0 1 0
0 1 0 0
22
Figure 16a: Three-inputs AND gate 0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
Input A = 0 Input A = 1
Input B = 0 Input B = 0
Output = 0 (No light) Output = 0 (No light)
Figure 17a Figure17b
Assuming that X and Y are inputs in an AND gate, and z is the output. The X and Y inputs can be
0 or 1. AND gate can have multiple inputs but one output, thus the logical formula is given as:
XY = z. (Boolean Language expression)
23
Consider there are two binary inputs, ‘0’ and ‘1’. As the operation is based on binary
multiplication; so, when ‘0’ is multiplied by ‘1’, or ‘1’ is multiplied by ‘0’ the output is ‘0’. The
output is ‘1’ only when ‘1’is multiplied by ‘1’. So we can say that the out is logic level 1 (high)
only if all the inputs are at the logic level 1 (high).
AND gate operation can be seen in login credentials, the authentication can be true only if
username and password are true.
Review Questions
What is the output of state of four input circuit (A,B,C,D) when all the inputs except B are in high
state.
24
Solution
Recall that the output of an AND gate will be HIGH only when all inputs are HIGH at the same
time. For the input waveforms given, this condition is met only during intervals t2-t3 and t6-t7. At
all other times, one or more of the inputs are 0, thereby producing a LOW output. Note that input
level changes that occur while the other input is LOW have no effect on the output.
Exercise
Determine the output waveform for the AND gate shown in this figure.
25