Beruflich Dokumente
Kultur Dokumente
Serdar Kozat
College of Engineering
Ko University,Istanbul,Turkey
skozat@ku.edu.tr
KU College of Engineering 1
Lecture 1 Elec 204: Digital Systems Design
Elec 204: Digital Systems Design
KU College of Engineering 2
Elec 204: Digital Systems Design
Course Objectives:
ELEC204 is a course targeting electrical and computer
engineering students to build the fundamental digital
design and experimentation concepts.
In this course we will study
combinational logic circuit design techniques, sequential logic
circuits, registers and counters, memory, and state machines.
In parallel to lectures we will develop experimental
skills studying various digital design techniques during
our laboratory hours.
Our experimental setup will be based on Field Programmable
Gate Array (FPGA) structure, and we'll experience various
design tools.
KU College of Engineering 3
Elec 204: Digital Systems Design
Grading:
Lecture Part:
In class quizes (20%), midterm exam (35%), final exam (45%).
Lab Work Part:
Bi-weekly lab assignments (50%), lab midterm (20%), lab project (30%).
Elec 204 is a 4-credit course with the lecture part having 3 credits and the lab
work part having 1 credit. The lecture and lab work parts of the Elec 204 will
be graded separately. A passing final letter grade requires passing grades
from both the lecture and lab work parts. The lecture and lab work letter
grades will be combined (3 credits for the lecture and 1 credit for the lab work)
for the final letter grade.
Lab Work:
We have two hours assigned each week to perform our experimental work in
digital design lab. However student should do their preliminary study on their
lab assignments before hand so they can complete the experimental work
during the assigned lab hours. After completing the fundamental experiments
in the first half of the semester, each student will be required to pick a term
digital design project. Possible design projects will be announced by the
instructor. Students must attend all Lab works, missing 1/3 of the Lab work
will yield a fail grade for the Elec-204 course.
Web page: http://courses.eng.ku.edu.tr/elec204/
KU College of Engineering 4
Elec 204: Digital Systems Design
Academic Dishonesty
The students taking this course are expected to submit their own
work in all midterms, projects, homeworks and in class
quizes. Please be aware that, being a part of a dishonest plot
intentionally (for example, helping others cheat, doing others'
homeworks or lab work, giving your reports to others) will also be
considered as cheating. Disciplinary acts will be taken for the
students who are involved in academic dishonesties, and they will
not be offered any voluntary compensation.
Lecture Regulations
Students should attend all lectures. There will not be any form of
make-ups for in-class quizes.
Students who are late more than 15 minutes will not take in-class
quizes.
Disruptive talking, cell phone use, walking in&out during the
lecture, eating&drinking and any kind of distraction to the lecture
will not be allowed during the lecture.
KU College of Engineering 5
Elec 204: Digital Systems Design
ELEC204
Spring 2007 Calendar
M T W T F
KU College of Engineering 6
Elec 204: Digital Systems Design
0. Introduction
Analog vs Digital
Analog devices: process time varying signals that can
take on any value across a continuous range of
voltage, current or another metric.
Digital devices: so do they! But we can pretend that
they dont!!
Digital signal model: two discrete values 0 or 1,
(LOW/HIGH, FALSE/TRUE, negated/asserted, etc)
They have been around since 1940s and in
commercial use since 1960s.
KU College of Engineering 7
Elec 204: Digital Systems Design
One-analog gone digital systems:
Still pictures
Audio/Video recordings
Automobile carburetors
Telephone system
Advantages of digital systems:
Reproducibility of results
Ease of design (Logic design vs complex characteristics
of capacitors, transistors, etc)
Flexibility and functionality (eg: scrambling code)
Programmability: Digital design is carried out today
with Hardware Description Languages (HDLs). HDL
also comes with simulation and synthesis tools.
KU College of Engineering 8
Elec 204: Digital Systems Design
Advantages of digital systems:
Speed: todays digital devices are fast. Switch in less
than 10 picoseconds (10-12). Note: in vacuum light
travels ~1cm in 33 ps, the speed of light delay between
transistors has became a limiting factor.
Economy: Lots of functionality in a small space
Steadily advancing technology: you should consider
that in a few years there will be a faster, a cheaper or
otherwise a better technology.
KU College of Engineering 9
Elec 204: Digital Systems Design
Digital Computer
Memory: stores programs, i/o data
Datapath: perform arithmetic and
other data-processing operations
Control Unit: supervises the flow of
information
I/O: places program into memory
CPU: executes program from memory
instruction by instruction. Control
unit manipulates datapath to execute
instructions.
Processor: contains CPU, FPU and MMU
FPU (Floating Point Unit) : perform f-p operations
MMU (Memory Management Unit): layers of memory that helps
instruction fetching and data I/O. Internal/external cache (very fast),
RAM (between disk and cache)
KU College of Engineering 10
Elec 204: Digital Systems Design
Digital Devices
KU College of Engineering 11
Elec 204: Digital Systems Design
Flip-flop: stores either 0 or 1, the states can be
changed only at certain times determined by a
clock input
Combinational circuits: contain only AND, OR
and NOT gates
Sequential circuits: contain gates and flip-flops
The output depends on not only inputs but also the past
sequence of inputs that have been applied to it.
KU College of Engineering 12
Elec 204: Digital Systems Design
Electronic Aspects
KU College of Engineering 13
Elec 204: Digital Systems Design
Software Aspects
In computer-aided design (CAD) various tools are
available today to improve productivity,
correctness and the quality of designs.
Ways of digital design in CAD:
Schematic entry: schematic diagrams to be drawn on
screen.
HDLs : Hardware description languages
Simulators: debug and check
KU College of Engineering 14
Elec 204: Digital Systems Design
Integrated Circuits
IC: a collection of one or more gates fabricated on
a single silicon chip
Small-scale integration (SSI) 1-20 gates
Medium-scale integration (MSI) 20-200 gates
Typically contain a functional building block, such as encoder,
counter,
Large-scale integration (LSI) 200-200,000 gates
Include memories, microprocessors, etc.
Very large-scale integration (VLSI)
Ics with over 1,000,000 transistors
KU College of Engineering 15
Elec 204: Digital Systems Design
Programmable Logic Devices
ICs that can have their logic function programmed into
them after they are manufactured.
Digital Design Levels
A simple design example: two input multiplexer
A
Z
B
S
KU College of Engineering 16
Elec 204: Digital Systems Design
Truth table: S A B Z
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
KU College of Engineering 17
Elec 204: Digital Systems Design
Gate level logic diagram (schematic):
A
Z
S
KU College of Engineering 18
Elec 204: Digital Systems Design
HDL Program:
KU College of Engineering 19
Elec 204: Digital Systems Design
1. Digital Information: Number Systems
MSB LSB
D i
d r
i n
i
KU College of Engineering 20
Elec 204: Digital Systems Design
Octal and Hexadecimal Numbers
Base 8 and 16 provide convenient shorthand
representation for multi-bit numbers in a digital
system.
Octal digit 3-bit string (0-7)
Hexadecimal digit 4-bit string (0-9, A-F)
1000110011102 = 43168 = 8CE16
10.10110010112 = 010.101 100 101 1002 = 2.54548
= 0010.1011 0010 11002 = 2.B2C16
In hexadecimal systems 2 digits represent an 8-bit byte.
KU College of Engineering 21
Elec 204: Digital Systems Design
Positional Number System Conversions
Base-r-to-decimal conversions:
p 1
r: base/radix
D d r
i n
i
i
KU College of Engineering 22
Elec 204: Digital Systems Design
Decimal-to-base-r conversion:
179 / 2 = 89 remainder 1 (LSB)
/ 2 = 44 rem 1
/ 2 = 22 rem 0
/ 2 = 11 rem 0
/ 2 = 5 rem 1
/ 2 = 2 rem 1
/ 2 = 1 rem 0
/ 2 = 0 rem 1 (MSB)
Hence, 17910 = 101100112
KU College of Engineering 23
Elec 204: Digital Systems Design
Addition and Subtraction of Nondecimal
Numbers
Cin/bin X Y Cout S Bout D
Addition 0 0 0 0 0 0 0
0 0 1 0 1 1 1
101111000 0 1 0 0 1 0 1
X 190 10111110 0 1 1 1 0 0 0
1 0 0 0 1 1 1
Y 141 10001101 1 0 1 1 0 1 0
___+______________ 1 1 0 1 0 0 0
1 1 1 1 1 1 1
X+Y 331 101001011
KU College of Engineering 24
Elec 204: Digital Systems Design
Binary subtraction: (borrow, difference bits)
Bout 001111100
Minuend X 229 11100101
Subtrahend Y 46 00101110
_____________-_________________
Difference X-Y 183 10110111
KU College of Engineering 25
Elec 204: Digital Systems Design
Lecture 2
Signed-Magnitude System/Representation:
MSB: sign bit, 0: plus, 1: minus
010101012 = +8510 110101012 = -8510
011111112 = +12710 111111112 = -12710
000000002 = +010 100000002 = -010
n-bit signed integer lies within (2n-1-1) through +(2n-1-1)
with two representations of zero.
KU College of Engineering 26
Elec 204: Digital Systems Design
Signed-magnitude adder
If signs are same
add magnitudes, sign is same
else
compare magnitudes
subtract smaller from the larger
sign is sign of larger
Signed-magnitude subtractor
Change the sign of subtrahend, perform addition
KU College of Engineering 27
Elec 204: Digital Systems Design
Complement Number Systems
Ones complement of D
-D = 2n - 1 D
1710 = 000100012
111011102 = -1710
KU College of Engineering 30
Elec 204: Digital Systems Design
Twos complement addition
0000
Subtract n (add n) 1111 0001
subt -1 0 1
Add 16-n -2 2 add
Surprisingly (?) 16-n is 4-bit 3
twos complement of n,
-7 -8 7 0111
that is (-n). 1001 1000
KU College of Engineering 31
Elec 204: Digital Systems Design
Twos complement subtraction
1 cin 1
+4 0100 0100 +3 0011 0011
- +3 0011 1100 - -4 1100 0011
+1 10001 +7 0111
Overflow
If the result exceeds the range of the number system
+5 0101
Overflow rule:
+ +6 0110 Addn: if the sign of the addends are same
+11 1011 = -5 and the sign of the sum is different from
addends sign.
KU College of Engineering 32
Elec 204: Digital Systems Design
Binary Multiplication
KU College of Engineering 34
Elec 204: Digital Systems Design
Binary division
KU College of Engineering 35
Elec 204: Digital Systems Design
BCD: Binary-Coded Decimal
0-9 encoded with their 4-bit unsigned binary representation
(0000 1001). The codewords (1010 1111) are not used.
8-bit byte represent values from 0 to 99.
BCD Addition:
Carry 1 1
448 0100 0100 1000
+ 489 0100 1000 1001
937 Sum 1001 1101 10001
Add 6 + 0110 + 0110
BCD sum 1 0011 1 0111
BCD result 1001 0011 0111
KU College of Engineering 36
Elec 204: Digital Systems Design