Intro to digital circuit
Download
Report
Transcript Intro to digital circuit
Introductory Concepts
• This section of the course introduces the concept of digital circuits
and devices, that are building block of digital circuits.
• Generally, there are two class of signals which we can apply to a
circuit: analogue or digital.
• An analogue signal is the one where the quantities that we are
passing to circuit are continuous range of values, for example
sending sound signal to amplifier circuit.
• An digital signal is the one where the quantities that we are
passing to circuit are Discrete values, for example Switch in a
electrical circuit can pass discrete signal (on , off) to circuit.
Sahar Mosleh
California State University San Marcos
Page
1
Introduction to Logic Circuits
• Based on the information (digital signal) that pass to a circuit, we
can design systems which can use binary logic
• In binary logic quantities are described by 0 or 1, YES or NO,
TRUE or FALSE, etc.
• Logic circuits are the basis of digital computers.
• In this course, we deal with binary logic circuits, which have a
dominant role in digital technology.
• The goal is to introduce and provide an understanding of how these
circuits work, how they are represented in mathematical notation,
and how they are designed using modern automated design
technique
Sahar Mosleh
California State University San Marcos
Page
2
Variables and Functions
• In binary circuits, signals can have only one of two possible values.
• The simplest binary element is a switch that has two states.
State 0 (x =0)
State 1 (x =1)
• The switch can be used in a simple application where it turns a
small light bulb on or off.
• The state of the switch determines whether or not current will flow.
• When the switch is open (state 0) no current can flow, when it is
closed (state 1) current can flow.
Sahar Mosleh
California State University San Marcos
Page
3
x=0
x=1
• The input to this circuit which causes the change in the behavior,
is the switch, that is represented as ‘x’. The output of the circuit is
the state of the light “L”.
• If the light is on, we will say that L=1. If the light is off, we will
say that L=0. We can describe the state of the light L as a function
of the input variable x.
L = f(x) = x
• This simple logic expression describes the output as a function of
the input. We say that f(x) = x is a logic function with the variable
x as the input variable.
Sahar Mosleh
California State University San Marcos
Page
4
• Now consider using two switches to control the state of the light.
The switches can be connected either in series or in parallel. Using a
series connection, the light will be turned on only if both switches
are closed. If either switch is open, the light will be off.
x1
x2
(state of light)
L=f(x1,x2)=x1.x2
where L = 1 if x1 = 1, and x2 = 1
.
otherwise L = 0
• The symbol is called the AND operator, and the above circuit is
said to implement a logical AND function.
Sahar Mosleh
California State University San Marcos
Page
5
• If the switches are connected in parallel, the light will be on if one,
or both, of the switches are closed. The light will be off only if both
switches are open.
x1
x2
L=f(x1,x2 )=x1+x2
If either x1 = 1 or x2 = 1 then L = 1 (light is on )
If both x1 = x2 = 1 then L = 1 (light is on )
If both x1 = x2 = 0 then L = 0 (light is off )
• The “+ “symbol is called the OR operator, and the above circuit is
said to implement a logical OR function.
Sahar Mosleh
California State University San Marcos
Page
6
• Finally, consider a circuit which will generate an output when a
switch is opened. In this case, the light will be turned on when the
switch opens. Conversely, when the switch is closed, it will shortcircuit the light and prevent any current from flowing through it.
x= 0
L=f(x) =x
where L = 1 if x = 0;
L = 0 if x = 1
• We say that L is the inverse or complement of x. Another frequently
used term is the NOT operation. There are several commonly used
notations for indicating the complement:
x = x’ = ! x = NOT x
Sahar Mosleh
California State University San Marcos
Page
7
•
The AND, OR, and NOT functions are the three most important
logic functions we will use. They can be used as building blocks for
the implementation of all logic circuits.
• The AND and OR functions can be extended to n variables.
• An AND function of variables x1, x2, …., xn has the value of 1
only if all n variables are equal to 1.
• An OR function of variables x1, x2, …., xn has the value of 1 if
one, or more of the variables are equal to 1.
Sahar Mosleh
California State University San Marcos
Page
8
•
Truth Tables
The operations of a logic circuit can be defined in a tabular form,
called a truth table.
x1 x2
x1 x2 x1+x2
0
0
1
1
0
0
0
1
0
1
0
1
0
1
1
1
• A truth table lists all the possible combinations of the input
variables and shows the relationship between the input variables and
the resulting output.
• Truth tables grow exponentially in size with the number of
variables. A truth table with three input variables has eight rows,23
since there are eight possible valuations of these variables. For fourinput variables the truth table has 16 rows, 24 ,and so on.
Sahar Mosleh
California State University San Marcos
Page
9
Logic Gates
• Each logic operation can be implemented by electronic device called
transistor (you will learn about the physical property of transistors
and how they work on Physics301 or CS232 ).
• Each of these transistor which in this course we call them logic
gates , are element and building block of digital circuits. A logic
gate has one or more inputs and one output
x1
x2
x1 . x2
AND Gate
x1
x2
x1+x2
OR Gate
x
x’
NOT Gate
• A larger circuit is implemented by a network of gates. The
complexity of a given network has a direct impact on its cost. The
more gate we use on the circuit, the more costly is the circuit.
• Thus it is important to simplify circuit as much as possible
Sahar Mosleh
California State University San Marcos
Page 10
Tasks on logical circuits and
logical functions
• Analysis is the task of determining the logical function that a logic
network represent.
• Synthesis is the reverse task . It means having logical function find
out what logical circuit network is.
• In general, any logic function can be implemented with a variety of
different networks, and each likely having a different cost.
• So how does one find the best implementation for a given function?
• In order to find the best implementation (less costly circuit), we
need to simplify the logic function and then design the circuit based
on simplified function.
Sahar Mosleh
California State University San Marcos
Page 11
Example1:
• Determine the following circuit's functional behavior. Consider what
happens if we apply all possible input signals to it.
x1
A
f(x1,x2)
B
x2
Sahar Mosleh
x1 x2
A=x1
B=x1 x2 f(x1,x2)
0
0
1
1
1
1
0
0
0
0
0
1
0
1
0
1
1
1
0
1
California State University San Marcos
Page 12
Example2:
• Analyze of the following network
x1
A
g(x1,x2)
x2
B
x1 x2
A
B
g(x1,x2)
• Note that in the end, g changes in exactly the same way as f in the
previous example.
• Thus, g(x1, x2) = f(x1, x2), which indicates that two networks are
functionally equivalent. Since both networks represent the same
function, it makes sense to use the simpler one, which is less
costly to implement.
Sahar Mosleh
California State University San Marcos
Page 13