You are on page 1of 109

Digital Electronics

Chap 1: Digital electronic


system and equipments
Syllabus
Chapter 1 (3/0/0) Digital electronic system and equipments
1. Introduction to Digital Electronics
2. Development of digital electronic systems and devices
3. Analog signal, Digital Electronic Signals and Switches
4. Basic Logic Gates (AND, OR, NOT, NAND, NOR)

Chapter 2 (5/1/0) Number systems and codes


1. Decimal, binary, octal, and hexadecimal number systems
2. Binary mathematical operations
3. Complement number and encoding systems (Gray, BCD, Johnson, 7-
segment, ASCII...).

Chapter 3 (7/2/0) Boolean Arithmetic Algebra and Reduction


Techniques
1. Introduction to Boolean Arithmetic Algebra
2. Switching function, Switching circuit
3. De Morgan's theorem
4. Karnaugh mapping
5. Methods for setting up and simplifying logic functions (SOP, POS)
Syllabus
Chapter 4 (3/0/0) Basic digital electronic circuits
1. Logic signals and convection symbols in digital
electronics
2. Basic logic families (RTL, DTL, TTL, CMOS) and
characteristics

Chapter 5 (7/2/0) Combinational logic circuits


1. Introduction to combinational logic circuits
2. Encoder and Decoder
3. Full and half adder circuits
4. Full and half subtractor circuits
5. N-bits adder and subtractor
6. Comparator
7. Multiplexer and Demultiplexer
8. Encoders/Decoders
9. Synchronous control, asynchronous control
Syllabus
Chapter 6 (7/2/0) Sequential Logic circuits
6.1 Trigger (Trigger R-S, Trigger D, Trigger J-K)
6.2 Timer
6.3 Propagation delay in logic gate networks
6.4 Flip-flops
6.5 Counter (binary, BCD, Johnson…)
6.6 Shift registers (parallel, serial)
6.7 Semiconductor Memory

Chapter 7 (4/2/0) Hardware description language and design


simulation tools
7.1 Introduction to Hardware Description Languages
7.2 Basic concepts and program in VHDL
7.3 Method to describing and designing combinational logic circuits
using VHDL
7.4 Assignments on designing combinational logic circuits using
VHDL
Assessments

Percentag
Form Methods
e
Frequent 20%
Oral
assessment
Mid-term exam Writting 20%

Final exam 60%


Writting
(minimum 60%)
Total 100%
Digital Electronics

Chap 1: Digital electronic


system and equipments
The Start of the Modern Electronics Era

Bardeen, Shockley, and Brattain at The first germanium bipolar


Bell Labs - Brattain and Bardeen transistor. Roughly 50 years later,
invented the bipolar transistor in electronics account for 10% (4
1947. trillion dollars) of the world GDP.
Electronics Milestones
1874 Braun invents the solid-state 1958 Integrated circuit developed by
rectifier. Kilby and Noyce
1906 DeForest invents triode vacuum 1961 First commercial IC from Fairchild
tube. Semiconductor
1907-1927 1963 IEEE formed from merger or IRE
First radio circuits developed from and AIEE
diodes and triodes. 1968 First commercial IC opamp
1925 Lilienfeld field-effect device patent 1970 One transistor DRAM cell invented
filed. by Dennard at IBM.
1947 Bardeen and Brattain at Bell 1971 4004 Intel microprocessor
Laboratories invent bipolar introduced.
transistors.
1978 First commercial 1-kilobit memory.
1952 Commercial bipolar transistor
1974 8080 microprocessor introduced.
production at Texas Instruments.
1984 Megabit memory chip introduced.
1956 Bardeen, Brattain, and Shockley
receive Nobel prize. 2000 Alferov, Kilby, and Kromer share
Nobel prize
Evolution of Electronic Devices

Vacuum Discrete
Tubes Transistors

SSI and MSI VLSI


Integrated Surface-Mount
Circuits Circuits
Microelectronics Proliferation
◼ The integrated circuit was invented in 1958.
◼ World transistor production has more than doubled every year for
the past twenty years.
◼ Every year, more transistors are produced than in all previous years
combined.
◼ Approximately 109 transistors were produced in a recent year.
◼ Roughly 50 transistors for every ant in the world .

*Source: Gordon Moore’s Plenary address at the 2003 International Solid State
Circuits Conference.
5 Commendments
◼ Moore’s Law : The number of transistors on a
chip doubles annually
◼ Rock’s Law : The cost of semiconductor tools
doubles every four years
◼ Machrone’s Law: The PC you want to buy will
always be $5000
◼ Metcalfe’s Law : A network’s value grows
proportionately to the number of its users
squared
5 Commandments(cont.)
◼ Wirth’s Law : Software is slowing faster
than hardware is accelerating
◼ Further Reading: “5 Commandments”,
IEEE Spectrum December 2003, pp. 31-
35.
Moore’s law
◼ Moore predicted that the number of transistors
that can be integrated on a die would grow
exponentially with time.
◼ Amazingly visionary – million transistor/chip
barrier was crossed in the 1980’s.
◼ 16 M transistors (Ultra Sparc III)
◼ 140 M transistor (HP PA-8500)
◼ 1.7B transistor (Intel Montecito)
DEC PDP-11 CPU
HP PA7000 RISC
Motorola 68020
Motorola 68040
Toshiba MIPS
Intel 8088
Intel 80386
80386 (cont.)
Intel 80486
Intel Pentium
Intel Pentium 4 Prescott
Penryn and Nehalem
◼ Penryn : 45nm Core 2
Architecture : Core 2
Extreme QX9650
◼ Nehalem : Core i7
Intel CPU Evolution
Device Feature Size
◼ Feature size
reductions enabled by
process innovations.
◼ Smaller features lead
to more transistors
per unit area and
therefore higher
density.
Rapid Increase in Density of
Microelectronics

Memory chip density Microprocessor complexity


versus time. versus time.
IC Design Step 1: RTL
IC Design 2 : Layout
IC Design 3 : Fabrication
IC Design 4 : Chip
IC Design 5 : System
IC design is mostly coding
◼ Hardware Description Language (Verilog,
VHDL) are widely used in today’s IC
design.
◼ C programs need to obey rules set by OS.
◼ HDL programs need to obey physical rules
in the real world.
Analog versus Digital Electronics

◼ Most observables are analog


◼ But the most convenient way to represent
and transmit information electronically is
digital
◼ Analog/digital and digital/analog
conversion is essential
Digital signal representation
◼ By using binary numbers we can represent any quantity. For
example a binary two (10) could represent a 2 volt signal. But
we generally have to agree on some sort of “code” and the
dynamic range of the signal in order to know the form and the
minimum number of bits.
◼ Possible digital representation for a pure sine wave of known
frequency. We must choose maximum value and “resolution”
or “error,” then we can encode the numbers. Suppose we
want 1V accuracy of amplitude with maximum amplitude of
50V, we could use a simple pure binary code with 6 bits of
information.
Digital representations of logical
functions
◼ Digital signals also offer an effective way to
execute logic. The formalism for performing logic
with binary variables is called switching algebra
or boolean algebra.
◼ Digital electronics combines two important
properties:
 The ability to represent real functions by coding the
information in digital form.
 The ability to control a system by a process of
manipulation and evaluation of digital variables using
switching algebra.
Digital Representations of logic
functions (cont.)
◼ Digital signals can be transmitted, received,
amplified, and retransmitted with no degradation.
◼ Binary numbers are a natural method of
expressing logic variables.
◼ Complex logic functions are easily expressed as
binary function.
◼ With digital representation, we can achieve
arbitrary levels of “ dynamic range,” that is, the
ratio of the largest possible signal to the smallest
than can be distinguished above the background
noise.
◼ Digital information is easily and inexpensively
stored
Signal Types
◼ Analog signals take on
continuous values - typically
current or voltage.
◼ Digital signals appear at
discrete levels. Usually we
use binary signals which utilize
only two levels.
◼ One level is referred to as
logical 1 and logical 0 is
assigned to the other level.
Analog and Digital Signals

◼ Analog signals are continuous ◼ After digitization, the


in time and voltage or current. continuous analog signal
(Charge can also be used as a becomes a set of discrete
signal conveyor.) values, typically separated by
fixed time intervals.
Digital-to-Analog (D/A)
Conversion

◼ For an n-bit D/A converter, the output voltage is


expressed as: −1 −2 −n
VO = (b1 2 + b2 2 + ...+ bn 2 )VFS
◼ The smallest possible voltage change is known as the
least significant bit or LSB.
VLSB = 2−n VFS

DAC

TI’s 20-bit sigma delta DAC


Analog-to-Digital (A/D)
Conversion

◼ Analog input voltage vx is converted to the nearest n-bit number.


◼ For a four bit converter, 0 -> vx input yields a 0000 -> 1111 digital
output.
◼ Output is approximation of input due to the limited resolution of the
n-bit output. Error is expressed as:
−1 −2 −n
V = v x − (b1 2 + b2 2 + ...+ bn 2 )VFS
ADC Die Photo
◼ Rockwell Scientific 4Gsps ADC
A/D Converter Transfer
Characteristic

V = v x − (b1 2−1 + b2 2−2 + ...+ bn 2−n )VFS


Introduction to Circuit Theory
◼ Circuit theory is based on the concept of
modeling. To analyze any complex physical
system, we must be able to describe the system
in terms of an idealized model that is an
interconnection of idealized elements.
◼ By analyzing the circuit model, we can predict
the behavior of the physical circuit and design
better circuits.
Lumped Circuits
◼ Lumped circuits are obtained by
connecting lumped elements.
◼ Typical lumped elements are resistors,
capacitors, inductors, and transformers.
◼ The size of lumped circuit is small
compared to the wavelength of their
normal frequency of operation.
Lumped Circuit definition
◼ A lumped circuit is by definition an
interconnecting lumped element.
◼ The two terminal elements are called
branches, the terminals of the elements
are called nodes.
◼ The branch voltage and branch current are
the basic variables of interest in circuit
theory.
Lumped circuit figure
Operating Frequency vs. Size
◼ Audio Circuit operate @ 25Khz, the
wavelength λ~=12Km, which is much
larger than the size of any elements
◼ Computer Circuit @ 500 Mhz, λ=0.6m, the
lumped approx. is not so good.
◼ Microwave circuit, where λ is between
10cm to 1mm, Kirchhoff’s laws do not
apply for the cavity resonators.
Reference Directions
A
◼ A two terminal lumped
elements (branch) with i
nodes A and B. +

◼ The reference directions for v


the branch voltage v and -
branch current i are shown in
the graph. B
◼ The reference direction is
chosen arbitrarily.
Notational conventions
◼ Total quantities will be represented by
lowercase letters with capital subscripts,
such as vT anf iT.
◼ The dc components are represented by
capital letters with capital subscripts as
VDC and IDC; changes or variations from
the dc value are represented by vac and iac.
◼ vT = VDC + vac
◼ iT = IDC + iac
+

v1 g mv 1 i1 i 1

(a) VCCS (b) CCCS

v1 A v1 i1 i 1

(c) VCVS (d) CCVS


F igu re 1.10 - Con t rolled S ou rces
(a ) Volt a ge-con t rolled cu rren t s ou rce - (VCCS )
(b)Cu rren t -con t rolled cu rren t s ou rce - (CCCS )
(c) Volt a ge-con t rolled volt a ge s ou rce - (VCVS )
(d) Cu rren t -con t rolled volt a ge s ou rce - (CCVS ).
Kirchhoff’s Current Law (KCL)
◼ For any lumped electric circuit, for any of
its nodes, and at any time, the algebraic
sum of all branch currents leaving the
node is zero.
KCL Example
◼ When applying KCL to circuit, first assign reference
direction for each branch.
◼ For node 2, i4-i3-i6=0
◼ For node 1, -i1+i2+i3=0
Kirchhoff’s Voltage Law (KVL)
◼ For any lumped electric circuit, for any of
its loops, and at any time, the algebraic
sum of the branch voltages around the
loop is zero.
KVL Example
◼ For loop I, v4+v5-v6=0
◼ Loop II, v4+v5-v2-v1=0
Properties of KCL and KVL
◼ KCL imposes a linear constraint on the
branch currents.
◼ KCL applies to any lumped electric circuit;
it is independent of the nature of the
elements.
◼ KCL expresses the conservation of charge
at any time.
Properties of KVL and KCL (cont.)

◼ An example where KCL doesn’t apply is


the whip antenna. The antenna is about ¼
wavelength so it is not a lumped circuit.
◼ KVL imposes a linear constraint between
branch voltages of a loop.
◼ KVL is independent of the natural of the
elements.
Circuit Elements
◼ Resistors
◼ Independent sources
◼ Capacitors
◼ Inductors
Resistors
◼ v(t) = Ri(t) or i(t)=Gv(t)
◼ R is the resistance
◼ G is called the conductance
◼ For linear time-invariant resistors,
R and G are constants.
Independent Sources
◼ Independent sources
maintains a prescribed
voltage or current across
the terminals of the
arbitrary circuit to which
it is connected.
Capacitors
◼ Capacitors store electrical
charges.
◼ i(t) = dq/dt
◼ q(t) = Cv(t)
◼ i(t) = Cdv(t)/dt
Parallel Plate Capacitance
◼ K = relative permittivity of the dielectric material in between two
plates.
◼ K= 1 for free space, K=3.9 for SiO2
◼ High K (K > 3.9)dielectric (e.g. (BaSr)TiO3, barium strontium titanate
for K=160-600 for storage capacitance; zirconium silicate, ZrSiO4
with K=15 for next generation gate oxide)
◼ Low K (K < 3.9)dielectric for ILD (interlayer dielectrics ) to insulate
between metal lines (e.g. Porous SiO2 for K=1.3)
Inductors
◼ Inductors store energy in
their magnetic fields.
◼ V(t) = dΦ/dt
◼ Φ(t)=Li(t)
◼ V(t) = L di/dt
RLC Effects in Real Circuit

◼ Power (Thermal)
◼ Time Delay
Physical Componenets vs. Circuit
Elements
◼ Range of Operation
◼ Temperature Effect
◼ Parasitic effect
◼ Typical Element Size
 Resistor: 1ohm to Mohms
 Capacitor : femto Farad to micro Farad
Circuit Theory Review: Voltage Division
v1 = i sR1 and v 2 = i s R2

Applying KVL to the loop,


v s = v1 + v 2 = i s (R1 + R2 )

vs
and is =
R1 + R2
Combining these yields the basic voltage division formula:
R1 R2
v1 = v s v2 = vs
 R1 + R2 R1 + R2
Circuit Theory Review: Voltage Division
(cont.)
Using the derived equations
with the indicated values,
8 k
v1 = 10 V = 8.00 V
8 k + 2 k
2 k
v 2 = 10 V = 2.00 V
8 k + 2 k

Design Note: Voltage division only applies when both


resistors are carrying the same current.
Circuit Theory Review: Current Division
vs vs
i s = i1 + i 2 where i1 = i
and 2 =
R1 R2
Combining and solving for vs,
1 RR
vs = is  = i s  1 2 = i sR1 || R2
1 1 R1 + R2
+
R1 R2
Combining these yields the basic current division formula:
R2 R1
i1 = i s i2 = is
R1 + R2 R1 + R2

and
Circuit Theory Review: Current
Division (cont.)
Using the derived equations
with the indicated values,
3 k
i1 = 5 ma = 3.00 mA
2 k + 3 k
2 k
i 2 = 5 ma = 2.00 mA
2 k + 3 k

Design Note: Current division only applies when the same


voltage appears across both resistors.
Equivalent Circuit
◼ Thevenin and Norton Equivalent circuit
represents real-world battery models.
◼ Complex circuits can be simplified to these
representation to help us understand the
circuits.
Frequency Spectrum of Electronic
Signals
◼ Nonrepetitive signals have continuous spectra often
occupying a broad range of frequencies
◼ Fourier theory tells us that repetitive signals are
composed of a set of sinusoidal signals with distinct
amplitude, frequency, and phase.
◼ The set of sinusoidal signals is known as a Fourier
series.
◼ The frequency spectrum of a signal is the amplitude and
phase components of the signal versus frequency.
Frequencies of Some Common Signals

◼ Audible sounds 20 Hz - 20 KHz


◼ Baseband TV 0 - 4.5 MHz
◼ FM Radio 88 - 108 MHz
◼ Television (Channels 2-6) 54 - 88 MHz
◼ Television (Channels 7-13) 174 - 216 MHz
◼ Maritime and Govt. Comm. 216 - 450 MHz
◼ Cell phones 1710 - 2690 MHz
◼ Satellite TV 3.7 - 4.2 GHz
Amplifier Basics

◼ Analog signals are typically manipulated with linear


amplifiers.
◼ Although signals may be comprised of several different
components, linearity permits us to use the
superposition principle.
◼ Superposition allows us to calculate the effect of each of
the different components of a signal individually and then
add the individual contributions to the output.
Antenna

RF IF Audio
Mixer FM
Amplifier Amplifier Amplifier
and Filter and Filter Detector

(88 - 108 MHz) 10.7 MHz 50 Hz - 15 kHz

Local
Oscillator

(77.3 - 97.3 MHz) Speaker

Figure 1.21 - Block diagram for an FM radio Receiver


Amplifier Input/Output
Response

vs = sin2000t V

Av = -5

Note: negative
gain is equivalent
to 180 degress of
phase shift.
Amplifier Frequency Response
Amplifiers can be designed to selectively amplify specific
ranges of frequencies. Such an amplifier is known as a filter.
Several filter types are shown below:

Low-Pass High-Pass BandPass Band-Reject All-Pass


Circuit Element Variations
◼ All electronic components have manufacturing tolerances.
 Resistors can be purchased with  10%,  5%, and
 1% tolerance. (IC resistors are often  10%.)
 Capacitors can have asymmetrical tolerances such as +20%/-50%.
 Power supply voltages typically vary from 1% to 10%.
◼ Device parameters will also vary with temperature and age.
◼ Circuits must be designed to accommodate these variations.
◼ We will use worst-case and Monte Carlo (statistical) analysis to
examine the effects of component parameter variations.
Tolerance Modeling
◼ For symmetrical parameter variations
PNOM(1 - )  P  PNOM(1 + )
◼ For example, a 10K resistor with 5%
percent tolerance could take on the
following range of values:
10k(1 - 0.05)  R  10k(1 + 0.05)
9,500   R  10,500 
Circuit Analysis with Tolerances

◼ Worst-case analysis
 Parameters are manipulated to produce the worst-case min and max
values of desired quantities.
 This can lead to over design since the worst-case combination of
parameters is rare.
 It may be less expensive to discard a rare failure than to design for
100% yield.
◼ Monte-Carlo analysis
 Parameters are randomly varied to generate a set of statistics for
desired outputs.
 The design can be optimized so that failures due to parameter variation
are less frequent than failures due to other mechanisms.
 In this way, the design difficulty is better managed than a worst-case
approach.
Amplifiers in a familiar electronic
system
◼ The local oscillator, which tunes the radio
receiver to select the desired station.
◼ The mixer circuit actually changes the
frequency of the incoming signal and is
thus a nonlinear circuit.
Bài tập 1:
- Biên độ của sóng mang là 1 microvolt
- Tần số của song mang là 1MHz
- Biên độ của sóng điều biến là 0.5 microvolt
- Tần số của sóng điều biến là 40kHz
- Các pha ban đầu của sóng mang và sóng điều biến đều là 0
Hãy biểu diễn tín hiệu sóng dưới dạng công thức.

Bài tập 2:
- Biên độ của sóng mang là 1 microvolt
- Tần số của song mang là 1MHz
- Biên độ của sóng điều biến là 0.5 microvolt
- Thành phần 1 chiều của sóng điều biến là: 1 microvolt
- Tần số của sóng điều biến là 40kHz
- Các pha ban đầu của sóng mang và sóng điều biến đều là 0
Hãy biểu diễn tín hiệu sóng dưới dạng công thức.
Câu hỏi: Điều kiện gì của tần số lấy mẫu để có thể khôi phục lại được
tín hiệu ban đầu?

Định lý lấy mẫu Nyquist–Shannon


Một hàm số tín hiệu x(t) không chứa bất kỳ thành phần tần số nào
lớn hơn hoặc bằng một giá trị fm có thể biểu diễn chính xác bằng tập
các giá trị của nó với chu kỳ lấy mẫu T = 1/(2fm).
Chuyển đổi từ tín hiệu tương tự sang tín
hiệu số (ADC)

8 bít (0-255) 8 bít (0-255) 8 bít (0-255)


Basic Logic Gates
Logic circuits

◼ Definition: A set of individual logic gates that


connect together and create a logic design is
known as a Logic Circuit
Basic logic gates
◼ Basic logic gates:
 NOT
 AND
 OR

We can make any logic circuit or gate by


combining these three gates
NOT gate
◼ The NOT gate is also known as the inversion
gate
◼ It consists of one input and one output, and the
input can only be binary numbers; 0 and 1

The truth table for NOT Gate:


A Y=Ā
0 1
1 0

Symbol
NOT gate
◼ Simple principle

Symbol
AND gate
◼ AND gate has 2 inputs and 1 output

The truth table for AND Gate:


A B Y=A AND B
0 0 0
1 0 0
0 1 0
1 1 1
AND gate
Principle diagram of AND gate
OR Gate
◼ The OR gate is another basic logic gate
◼ Like the AND gate, it has 2 inputs and 1 output

The truth table for OR Gate:


A B Y=A OR B
0 0 0
1 0 1
0 1 1
1 1 1
OR Gate
◼ Principle
NAND gate
◼ NAND gate is also known as NOT-AND
◼ NAND is the inversion of the AND gate

A B Y=A NAND B
0 0 1
1 0 1
0 1 1
1 1 0
NOR gate
◼ NOR gate is also known as NOT-OR
◼ NOR is the inversion of the OR gate

A B Y=A NOR B
0 0 1
1 0 0
0 1 0
1 1 0
Question:
Draw schematic diagrams of circuits:
◼ NAND
◼ NOR
EX-OR and EX-NOR gates
◼ EX-OR => Exclusive OR gate.

◼ EX-OR can also be written as XOR.


◼ EX-NOR can also be written as XNOR.
◼ XOR and XNOR gates can have more
than 2 inputs and 1 output
EXOR gate

A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
EXOR gate
XNOR gate

A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
Question:
Implementing the XOR and XNOR gates
with 2 and 3 input using the NOT, AND,
OR . gates
Summary
Finished!

You might also like