Q2 Logic Gates
Q2 Logic Gates
--------------------------
Digital Logic Gates
A Digital Logic Gate is an electronic circuit which makes logical decisions based on
the combination of digital signals present on its inputs.
A digital logic gate can have more than one input, for example, inputs A, B, C, D
etc., but generally only have one digital output, (Q). Individual logic gates can be
connected or cascaded together to form a logic gate function with any desired
number of inputs, or to form combinational and sequential type circuits, or to
produce different logic gate functions from standard gates.
Integrated Circuits or IC’s as they are more commonly called, can be grouped
together into logic families according to the number of individual transistors or
“gates” that they may contain within their design. For example, a simple AND gate
may contain only a few individual transistors to operate. Whereas a more complex
microprocessor chip can contain billions of individual transistor gates on one single
wafer.
Integrated circuits are categorized according to the number of logic gates or the
complexity of the circuits within a single chip with the general classification for the
number of individual gates given as:
Classification of Integrated Circuits
Small Scale Integration or (SSI) – Contain up to 10 transistors or a few gates
within a single package such as AND, OR, NOT gates.
Medium Scale Integration or (MSI) – between 10 and 100 transistors or tens of
gates within a single package and perform digital operations such as adders,
decoders, counters, flip-flops and multiplexers.
Large Scale Integration or (LSI) – between 100 and 1,000 transistors or
hundreds of gates and perform specific digital operations such as I/O chips,
memory, arithmetic and logic units.
Very-Large Scale Integration or (VLSI) – between 1,000 and 10,000 transistors
or thousands of gates and perform computational operations such as
processors, large memory arrays and programmable logic devices.
Super-Large Scale Integration or (SLSI) – between 10,000 and 100,000
transistors within a single package and perform computational operations such
as microprocessor chips, micro-controllers, basic PICs and calculators.
Ultra-Large Scale Integration or (ULSI) – more than 1 million transistors – the
big boys that are used in computers CPUs, GPUs, video processors, micro-
controllers, FPGAs and complex PICs.
While the “ultra large scale” ULSI classification is less well used, another level of
integration which represents the complexity of the Integrated Circuit is known as
the System-on-Chip or (SOC) for short. Here the individual components such as the
microprocessor, memory, peripherals, I/O logic etc, are all produced on a single
piece of silicon and which represents a whole electronic system within one single
chip, literally putting the word “integrated” into integrated circuit.
These complete integrated chips which can contain up to 100 million individual
silicon-CMOS transistor gates within one single package are generally used in
mobile phones, digital cameras, micro-controllers, PIC’s and robotic type
applications.
Boolean
Boolean Logic Voltage State
Algebra
Most digital logic gates and digital logic systems use “Positive logic”, in which a
logic level “0” or “LOW” is represented by a zero voltage, 0v or ground and a logic
level “1” or “HIGH” is represented by a higher voltage such as +5 volts, with the
switching from one voltage level to the other, from either a logic level “0” to a “1”
or a “1” to a “0” being made as quickly as possible to prevent any faulty operation
of the logic circuit.
1. Basic Logic Gates
AND Gate (7408 IC): Outputs true (1) only if all inputs are true.
OR Gate (7432 IC): Outputs true if at least one input is true.
NOT Gate (7404 IC): Inverts the input; outputs true if the input is false.
NAND Gate: Outputs false only if all inputs are true (NOT AND).
NOR Gate: Outputs true only if all inputs are false (NOT OR).
XOR Gate (7486 IC): Outputs true if an odd number of inputs are true.
XNOR Gate: Outputs true if an even number of inputs are true.
2. Truth Tables
Each logic gate can be represented by a truth table, which lists all possible
input combinations and the corresponding output.
For example, the truth table for an AND gate looks like this:
A AND
AB
B
000
010
100
111
3. Boolean Algebra
Logic gates can be represented using Boolean algebra. Common operations
include:
o A AND B = AB
o A OR B = A + B
o NOT A = A'
Laws of Boolean algebra, such as the commutative, associative, and
distributive laws, can be used to simplify logic expressions.
4. Applications
Logic gates are used in various applications, including:
o Computers: Process binary data.
o Digital Circuits: Design of arithmetic circuits (adders, subtractors).
o Control Systems: Logic for controlling devices.
5. Circuit Diagrams
Logic gates can be represented in circuit diagrams. Understanding how to
read these diagrams is crucial for designing and analyzing circuits.
6. Combinational vs. Sequential Logic
Combinational Logic: Output depends only on the current inputs (e.g.,
simple logic gates).
Sequential Logic: Output depends on current inputs and previous states
(e.g., flip-flops, memory).
Discussion Questions
What real-world devices use logic gates, and how do they function?
How can we create complex circuits using combinations of basic gates?
Can you think of a practical problem that could be solved using logic gates?
1. What real-world devices use logic gates, and how do they function?
Computers: Logic gates are used in CPUs to perform calculations and
process data. They execute basic operations like addition, subtraction, and
logic comparisons.
Smartphones: Inside smartphones, logic gates manage everything from
processing touch inputs to handling complex tasks like running applications
and connecting to the internet.
Digital Watches: Logic gates control the timing and display functions,
allowing for precise timekeeping and features like alarms.
Home Appliances: Devices like microwaves and washing machines use logic
gates in their control systems to manage cycles and user inputs.
Automobiles: Modern cars utilize logic gates in their electronic control units
(ECUs) for functions like engine management, safety systems, and
infotainment controls.
2. How can we create complex circuits using combinations of basic gates?
Cascading Gates: By connecting multiple gates in series or parallel, we can
create complex circuits. For example, an AND gate followed by an OR gate
can create a more complex logic function.
Combinational Logic Circuits: We can design circuits that perform specific
functions, such as adders for arithmetic operations. A full adder can be
constructed using multiple gates to add binary numbers.
Programmable Logic Devices: Devices like FPGAs (Field-Programmable
Gate Arrays) allow us to configure logic gates to perform specific tasks,
enabling highly complex and customizable circuits.
Schematic Diagrams: By using schematic diagrams, engineers can visualize
how gates interconnect, making it easier to design and troubleshoot complex
circuits.
3. Can you think of a practical problem that could be solved using logic
gates?
Traffic Light Control System: Logic gates can be used to design a traffic
light controller that manages the flow of traffic at intersections.
o Example Logic:
Use AND gates to ensure that when cars are detected on a road,
the corresponding traffic light turns green.
Use OR gates to combine inputs from multiple sensors to handle
pedestrian requests.
Implement timing logic using flip-flops (sequential logic) to
manage light changes at fixed intervals.
This system ensures smooth traffic flow while maintaining safety for
pedestrians, demonstrating a practical application of logic gates in everyday
life.
AND Gate (IC 7408)
The AND gate is a fundamental digital logic gate, and the 7408 Integrated Circuit
(IC) is a common implementation of multiple AND gates. Here’s a detailed overview
of the AND gate and the 7408 IC:
Function: The AND gate outputs a high signal (1) only if all of its inputs are
high (1). For example:
o Input: A = 1, B = 1 → Output: Y = 1
o Input: A = 1, B = 0 → Output: Y = 0
o Input: A = 0, B = 0 → Output: Y = 0
Truth Table:
Y (A AND
AB
B)
0 0 0
0 1 0
1 0 0
1 1 1
7408 IC Overview
Description: The 7408 IC contains four independent 2-input AND gates. It's
part of the 74xx family of TTL (Transistor-Transistor Logic) devices.
Pin Configuration:
o The 7408 has 14 pins, typically in a Dual In-line Package (DIP) format.
Pin Function
1 Input A1 (Gate 1)
2 Input B1 (Gate 1)
3 Output Y1 (Gate 1)
4 Input A2 (Gate 2)
5 Input B2 (Gate 2)
6 Output Y2 (Gate 2)
7 Ground (GND)
8 Input A3 (Gate 3)
9 Input B3 (Gate 3)
10 Output Y3 (Gate 3)
11 Input A4 (Gate 4)
12 Input B4 (Gate 4)
13 Output Y4 (Gate 4)
VCC (Power
14
Supply)
Characteristics
Applications
Practical Usage
Summary
The 7408 IC is a versatile and essential component in digital electronics, providing
four AND gates in one package. Its simplicity and reliability make it a staple in
various applications, from basic logic circuits to more complex systems.
The output state of a digital logic AND gate only returns “LOW” again
when ANY of its inputs are at a logic level “0”. In other words for a logic
AND gate, any LOW input will give a LOW output.
The logic or Boolean expression given for a digital AND gate is that
for Logical Multiplication which is denoted by a single dot or full stop
symbol, ( . ) giving us the Boolean expression of: A.B = Q.
Then we can define the operation of a digital 2-input AND gate as being:
Logic AND Gates are available using digital circuits to produce the
desired logical function and is given a symbol whose shape represents the
logical operation of the AND gate.
B A Q
0 0 0
0 1 0
1 1 1
The Boolean Expression for this 6-input AND gate will therefore be:
Q = (A.B).(C.D).(E.F)
In other words:
A AND B AND C AND D AND E AND F gives Q
If the number of inputs required is an odd number of inputs any “unused”
inputs can be held HIGH by connecting them directly to the power supply
using suitable “Pull-up” resistors.
sample breadboard
-----------------------------
OR Gate (IC 7432)
Certainly! Let’s explore the OR gate and the 7432 Integrated Circuit (IC), which is a
common implementation of multiple OR gates.
OR Gate Overview
Function: The OR gate outputs a high signal (1) if at least one of its inputs is
high (1).
o For example:
Input: A = 0, B = 0 → Output: Y = 0
Input: A = 0, B = 1 → Output: Y = 1
Input: A = 1, B = 0 → Output: Y = 1
Input: A = 1, B = 1 → Output: Y = 1
Truth Table:
Y (A OR
AB
B)
0 0 0
0 1 1
1 0 1
1 1 1
7432 IC Overview
Pin Function
1 Input A1 (Gate 1)
2 Input B1 (Gate 1)
3 Output Y1 (Gate 1)
4 Input A2 (Gate 2)
5 Input B2 (Gate 2)
6 Output Y2 (Gate 2)
7 Ground (GND)
8 Input A3 (Gate 3)
9 Input B3 (Gate 3)
10 Output Y3 (Gate 3)
11 Input A4 (Gate 4)
12 Input B4 (Gate 4)
13 Output Y4 (Gate 4)
VCC (Power
14
Supply)
Characteristics
Supply Voltage (VCC): Typically +5V.
Logic Levels: The standard logic levels for TTL are:
o Logic High (1): 2.0V to 5V
o Logic Low (0): 0V to 0.8V
Propagation Delay: The time taken for an input change to affect the output,
typically around 10-15 nanoseconds.
Fan-Out: The number of inputs that the output can drive without affecting
performance; for the 7432, it’s usually 10.
Applications
Practical Usage
Summary
The output, Q of a “Logic OR Gate” only returns “LOW” again when ALL of
its inputs are at a logic level “0”. In other words for a logic OR gate, any
“HIGH” input will give a “HIGH”, logic level “1” output.
The logic or Boolean expression given for a digital logic OR gate is that
for Logical Addition which is denoted by a plus sign, ( + ) giving us the
Boolean expression of: A+B = Q.
Thus the OR gate can be correctly described as an “Inclusive OR gate”
because the output is true when both of its inputs are true (HIGH). Then
we can define the operation of a 2-input logic OR gate as being:
Logic OR Gates are available using digital circuits to produce the desired
logical function and is given a symbol whose shape represents the logical
operation of OR.
B A Q
0 0 0
2-input OR Gate
0 1 1
1 0 1
1 1 1
The Boolean Expression for this 6-input OR gate will therefore be:
Q = (A+B)+(C+D)+(E+F)
In other words:
A OR B OR C OR D OR E OR F gives Q
If the number of inputs required is an odd number of inputs any “unused”
inputs can be held LOW by connecting them directly to ground using
suitable “Pull-down” resistors.
Commonly available digital logic OR gate IC’s include:
TTL Logic OR Gates
Certainly! Let's dive into the NOT gate and the 7404 Integrated Circuit (IC), which is
a common implementation of multiple NOT gates.
Function: The NOT gate, also known as an inverter, outputs a high signal (1)
when its input is low (0), and outputs a low signal (0) when its input is high
(1). Essentially, it inverts the input signal.
Truth Table:
Y (NOT
A
A)
01
10
7404 IC Overview
Pin Function
Input 1 (NOT Gate
1
1)
2 Output 1
Input 2 (NOT Gate
3
2)
4 Output 2
Input 3 (NOT Gate
5
3)
6 Output 3
7 Ground (GND)
Input 4 (NOT Gate
8
4)
9 Output 4
Input 5 (NOT Gate
10
5)
11 Output 5
Input 6 (NOT Gate
12
6)
13 Output 6
14 VCC (Power Supply)
Characteristics
Applications
Practical Usage
Summary
The 7404 IC is a vital component in digital electronics, providing six NOT gates in a
single package. Its ability to invert signals makes it essential for a variety of
applications, from basic logic functions to more complex systems.
Inverting NOT gates are single input devices which have an output level
that is normally at logic level “1” and goes “LOW” to a logic level “0”
when its single input is at logic level “1”, in other words it “inverts”
(complements) its input signal. The output from a NOT gate only returns
“HIGH” again when its input is at logic level “0” giving us the Boolean
expression of: A = Q.
Then we can define the operation of a single input digital logic NOT gate
as being:
“If A is NOT true, then Q is true”
A Q
0 1
Function: The EX-OR gate outputs a high signal (1) when the number of high
inputs is odd. For a 2-input EX-OR gate, it outputs true if exactly one of the
inputs is true.
Truth Table:
Y (A EX-OR
AB
B)
0 00
0 11
1 01
1 10
7486 IC Overview
Pin Function
1 Input A1 (Gate 1)
2 Input B1 (Gate 1)
3 Output Y1 (Gate 1)
4 Input A2 (Gate 2)
5 Input B2 (Gate 2)
6 Output Y2 (Gate 2)
7 Ground (GND)
8 Input A3 (Gate 3)
9 Input B3 (Gate 3)
10 Output Y3 (Gate 3)
11 Input A4 (Gate 4)
12 Input B4 (Gate 4)
13 Output Y4 (Gate 4)
Pin Function
Characteristics
Applications
Practical Usage
Summary
The 7486 IC is a crucial component in digital electronics, providing four EX-OR gates
in one package. Its unique ability to produce an output based on odd input
conditions makes it essential for various applications, from basic logic functions to
complex digital systems.
When the transistors base input at “A” is high, the transistor conducts and
collector current flows producing a voltage drop across the
resistor R thereby connecting the output point at “Q” to ground thus
resulting in a zero voltage output at “Q“.
Likewise, when the transistors base input at “A” is low (0v), the transistor
now switches “OFF” and no collector current flows through the resistor
resulting in an output voltage at “Q” high at a value near to +Vcc.
Then, with an input voltage at “A” HIGH, the output at “Q” will be LOW
and an input voltage at “A” LOW the resulting output voltage at “Q” is
HIGH producing the complement or inversion of the input signal.
Schmitt Inverter
The first circuit shows a very simple low power RC type oscillator using a
Schmitt inverter to generate a square wave output waveform. Initially the
capacitor C is fully discharged so the input to the inverter is “LOW”
resulting in an inverted output which is “HIGH”. As the output from the
inverter is fed back to its input and the capacitor via the resistor R the
capacitor begins to charge up.
When the capacitors charging voltage reaches the upper threshold limit of
the inverter, the inverter changes state, the output becomes “LOW” and
the capacitor begins to discharge through the resistor until it reaches the
lower threshold level were the inverter changes state again. This switching
back and forth by the inverter produces a square wave output signal with
a 33% duty cycle and whose frequency is given as: ƒ = 680/RC.
The second circuit converts a sine wave input (or any oscillating input for
that matter) into a square wave output. The input to the inverter is
connected to the junction of the potential divider network which is used to
set the quiescent point of the circuit. The input capacitor blocks any DC
component present in the input signal only allowing the sine wave signal
to pass.
As this signal passes the upper and lower threshold points of the inverter
the output also changes from “HIGH” to “LOW” and so on producing a
square wave output waveform. This circuit produces an output pulse on
the positive rising edge of the input waveform, but by connecting a
second Schmitt inverter to the output of the first, the basic circuit can be
modified to produce an output pulse on the negative falling edge of the
input signal.
----------------------
Sure! Let’s delve into the NAND gate and the 7400 Integrated Circuit (IC), which is a
widely used implementation of multiple NAND gates.
Function: The NAND gate (NOT AND) outputs a low signal (0) only when all
its inputs are high (1). If any input is low (0), the output is high (1).
Truth Table:
Y (A NAND
AB
B)
0 01
0 11
1 01
1 10
Y (A NAND
AB
B)
7400 IC Overview
Pin Function
1 Input A1 (Gate 1)
2 Input B1 (Gate 1)
3 Output Y1 (Gate 1)
4 Input A2 (Gate 2)
5 Input B2 (Gate 2)
6 Output Y2 (Gate 2)
7 Ground (GND)
8 Input A3 (Gate 3)
9 Input B3 (Gate 3)
10 Output Y3 (Gate 3)
11 Input A4 (Gate 4)
12 Input B4 (Gate 4)
13 Output Y4 (Gate 4)
Characteristics
Applications
Digital Circuits: Used in a variety of digital circuits due to its universal nature (it
can be used to create any logic function).
Control Systems: Often used in decision-making circuits, alarms, and control
systems.
Arithmetic Operations: Can be used in building circuits for addition, subtraction,
and other arithmetic operations.
Practical Usage
Summary
-----------------------------
Certainly! Let’s explore the NOR gate and the 7402 Integrated Circuit (IC), which is
a common implementation of multiple NOR gates.
Function: The NOR gate outputs a high signal (1) only when all its inputs are
low (0). If any input is high (1), the output is low (0).
Truth Table:
Y (A NOR
AB
B)
0 01
0 10
1 00
1 10
7402 IC Overview
Description: The 7402 IC contains four independent 2-input NOR gates. It is
part of the 74xx family of TTL (Transistor-Transistor Logic) devices.
Pin Configuration:
o The 7402 has 14 pins, typically in a Dual In-line Package (DIP) format.
Pin Function
1 Input A1 (Gate 1)
2 Input B1 (Gate 1)
3 Output Y1 (Gate 1)
4 Input A2 (Gate 2)
5 Input B2 (Gate 2)
6 Output Y2 (Gate 2)
7 Ground (GND)
8 Input A3 (Gate 3)
9 Input B3 (Gate 3)
10 Output Y3 (Gate 3)
11 Input A4 (Gate 4)
12 Input B4 (Gate 4)
13 Output Y4 (Gate 4)
Characteristics
Applications
Digital Logic Circuits: The NOR gate is a universal gate, meaning it can be used to
create any other logic gate (AND, OR, NOT, etc.) and complex circuits.
Control Systems: Used in decision-making processes, alarms, and other control
systems.
State Machines: Can be utilized in building state machines and flip-flops.
Practical Usage
Summary
The 7402 IC is a vital component in digital electronics, providing four NOR gates in
one package. Its ability to perform logical functions makes it extremely versatile
and widely used in many applications.
----------------------------
Sure! Let's dive into the EX-NOR gate, which combines the functions of an EX-OR
gate and a NOT gate.
Function: The EX-NOR (Exclusive NOR) gate outputs a high signal (1) when
the number of high inputs is even. For a 2-input EX-NOR gate, it outputs true
(1) if both inputs are the same (either both 0 or both 1).
Truth Table:
Y (A EX-NOR
AB
B)
0 01
0 10
1 00
1 11
Characteristics
where ⊕\oplus⊕ denotes the EX-OR operation and the prime (') denotes NOT.
EX-NOR Gate IC
While specific EX-NOR gate ICs may not be as common as their counterparts (like
the EX-OR gate), the 74266 is a TTL IC that contains a 2-input EX-NOR gate.
Pin Function
1 Input A1
2 Input B1
3 Output Y1
4 Input A2
5 Input B2
6 Output Y2
7 Ground (GND)
8 Input A3
9 Input B3
10 Output Y3
11 Input A4
12 Input B4
13 Output Y4
Summary
----------------------------