Exp 07
Exp 07
1
1
2 CL
9 CLK
10 LD
7 TE 15
1
PE CO
6 11
+
5 P4 Q4 12
4 P3 Q3 13
3 P2 Q2 14
P1 Q1
14161
-
2
Electronic Instrumentation
Experiment 7
Digital Logic Devices and the 555 Timer
Agenda
Electronic Instrumentation 3
What you will know:
How to identify logic gates, their truth
tables, and boolean equation
What a Flip Flop does and how it works
How a counter uses Flip Flops to count in
binary
How to convert Decimal to Binary to
Hexadecimal
How a 555 Timer Works
What Pulse Width Modulation does
Electronic Instrumentation 4
Basic Logic Gates
Combinational Logic Devices
Boolean Algebra
DeMorgan’s Laws
Electronic Instrumentation 5
Review: Advantages of Digital Systems
Inherent ability to deal with degraded electric
signals
• Slight variation in input still translated to correct
output value
Electronic Instrumentation 7
Mathematical Logic: Digital Systems
Mathematical logic allows us to reason about
the truth of a set of statements which may be
true or false
• IF N-S is green
• AND E-W is red
• AND 45 seconds has expired
since last light change
• THEN the N-S lights can be
changed from green to yellow
Boolean algebra is the algebraic system for
manipulating logic statements
Electronic Instrumentation 8
Combinational Logic Devices
Logic Gates perform basic logic operations, such as
AND, OR and NOT, on binary signals.
We can model the behavior of these chips by
enumerating the output they produce for all possible
inputs.
In order to show this behavior, we use truth tables,
which show the output for all input combinations.
The outputs of combinational logic gates depend only
on the instantaneous values of the inputs. (no
memory)
Electronic Instrumentation 9
Logic Gates
Y=1(true) if A is 0 or Y is 0
Y=1(true) if A and B (inputs) (false) Inversion of AND
are both 1 (true)
• AND Gate
• If both X and Y are true (1), then Z is true (1)
Electronic Instrumentation 11
Laws of Boolean Algebra
Electronic Instrumentation 12
Procedure for complementing a
DeMorgan’s Laws complex function
Inverting Signal A
NAND AND
OrSignal
U1A U1A output
Aoutput
and and and
U3A
B Aoutput
inverted
IfElectronic
Ifmatch
If match either
make make
or0 both1 if
if not
Instrumentation
ismake
not
1 make
make
1 1 0 14
Example Problem
Write the Boolean expression
NAND ( ¯¯
● )
OR (+)
Inverter ( ¯¯ )
AND ( ● )
Electronic Instrumentation 15
Flip Flops
Sequential Logic Devices
Flip Flops
By-Pass Capacitors
Electronic Instrumentation 16
Sequential Logic Devices
In a sequential logic device, the timing or sequencing of the
input signals is important. Devices in this class include flip-
flops and counters.
Output depends on current inputs and the history of previous
inputs
Positive edge-triggered devices respond to a low-to-high (0 to
1) transition, and negative edge-triggered devices respond to a
high-to-low (1 to 0) transition.
Electronic Instrumentation 18
Flip-Flops
• A flip-flop is a sequential device that can store and
switch between two binary states.
• It is called a bistable device since it has two and only
two possible output states: 1 (high) and 0 (low).
• It has the capability of remaining in a particular state
(i.e., storing a bit) until the clock signal and certain
combinations of the input cause it to change state.
Electronic Instrumentation 19
Simple Flip Flop Example: The RS Flip-Flop
Q=0
Note that the output depends on
Q=1
three things: the two inputs and
the previous state of the output.
Electronic Instrumentation 20
Inside the R-S Flip Flop
Note that the enable signal is the clock, which regularly pulses.
This flip flop changes on the rising edge of the clock. It looks at
the two inputs when the clock goes up and sets the outputs
according to the truth table for the device.
Electronic Instrumentation 21
Inside the J-K Flip Flop
Electronic Instrumentation 22
By-Pass Capacitors
V+
GND
Electronic Instrumentation 23
Counters
Binary Numbers
Binary Counters
Timing Diagrams
Electronic Instrumentation 24
Decimal-Binary conversion
The decimal number system represents quantities
using digits 0 through 9:
For example in base 10 the number 154 can be
represented as
• 15410= 1x100 + 5x10 +4
• 15410=1x102+5x101+4x100
Binary number can be represented only by two digits
0 and 1 so in base 2 the 8-bit binary number
100110102= 1x27 + 0x26 + 0x25 + 1x24 + 1x23 + 0x22
+1x21 + 0x20
=1x128 + 0x64 + 0x32 +1x16 + 1x8 + 0x4
+1x2 +0x1
=128 + 16 + 8 + 2 =15410
Electronic Instrumentation 25
Binary – Decimal -- Hexadecimal Conversion
10110101110001011001110011110110 binary number
B 5 C 5 9 C F 6 corresponding hexadecimal
(base 16) digit
equivalent hexadecimal
B5C59CF6 number
Decimal QD QC QB QA
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
Electronic Instrumentation 27
Binary Counters are made with Flip Flops
http://www.play-hookey.com/digital/synchronous_counter.html
Each flip flop corresponds to one bit in the counter.
Hence, this is a four-bit counter.
J and K are set to toggle (1) (because they are tied together) at
clock edge (triggered)
Output of one is input clock to the next
Electronic Instrumentation 28
Timing Diagram: Typical Output for Binary Counter
Electronic Instrumentation 30
The 555 Timer
The 555 Timer is one of the most popular
and versatile integrated circuits ever produced!
It is 30 years old and still being used!
It is a combination of digital and analog circuits.
It is known as the “time machine” as it performs a wide
variety of timing tasks.
Applications for the 555 Timer include:
• Bounce-free switches and Cascaded timers
• Frequency dividers
• Voltage-controlled oscillators
• Pulse generators and LED flashers
Electronic Instrumentation 31
555 Timer
8
VCC
R
7
DIS
3
Q
6
2 THR
TR
GND
5
CV
NE555
1
Each pin has a function
Note some familiar components inside
Electronic Instrumentation 32
Inside the 555 Timer
Electronic Instrumentation 33
Inside the 555 Timer
Electronic Instrumentation 34
• The flip-flop (green) is a bi-stable device. It
generates two values, a “high” value equal to Vcc
and a “low” value equal to 0V.
• When the Threshold comparator saturates, the flip flop is
Reset (R) and it outputs a low signal at pin 3 (output Q).
• When the Trigger comparator saturates, the flip flop is Set
(S) and it outputs a high signal at pin 3 (output Q).
• The transistor (purple) is being used as a switch, it
connects pin 7 (discharge) to ground when it is
closed.
• When Q is low, Qbar is high. This closes the transistor
switch and attaches pin 7 to ground.
• When Q is high, Qbar is low. This open the switch and
pin 7 is no longer grounded
Electronic Instrumentation 35
Types of 555-Timer Circuits
5V
5V
Ra R
8
VCC
R
R
VCC
7 7
DIS DIS
1K
3
Rb 3 Q
Q
6
6 2 THR
2 THR TR LED
GND
TR LED 5
GND
2
CV
5
CV
0.01uF
NE555
C
1
0.01uF
NE555
C
1
1
Astable Multivibrator Monostable Multivibrator
puts out a continuous (or one-shot) puts out one
sequence of pulses pulse each time the switch
is connected
Binary Counter demo
The CLAPPER demo
Electronic Instrumentation 36
Monostable Multivibrator (One Shot)
Vcc 8 4 Reset
R Threshold Comparator
Ra 2 +V
Vcc -
Q
Output
3 R
+ 3
6 -V
R
Trigger +V
-
2 S Q
1 +
Vcc -V
3 Trigger Comparator Control Flip-Flop
7
R
C
1 Monstable Multivibrator
Electronic Instrumentation
One-Shot 37
Behavior of the Monostable Multivibrator
The monostable multivibrator is constructed by adding an
external capacitor and resistor to a 555 timer.
The circuit generates a single pulse of desired duration
when it receives a trigger signal, hence it is also called a
one-shot.
The time constant of the
resistor-capacitor
combination determines
the length of the pulse.
Electronic Instrumentation 38
Uses of the Monostable Multivibrator
• Used to generate a clean pulse of the correct
height and duration for a digital system
• Used to turn circuits or external components
on or off for a specific length of time.
• Used to generate delays.
• Can be cascaded to create a variety of
sequential timing pulses. These pulses can
allow you to time and sequence a number of
related operations.
Electronic Instrumentation 39
Astable Pulse-Train Generator (Multivibrator)
Vcc 8 4
R Threshold Comparator
R1 +V
- Output
R Q
+ 3
R2 6 -V
R
+V
-
2 S Q
+
-V
Trigger Comparator Control Flip-Flop
7
R
C
Electronic Instrumentation 41
First we must examine how capacitors charge 10V
TCLOSE = 0 R1
1 2
8V
U1
V V
1k V
1
6V
U2
10V
V1
2
TOPEN = 0 C1
4V
Capacitor voltage
C a p ac i t o r V o l ta g e
1uF
2V
0V
0 0s
V ( U 2: 1 )
1m s
V ( R 1: 2 )
2ms
V ( V 1 :+ )
3 ms 4ms 5ms 6ms 7ms 8m s 9ms 1 0m s
Ti m e
8m A 8V
6m A
Capacitor resistor
Ca pa c it o r an d R e si st o r C ur re n t
6V
Capacitor
C ap a ci t or V ol t ag e
4m A
current 4V
2m A 2V
voltage
0A 0V
0s 1 ms 2m s 3ms 4 ms 5m s 6 ms 7m s 8ms 9 ms 1 0m s 0s 1 ms 2 ms 3m s 4m s 5ms 6ms 7 ms 8 ms 9m s 10 m s
I ( R1 ) I (C 1 ) V ( U 2: 1 ) V ( R 1: 2 ) V ( V 1: + )
T im e T im e
t
Capacitor Current I Ioe
Electronic Instrumentation 44
Understanding the equations
10V
8V
V 6V
Capacitor Voltage
4V Capacitor voltage
2V
0V
1ms
0s 1ms 2ms 3ms 4ms 5ms 6ms 7ms 8ms 9ms 10ms
V(U2:1) V(R1:2) V(V1:+)
Time
Electronic Instrumentation 46
555 Timer
At the beginning of the
cycle, C1 is charged through
resistors R1 and R2. The
charging time constant is
ch arg e ( R1 R 2)C1
The voltage reaches
(2/3)Vcc in a time
Electronic Instrumentation 47
555 Timer
When the voltage on the
capacitor reaches (2/3)Vcc,
a switch (the transistor) is
closed (grounded) at pin 7.
The capacitor is discharged
to (1/3)Vcc through R2 to
ground, at which time the
switch is opened and the disch arg e ( R 2)C1
cycle starts over.
t disch arg e T 2 0.693( R 2)C1
Electronic Instrumentation 48
555 Timer
R 1 R 2 C 1 0.693 R 2 C 1
frequency
charge discharge 0.693
1 144
.
f
0.693( R1 2 R2)C1 ( R1 2 R2)C1
Electronic Instrumentation 49
555 Animation
Output is low
so the upper
LED is on and
the lower LED
is off
Capacitor is discharging
through Rb
Electronic Instrumentation 51
Uses of the Astable Multivibrator
• Flashing LED’s
• Pulse Width Modulation
• Pulse Position Modulation
• Periodic Timers
Electronic Instrumentation 52
Flashing LED’s
Electronic Instrumentation 53
PWM: Pulse Width Modulation
Medium
Duty Cycle
High
Duty Cycle
Receiver Circuit