0% found this document useful (0 votes)
3 views34 pages

Chapter 4

Chapter 4 of 'Introduction to Computing' covers the fundamentals of logic gates and circuits, including their behavior, combinations, and representations through Boolean expressions, truth tables, and logic diagrams. It explains various types of gates (NOT, AND, OR, XOR, NAND, NOR), the function of adders, multiplexers, and memory circuits like the S-R latch, as well as the implementation of gates using transistors. The chapter also discusses integrated circuits and their classification based on the number of gates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views34 pages

Chapter 4

Chapter 4 of 'Introduction to Computing' covers the fundamentals of logic gates and circuits, including their behavior, combinations, and representations through Boolean expressions, truth tables, and logic diagrams. It explains various types of gates (NOT, AND, OR, XOR, NAND, NOR), the function of adders, multiplexers, and memory circuits like the S-R latch, as well as the implementation of gates using transistors. The chapter also discusses integrated circuits and their classification based on the number of gates.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Introduction to Computing (CSCI 104)

Chapter 4
Gates and Circuits

Dr. Ali Alnoman


Fall 2024
2

Chapter Goals
• Identify the basic logic gates and describe their behavior
• Combine basic gates into circuits
• Describe the behavior of a gate or circuit using Boolean expressions,
truth tables, and logic diagrams
• Describe how gates are implemented using transistors
3

Chapter Goals
• Understand the function of the half adder and full adder
• Describe how a multiplexer works
• Explain how the S-R latch operates
• Describe the characteristics of integrated circuits
4

Computers and Electricity


Gate
A device that performs a basic operation on electrical signals

Circuits
Two or more gates combined to perform more sophisticated tasks
5

Computers and Electricity


How do we describe the behavior of logic gates and circuits?
Boolean expression
Boolean algebra, a mathematical notation for expressing binary (digital) logic
Logic diagram
A graphical representation of a circuit; each gate has its own symbol
Truth table
A table showing all possible input values with the output values
6

Gates
Six types of logic gates:
▫ NOT
▫ AND
▫ OR
▫ XOR
▫ NAND
▫ NOR
7

NOT Gate
The NOT gate accepts one input signal (0 or 1) and returns the inverted
(opposite) signal as output

NOT gate
8

AND Gate
• An AND gate accepts two input signals
• If both inputs are 1, the output is 1; otherwise, the output is 0

AND gate
9

OR Gate
• An OR gate accepts two input signals
• If both inputs are 0, the output is 0; otherwise, the output is 1

OR gate
10

XOR Gate
XOR is pronounced “exclusive OR”
An XOR gate accepts two input signals
If both inputs are the same, the output is 0; otherwise, the output is 1

XOR gate
11

XOR Gate
• Note the difference between the XOR gate and the OR gate; they differ
only in one input situation:
▫ When both inputs are 1, the OR gate produces 1 whereas the XOR produces 0
12

NAND Gate
• The NAND gate accepts two input signals
• If both inputs are 1, the output is 0; otherwise, the output is 1 (opposite
of AND gate)

NAND gate
13

NOR Gate
• The NOR gate accepts two input signals
• If both inputs are 0, the output is 1; otherwise, the output is 0 (opposite of
OR gate)

NOR gate
14

Gates with More Inputs


• Gates can be designed to accept three or more input values
• A 3-input AND gate, for example, produces an output of 1 only if all
input values are 1

3-input AND gate


15

Circuits
Combinational circuit
The current input values explicitly determine the output
Sequential circuit
The output is a function of the current input values as well as the current
output value
We describe the circuit operation using:
▪ Boolean expressions
▪ Logic diagrams
▪ Truth tables
16

Combinational Circuits

• Basic gates are combined to build circuits


• The output of one gate is the input of another gate
17

Combinational Circuits

• Three inputs require eight rows to describe all possible input combinations 23
• This circuit can be written using the Boolean expression AB + AC
18

Combinational Circuits
Consider the following Boolean expression A(B + C)

Compare this truth table with the


previous table, same output!
19

Combinational Circuits

Circuit equivalence
• Two circuits produce the same output
• Boolean algebra allows us to apply provable mathematical principles to
help design logic circuits

• For example, A(B + C) = AB + AC (distributive law), so circuits must be


equivalent
20

Properties of Boolean Algebra


21

Binary Adders
• At the digital (logic) level, addition is performed in binary
• Addition is performed by special circuits called adders
• The result of adding two binary digits could produce a
carry value
• Recall that 1 + 1 = 10 in binary
Half adder: a circuit that computes the sum of two bits
and can produce a carry bit
Half adder does not take a carry-in value!
Truth table of a Half Adder
22

Adders

Circuit diagram representing a half adder

Boolean expressions:
sum = A  B
carry = AB
23

Adders
Full adder adds three values: two inputs and a carry-in

A full adder
24

Multiplexers
Multiplexer (often referred to as MUX is a circuit that produces a single
output signal. The output is simply one of several input signals. The
multiplexer decides which of the inputs is used as the output based on
the value of other input signals, called control signals or selectors

n input 1 output
lines line

m control signals
2-to-1 MUX
4-to-1 MUX n-to-1 MUX (n is power of 2)
25

Multiplexers
An 8-to-1
multiplexer
with three
In the figure shown, the control lines control lines

(selectors) S0, S1, and S2 determine


which of eight input lines (D0 … D7) is
connected to the output (F)

The relation between the number of


selectors (m) and number of inputs (n):
n=2m
26

Circuits as Memory

• Digital circuits can be used to store information


• These circuits are called sequential circuits because the current state
(current output) of the circuit is remembered in the next sequence
27

Circuits as Memory: S-R Latch


• An S-R latch stores a single binary digit (0 or 1)
• There are several ways to build an S-R latch circuit using various types
of gates (e.g., OR, AND)
• The design of this circuit guarantees that the two
outputs Q and Q’ are always “complements” of
each other
• The value of Q at any point in time is considered to
be the current state of the circuit
• Therefore, if Q is 1, the circuit is storing a 1; if Q is
0, the circuit is storing a 0
S-R latch
28

Circuits as Memory: S-R Latch


The function of the S-R Latch is described in the truth table below:

No change

No change

RESET

RESET

SET
SET
S-R latch
Not possible (don’t care)

Not possible (don’t care)

Note: QN is the current output, QN+1 is the next (future) output


29

Integrated Circuits (ICs)

• A piece of silicon on which multiple gates are embedded


• Silicon pieces are mounted on a plastic or ceramic chip with pins along
the edges that can be soldered onto circuit boards or inserted into
appropriate sockets
30

Integrated Circuits (ICs)


An integrated circuit is classified according to the number of gates it has:
31

Integrated Circuits

An SSI chip contains four NAND gates


32

Constructing Gates

• Transistor is a device that acts as either a conductor


that conducts electricity or as a resistor that blocks the
flow of electricity, depending on the voltage level on
the input signal
• A transistor has no moving parts, yet it acts like a switch
• It is made of a semiconductor material which is neither
Transistor symbol

a particularly good conductor of electricity nor a good


insulator
33

Constructing Gates using transistors


34

Review Exercises
Q1) Draw the logic symbol, truth table, and logic expression of the OR gate

Q2) Draw the logic symbol and truth table of the 4-to-1 MUX

Q3) Draw the logic symbol and truth table of the S-R latch

Q4) What is the output X of the combinational logic circuit shown below if
the inputs are as follows: A=0, B=0, C=1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy