DSD Chapter 1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Digital System Design

(EEE-344)

Week 1

Instructor:
Umair Shafiq Khan
Lecturer
umairkhan@cuilahore.edu.pk
Electrical and Computer Engineering Department, CUI
Lahore Campus

Office:
Block-B, Room No. B12A
Timings:
1
About the Course

Topics to Be Covered:

1. Introduction to Digital Systems


2. Combinational Logic Design
3. Sequential Logic Design – Controllers
4. Datapath Components
5. Register-Transfer Level (RTL) Design
6. Optimizations and Trandsoff
7. Programmable Logic Arrays (PAL), Programmable Arrays
Logic (PLA)
8. Physical Implementation

2
Course learning Outcomes:

• CLO 1: Analyze and Design the working of advanced combinational


and sequential logic based systems using the classical principals of
digital logic design.

• CLO 2: Design of digital systems in a hierarchical and top-down


manner using register-transfer logic (RTL) approach.

3
About the Course

• Rules of Engagement
• Attendance does matter, be aware!
• Protection of your copy is YOUR responsibility! All matching
Assignments/quiz/lab work will lose marks EQUALLY.
• ONLY email or meeting in office hours
• Slides will be given after the lecture via CU-Online tool or via CR
ONLY
• NO EMAILS for personal requests before/during/after exams.
• Its all interactive.

4
Digital System Design

Chapter 1: Introduction

Slides to accompany the textbook Digital Design, First Edition,


by Frank Vahid, John Wiley and Sons Publishers, 2007.
http://www.ddvahid.com

Copyright © 2007 Frank Vahid


Instructors of courses requiring Vahid's Digital Design textbook (published by John Wiley and Sons) have permission to modify and use these slides for customary course-related activities,
subject to keeping this copyright notice in place and unmodified. These slides may be posted as unanimated pdf versions on publicly-accessible course websites.. PowerPoint source (or pdf
with animations) may not be posted to publicly-accessible websites, but may be posted for students on internal protected sites or distributed directly to students by other electronic means.
Instructors may make printouts of the slides available to students for a reasonable photocopying charge, without incurring royalties. Any other use requires explicit permission. Instructors
may obtain PowerPoint source or obtain special use permissions from Wiley – see http://www.ddvahid.com for information. 5
1.1

Why Study Digital Design?


• Look “under the hood” of computers
• Solid understanding --> confidence, insight, even
better programmer when aware of hardware
resource issues
• Electronic devices becoming digital
• Enabled by shrinking and more capable chips
• Enables:
• Better devices: Better sound recorders, cameras, cars,
cell phones, medical devices,...
• New devices: Video games, ...
• Known as “embedded systems”
• Thousands of new devices every year
• Designers needed: Potential career direction

Satellites DVD Video Musical


players recorders instruments
Portable
music players Cell phones Cameras TVs ???

1995 1997 1999 2001 2003 2005 2007


• Years shown above indicate when digital version began to dominate
– (Not the first year that a digital version appeared) 6
Note: Slides with animation are denoted with a small red "a" near the animated
1.2

What Does “Digital” Mean?


• Analog signal • Digital signal
• Infinite possible values
• Ex: voltage on a wire created by
– Finite possible values
microphone • Ex: button pressed on a
keypad

1 2 3 4

2
digital
signal
analog
signal Possible
values:
Possible values: 0, 1, 2, 3, or 4.
1.00, 1.01, 2.0000009, 4 That’s it.

value
valu

... infinite possibilities 3


e

2
1
0
tim tim
e e
7
Digital Signals with Only Two Values: Binary

• Binary digital signal -- only two possible values


• Typically represented as 0 and 1

valu
• One binary digit is a bit

e
• We’ll only consider binary digital signals 1
• Binary is popular because 0
• Transistors, the basic digital electric component, operate tim
using two voltages (more in Ch. 2) e
• Storing/transmitting one of two values is easier than three
or more (e.g., loud beep or quiet beep, reflection or no
reflection)

8
Example of Digitization Benefit
• Analog signal (e.g., audio) may

Volts

(e.g, cell phone)


lose quality 3 3

transmission
lengthy
• Voltage levels not 2 2
saved/copied/transmitted original 1 received signal
1
perfectly
0 signal 0
• Digitized version enables near- tim tim
perfect save/cpy/trn. e e lower, ?
How fix -- higher,
0 1 11 1 11
• “Sample” voltage at particular 1 0 0
rate, save sample using bit a2

(e.g, cell phone)


Volts

transmission
a
encoding
d

lengthy
• Voltage levels still not kept digitized 1
1
perfectly signal
0 0
• But we can distinguish 0s from
1s tim tim
e Can fix -- easily distinguish
e 0s
Let bit encoding be: 0 1 11 1 11 sa and 1s, restore
1 V: “01” Digitized signal not 1 0 0
d2 e m
2 V: “10” perfect re-creation,
Volts

3 a
3 V: “11” but higher sampling
rate and more bits per 2
encoding brings closer. 1
0 tim 9
e
Digitized Audio: Compression Benefit
• Digitized audio can be Example compression
compressed scheme:
• e.g., MP3s 00 --> 0000000000
• A CD can hold about 20 songs 01 --> 1111111111
uncompressed, but about 200 1X --> X
compressed
0000000000 0000000000 0000001111
• Compression also done on 1111111111
digitized pictures (jpeg), 00 00 10000001111
movies (mpeg), and more 01
• Digitization has many other
benefits too

10
How Do We Encode Data as Binary for Our Digital
System?
a
analo button

phenomen
g • Some inputs inherently binary
a 0 1
• Button: not pressed (0), pressed
sensors
other
and
(1) re blu gree blac
d e n k
electri inputs digita • Some inputs inherently digital
csigna ldat
0 0 0
l a • Just need encoding in binary
A2D re blu gree blac

digita
• e.g., multi-button input: encode d e n k

l dat red=001, blue=010, ... 0 0 1


a
Digital • Some inputs analog re blu gree blac
System • Need analog-to-digital d e n k
digita digita
l dat ldat
conversion 0 1 0

air 33
a D2A a • As done in earlier slide -- sample
degrees
electri and encode with bits
csigna temperature
l actuators sensor
other
and
outputs

0 0 1 0 0 0 0 1

11
How to Encode Text: ASCII, Unicode
• ASCII: 7- (or 8-) bit encoding of each Symbo E codin Symbo E codin
letter, number, or symbol R
l n g
101001 r
l n g
111001
S 0
101001 s 0
111001
• Unicode: Increasingly popular 16- T 101010 t 111010
bit bit encoding L 0
100110 l 0
110110
• Encodes characters from various N 0
100111 n 0
110111
E 0
100010 e 0
110010
world languages
0 1
011000 9 1
011100
. 010111 ! 1
010000
<tab 000100 <sp ce 1
010000
> 1 a > 0

Question:
What does this ASCII bit sequence
represent?
1010010 1000101 1010011 1010100

REST

12
How to Encode Numbers: Binary Numbers
• Each position represents a quantity;
symbol in position means how many of
that quantity
• Base ten (decimal)
• Ten symbols: 0, 1, 2, ..., 8, and 9 5 2 3
• More than 9 -- next position
• So each position power of 10 1 4 1 3 1 2 1 1 1 0
0 0 0 0 0
• Nothing special about base 10 -- used because
we have 10 fingers
• Base two (binary)
• Two symbols: 0 and 1
• More than 1 -- next position
• So each position power of 2
1 0 1 Q: How
24 23 22 21 20 + =
much?
a

4+ 1= 5

13
How to Encode Numbers: Binary Numbers
• Working with binary numbers
• In base ten, helps to know powers of 10
• one, ten, hundred, thousand, ten thousand, ...
29 28 27 26 25 24 23 22 21 20
• In base two, helps to know powers of 2
• one, two, four, eight, sixteen, thirty two, sixty
four, one hundred twenty eight 51 25 12 6 3 1 8 4 2 1
• (Note: unlike base ten, we don’t have common 2 6 8 4 2 6
names, like “thousand,” for each position in
base ten -- so we use the base ten name)
• Q: count up by powers of two

51 25 12 6 3 1 8 4 2 1 a

2 6 8 4 2 6

14
Converting from Decimal to Binary Numbers: Subtraction
Method (Easy for Humans)

• Goal
• Get the binary weights to add up to the
Desired decimal number: 12
decimal quantity
• Work from left to right 3 1 8 4 2 1
2 6
• (Right to left – may fill in 1s that shouldn’t have
1 =32
been there – try it). too
3 1 8 4 2 1
2 6 much
0 1 =16
3 1 8 4 2 1 too
2 6 much a

0 0 1 =8
3 1 8 4 2 1 ok, keep
2 6 going

0 0 1 1 =8+4=1
3 1 8 4 2 1 2
2 6 DONE
0 0 1 1 0 0 answe
3 1 8 4 2 1
2 6 r
15
Converting from Decimal to Binary Numbers: Subtraction
Method (Easy for Humans)

• Subtraction method
• To make the job easier (especially for big
Remaining quantity: 12
numbers), we can just subtract a selected
binary weight from the (remaining) quantity 3 1 8 4 2 1
• Then, we have a new remaining quantity, and 2 6
we start again (from the present binary position)
1 32 is
too
3 1 8 4 2 1
• Stop when remaining quantity is 0 much
2 6
0 1 16 is
too
3 1 8 4 2 1
much
2 6 a

0 0 1 12 – 8 =
3 1 8 4 2 1 4
2 6
0 0 1 1 4-4=0
3 1 8 4 2 1 DONE
2 6
0 0 1 1 0 0 answe
3 1 8 4 2 1
2 6 r
16
Converting from Decimal to Binary Numbers:
Subtraction Method Example
• Q: Convert the number “23” from decimal to binary
A: Remaining quantity Binary Number
23 0 0 0 0 0 0
32 16 8 4 2 1

23 0 1 0 0 0 0
-16 32 16 8 4 2 1
a
7

7 0 1 0 1 0 0
-4 32 16 8 4 2 1
3 8 is more than 7, can’t use

4 0 1 0 1 1 0
-2 32 16 8 4 2 1
1

1 0 1 0 1 1 1
-1 32 16 8 4 2 1
0
Done! 23 in decimal is 10111 in binary.
17
Converting from Decimal to Binary Numbers: Division
Method (Good for Computers)
• Divide decimal number by 2 and insert remainder into new binary number.
• Continue dividing quotient by 2 until the quotient is 0.
• Example: Convert decimal number 12 to binary

Decimal Number Binary Number


6
2 12 divide by 2 0
-12 1
0
insert remainder

Continue dividing since quotient (6) is greater than 0


3
2 6 divide by 2 0 0
-6 2 1
0
insert remainder
Continue dividing since quotient (3) is greater than 0
18
Converting from Decimal to Binary Numbers: Division
Method (Good for Computers)
• Example: Convert decimal number 12 to binary (continued)

Decimal Number Binary Number


1 1 0 0
2 3 divide by 2 4 2 1
-2
1
insert remainder

Continue dividing since quotient (1) is greater than 0


0 1 1 0 0
2 1 divide by 2 8 4 2 1
-0
1
insert remainder

Since quotient is 0, we can conclude that 12 is 1100 in binary

19
Base Sixteen: Another Base Sometimes
Used by Digital Designers
8 A F • Nice because each position represents four
1 4 1 3 1 2 1 1 1 0 base two positions
6 6 6
8
6
A
6
F • Used as compact means to write binary
numbers
100 101 1111
0 0 • Known as hexadecimal, or just hex
hex bin ry hex bin ry
a a
0 000 8 100
1 0
000 9 0
100
2 1
001 A 1
101
3 0
001 B 0
101
4 1
010 C 1
110
5 0
010 D 0
110 Q: Write 11110000 in hex
6 1
011 E 1
111
7 0
011 F 0
1111
1 F0 a

20
1.3
Implementing Digital Systems: Programming
Microprocessors Vs. Designing Digital Circuits
Programmed Custom designed
Desired motion-at-night detector • Microprocessors a
microprocessor digital circuit common choice to
implement a digital
system
• Easy to program
• Cheap (as low as $1)
• Available now

MI0 P void main() 1


ro
ro I1 P
0 { a
0
c I2 P
1 while (1) {
p I3 P
2 b
1
P0 = I0 && !I1; 0
I4 P
3 // F = a and !b,
I5 P
4 1
I6 P } F
5 0
I7 P
6 }
7 6:0 7:0 7:0 9:0 9:0 tim
0 5 6 0 1 e

21
Digital Design: When Microprocessors Aren’t Good Enough
• With microprocessors so easy, Q: How long for each
cheap, and available, why design a Image
Sensor
Micro- implementation option?
digital circuit? processo
r
• Microprocessor may be too slow (a) (Read, 5+8+1
Compress
• Or too big, power hungry, or costly Memor , =14
y and Store) sec
Image Sensor Read Compres
circui s
t circuit
.1+.5+.
Sample digital camera task execution times (in
(b) 8
seconds) on a microprocessor versus a digital
circuit: Memor
Store =1.4 sec a

circui
y
t
Task Microprocesso Custom
r Digital Circuit Image Sensor Read Compres
Read 5 0.1 circui s
t circuit .1+.5+1
Compres 8 0.5 (c) =1.6
s Microprocessor
Memory (Store) secGood
Store 1 0.8
compromise

22
Chapter Summary

• Digital systems surround us


• Inside computers
• Inside huge variety of other electronic devices (embedded systems)
• Digital systems use 0s and 1s
• Encoding analog signals to digital can provide many benefits
• e.g., audio -- higher-quality storage/transmission, compression, etc.
• Encoding integers as 0s and 1s: Binary numbers
• Microprocessors (themselves digital) can implement many digital
systems easily and inexpensively
• But often not good enough -- need custom digital circuits

23

You might also like