CPE 344
Digital System Design
Dr. Muhammad Naeem Awais
Room # 8, B-Block
COMSATS University Islamabad, Lahore Campus
Wednesday, September 3, 2025 CPE 344- Digital System Design 1
About the Course
1 Course Title Digital System Design
2 Course Code CPE344
3 Credit Hours 4 (3,1)
4 Prerequisites Digital Logic Design
5 Semester Fall 2025
6 Resource Person/Lab Dr. Muhammad Naeem Awais/Engr.
Engineer Mr. Moazzam Ali Sahi
7 Contact Hours (Theory) 3 hours per week
8 Contact Hours (Lab) 3 hours per week
9 Office Hours 08:30 - 16:30 (weekdays)
Wednesday, September 3, 2025 CPE 344- Digital System Design 2
CPE-344 Digital System Design
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 Tradeoffs
7. Programmable Logic Arrays (PAL), Programmable Arrays Logic
(PLA)
8. Physical Implementation
3
Course learning Outcomes
Theory CLOs:
• Design of advanced combinational and sequential logic-based systems using the
classical principles of digital logic design. (C5-PLO3)
• Design of digital systems in a hierarchical and top-down manner using register-
transfer level (RTL) approach and circuits to optimize their performance and
ensure reliability, integrating techniques like concurrency and trade-offs in the
physical implementation using RTL design. (C5-PLO3)
Lab CLOs:
• Design the digital systems based on HDL modeling techniques using VHDL. (C5-
PLO3)
• Reproduce the response of the designed digital systems using the software tool
and hardware platform. (P3-PLO5)
• Demonstrate proficiency in FPGA architecture and design flow for system
synthesis and optimization while showing strong communication skills in
preparing reports for complex engineering challenges. (A3-PLO10)
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.
[Link]
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 [Link] for information. 5
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 items
What Does “Digital” Mean?
• Analog signal • Digital signal
• Infinite possible values • Finite possible values
• Ex: voltage on a wire created by • Ex: button pressed on a keypad
microphone
1 2 3 4
2
digital
signal
analog
signal Possible values:
0, 1, 2, 3, or 4.
Possible values: That’s it.
1.00, 1.01, 2.0000009, 4
value
value
... infinite possibilities 3
2
1
0
time time
7
Digital Signals with Only Two Values: Binary
• Binary digital signal -- only two possible values
• Typically represented as 0 and 1
value
• One binary digit is a bit
• We’ll only consider binary digital signals 1
• Binary is popular because 0
• Transistors, the basic digital electric component, operate time
using two voltages (more in Ch. 2)
• 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
lengthy transmission
Volts
(e.g, cell phone)
lose quality 3 3
• Voltage levels not 2 2
saved/copied/transmitted original signal 1 received signal
1
perfectly 0
0
• Digitized version enables near- time time
perfect save/cpy/trn. 01 10 11 10 11
How fix -- higher, lower, ?
• “Sample” voltage at particular
lengthy transmission
(e.g, cell phone)
rate, save sample using bit a2d
Volts
a
encoding
• Voltage levels still not kept 1 digitized signal 1
perfectly 0
• But we can distinguish 0s from 0
1s time time
Can fix -- easily distinguish 0s
Let bit encoding be: 01 10 11 10 11 and 1s, restore
1 V: “01” Digitized signal not d2a
2 V: “10” perfect re-creation,
Volts
3
3 V: “11” but higher sampling
rate and more bits per 2
encoding brings closer. 1
0 time 9
Digitized Audio: Compression Benefit
• Digitized audio can be Example compression scheme:
compressed 00 --> 0000000000
• e.g., MP3s 01 --> 1111111111
• A CD can hold about 20 songs 1X --> X
uncompressed, but about 200
compressed
0000000000 0000000000 0000001111 1111111111
• Compression also done on
digitized pictures (jpeg), 00 00 10000001111 01
movies (mpeg), and more
• Digitization has many other
benefits too
10
How Do We Encode Data as Binary for Our Digital
System?
a
analog button
phenomena • Some inputs inherently binary
0 1
• Button: not pressed (0), pressed
sensors and
other inputs (1) red blue green black
electric
signal
digital • Some inputs inherently digital 0 0 0
data
• Just need encoding in binary
A2D red blue green black
digital • e.g., multi-button input: encode
data red=001, blue=010, ... 0 0 1
Digital System • Some inputs analog red blue green black
• Need analog-to-digital
digital digital
data data conversion 0 1 0
air 33
D2A • As done in earlier slide -- sample degrees
electric and encode with bits
signal temperature
actuators and sensor
other outputs
0 0 1 0 0 0 0 1
11
Number Systems
• Decimal
• Binary
• Octal
• Hexadecimal
Number Representation
• Numbers
Integer (Fixed Point) Numbers
Unsigned
Signed
Real (Floating Point) Numbers
Unsigned
Signed
Signed Number Representation
• Negative numbers are represented as
One’s complement
Two’s complement
Sign-Magnitude
How to Encode Text: ASCII, Unicode
• ASCII: 7- (or 8-) bit encoding of each Symbol Encoding Symbol Encoding
letter, number, or symbol R 1010010 r 1110010
• Unicode: Increasingly popular 16- S
T
1010011
1010100
s
t
1110011
1110100
bit bit encoding L 1001100 l 1101100
• Encodes characters from various N 1001110 n 1101110
world languages E 1000101 e 1100101
0 0110000 9 0111001
. 0101110 ! 0100001
<tab> 0001001 <space> 0100000
Question:
What does this ASCII bit sequence represent?
1010010 1000101 1010011 1010100
REST
15
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 104 103 102 101 100
• 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 much?
24 23 22 21 20 + =
a
4+ 1= 5
16
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 512 256 128 64 32 16 8 4 2 1
• (Note: unlike base ten, we don’t have common
names, like “thousand,” for each position in
base ten -- so we use the base ten name)
• Q: count up by powers of two
512 256 128 64 32 16 8 4 2 1 a
17
Converting from Decimal to Binary Numbers:
Subtraction Method (Easy for Humans)
• Goal
Desired decimal number: 12
• Get the binary weights to add up to the
decimal quantity
• Work from left to right 32 16 8 4 2 1
• (Right to left – may fill in 1s that shouldn’t have 1 =32
been there – try it). too much
32 16 8 4 2 1
0 1 =16
32 16 8 4 2 1 too much
a
0 0 1 =8
32 16 8 4 2 1 ok, keep going
0 0 1 1 =8+4=12
32 16 8 4 2 1 DONE
0 0 1 1 0 0 answer
32 16 8 4 2 1
18
Converting from Decimal to Binary Numbers:
Subtraction Method (Easy for Humans)
• Subtraction method
Remaining quantity: 12
• To make the job easier (especially for big
numbers), we can just subtract a selected
binary weight from the (remaining) quantity 32 16 8 4 2 1
• Then, we have a new remaining quantity, and 1 32 is
we start again (from the present binary position) too much
32 16 8 4 2 1
• Stop when remaining quantity is 0
0 1 16 is
too much
32 16 8 4 2 1
a
0 0 1 12 – 8 = 4
32 16 8 4 2 1
0 0 1 1 4-4=0
32 16 8 4 2 1 DONE
0 0 1 1 0 0 answer
32 16 8 4 2 1
19
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.
20
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
21
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
22
Base Sixteen: Another Base Sometimes Used
by Digital Designers
8 A F • Nice because each position represents four
164 163 162 161 160 base two positions
8 A F • Used as compact means to write binary
numbers
1000 1010 1111
• Known as hexadecimal, or just hex
h ex bina r y h ex bina r y
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101 Q: Write 11110000 in hex
6 0110 E 1110
7 0111 F 1111
F0 a
23
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 P0 void main() 1
rop
ro I1 P1 { a
0
c I2 P2 while (1) { 1
I3 P3 P0 = I0 && !I1; b
I4 P4 0
// F = a and !b,
I5 P5 1
I6 P6 } F
0
I7 P7 }
6:00 [Link] [Link] time
24
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?
processor
digital circuit?
• Microprocessor may be too slow (a) (Read, 5+8+1
Compress,
• Or too big, power hungry, or costly Memory and Store) =14 sec
Image Sensor Read Compress
circuit circuit
.1+.5+.8
Sample digital camera task execution times (in
(b) =1.4 sec
seconds) on a microprocessor versus a digital
Store a
circuit: Memory
circuit
Task Microprocessor Custom
Digital Circuit Image Sensor Read Compress
circuit circuit
Read 5 0.1 .1+.5+1
Compress 8 0.5 (c) =1.6 sec
Microprocessor
Store 1 0.8 Memory (Store) Good
compromise
25
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
26