2013 digital sytem-1-lecture01
DESCRIPTION
This is basic in digital systemTRANSCRIPT
1
Digital Systems IDigital Systems I
Lecture 1
Introduction and Number Systems
2
SyllabusSyllabus
Text : David M. Harris and Sarah Harris,
Digital Design and Computer Architecture,
Elsevier, 2007
Coverage:
1. Basic Concepts (Chapter 1)
2. Combinational Logic Design (Chapter 2)
3. Sequential Logic Design (Chapter 3)
4. Digital Building Blocks (Chapter 5)
3
Course RequirementsCourse Requirements
• Class Participation– If you need to miss class, email me beforehand
• Assignments:– Problem sets (20%)
• Exams– Quizzes (20%)– Midterm (20%)– Final (40%)
• Late policy– No late assignments accepted
4
Why Study Digital Design?Why Study Digital Design?
• Look “under the hood” of computers– Solid understanding --> confidence,
insight
• Electronic devices becoming digital– Enables:
• Better devices: Better sound recorders, cameras, cars, cell phones, medical devices,...
• New devices: Video games, PDAs, ...– Known as “embedded systems”
• Thousands of new devices every year
• Designers needed: Potential career direction
5
Embedded SystemsEmbedded Systems
• Embedded computing systems– Computing systems embedded
within electronic devices– Hard to define. Nearly any
computing system other than a desktop computer
– Billions of units produced yearly, versus millions of desktop units
– Perhaps 50 per household and per automobile
Computers are in here...
and here...
and even here...
Lots more of these, though they cost a lot
less each.
6
Embedded System ExampleEmbedded System Example
Microcontroller
CCD preprocessor Pixel coprocessorA2D
D2A
JPEG codec
DMA controller
Memory controller ISA bus interface UART LCD ctrl
Display ctrl
Multiplier/Accum
Digital camera chip
lens
CCD
• Single-functioned -- always a digital camera• Tightly-constrained -- Low cost, low power, small, fast• Reactive and real-time -- only to a small extent
7
What Does “Digital” Mean?What Does “Digital” Mean?
• Analog signal
– Inifinite possible values• Ex: voltage on a wire
created by microphone
valu
e
time
valu
etime
microphone
Soundwaves
which movesthe magnet,
which createscurrent in the nearby wire
move themembrane,
analog signal
3 421
2 digital signal
• Digital signal– Finite possible values
• Ex: button pressed on a keypad
01234
Possible values:1.00, 1.01, 2.0000009, ... infinite possibilities
Possible values:0, 1, 2, 3, or 4.That’s it.
8
Binary Digital SignalsBinary Digital Signals
• Binary digital signal -- only two possible values– Typically represented as 0 and 1– One binary digit is a bit– We’ll only consider binary digital signals– Binary is popular because
• Transistors, the basic digital electric component, operate using two voltages
• Storing/transmitting one of two values is easier than three or more (e.g., loud beep or quiet beep, reflection or no reflection)
valu
e
time
10
9
SwitchesSwitches
10
Digitization BenefitDigitization Benefit
• Analog signal (e.g., audio) may lose quality
– Voltage levels not saved/copied/transmitted perfectly
• Digitized version enables near-perfect save/cpy/transmit.
– “Sample” voltage at particular rate, save sample using bit encoding
– Voltage levels still not kept perfectly
– But we can distinguish 0s from 1s
time
Vol
ts
01
2
3
original signal
leng
thy
tran
smis
sion
(e.g
, cel
l pho
ne)
time01
2
3
received signal
How fix -- higher, lower, ?
leng
thy
tran
smis
sion
(e.g
, cel
l pho
ne)
01 10 11 10 11
same
time
01 10 11 10 11
Vol
tsdigitized signal
time0
1
a2d
Vol
ts
01
2
3d2a
Let bit encoding be: 1 V: “01” 2 V: “10” 3 V: “11”
timeCan fix -- easily distinguish 0s
and 1s, restore
0
1
Digitized signal notperfect re-creation,but higher sampling rate and more bits per encoding brings closer.
a
11
Encoding Data as BinaryEncoding Data as Binary
• Some inputs inherently binary– Button: not pressed (0),
pressed (1)• Some inputs inherently
digital– Just need encoding in
binary– e.g., multi-button input:
encode red=001, blue=010, ...
• Some inputs analog– Need analog-to-digital
conversion– As done in earlier slide --
sample and encode with bits
0
button
green blackbluered
0 00
red
0 10
green blackblue
1 00
green blackbluered
temperaturesensor
air
0 0 1 10 0 0 0
33 degrees
a
sensors andother inputs
Digital System
actuators andother outputs
A2D
D2A
analogphenomena
electricsignal
digitaldata
digitaldata
electricsignal
digitaldata
digitaldata
12
Digital DesignDigital Design
General engineering principles for complex systems:– Abstraction– Discipline– The three -Y’s
• Hierarchy• Modularity• Regularity
13
AbstractionAbstraction
• Hiding details when they aren’t important
Physics
Devices
AnalogCircuits
DigitalCircuits
Logic
Micro-architecture
Architecture
OperatingSystems
ApplicationSoftware
electrons
transistorsdiodes
amplifiersfilters
AND gatesNOT gates
addersmemories
datapathscontrollers
instructionsregisters
device drivers
programs
14
DisciplineDiscipline
• Intentionally restricting your design choices (so that you can work more productively at a higher level of abstraction)
15
The Three -Y’sThe Three -Y’s
• Hierarchy– Dividing a system into modules and
submodules
• Modularity– Well-defined functions and interfaces
• Regularity– Uniformity, so modules can be easily reused
16
Digital AbstractionDigital Abstraction
• 1’s and 0’s
• bits: binary digit
17
Codes for Representing InformationCodes for Representing Information
18
Binary CodeBinary Code
19
• Decimal numbers
• Binary numbers
Number SystemsNumber Systems
537410 = 5 × 103 + 3 × 102 + 7 × 101 + 4 × 100
fivethousands
10's colum
n10
0's column
1000
's colu
mn
threehundreds
seventens
fourones
1's colu
mn
11012 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 1310oneeight
2's colu
mn
4's colu
mn
8's colu
mn
onefour
notwo
oneone
1's colu
mn
20
• Decimal to binary conversion:– Convert 101012 to decimal
• Decimal to binary conversion:– Convert 4710 to binary
Number ConversionNumber Conversion
21
Hexadecimal NumbersHexadecimal Numbers
Hex Digit Decimal Equivalent Binary Equivalent0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
22
• Hexadecimal to binary conversion:– Convert 4AF16 (0x4AF) to binary
• Hexadecimal to decimal conversion:– Convert 0x4AF to decimal
Number ConversionNumber Conversion
23
Bits, Bytes, Nibbles…Bits, Bytes, Nibbles…
• Bits
• Bytes & Nibbles
• Bytes
10010110nibble
byte
CEBF9AD7least
significantbyte
mostsignificant
byte
10010110least
significantbit
mostsignificant
bit
24
• Decimal
• Binary
AdditionAddition
37345168+8902
carries 11
10110011+1110
11 carries
25
• Add the following 4-bit binary numbers
• Add the following 4-bit binary numbers
Binary Addition ExamplesBinary Addition Examples
10010101+
10110110+
26
Signed Binary NumbersSigned Binary Numbers
• Sign and Magnitude:– 1 sign bit, N-1 magnitude bits
– Example: -5 = 11012
+5 = 01012
• Two’s Complement– Same as unsigned binary, but most
significant bit (msb) has value of -2N-1
– Most positive 4-bit number: 01112
– Most negative 4-bit number: 10002
27
““Taking the Two’s Complement”Taking the Two’s Complement”
• Reversing the sign of a two’s complement number
• Method:1. Invert the bits
2. Add 1
• Example: Reverse the sign of 01111. 1000
2. + 1
1001
28
Two’s Complement ExamplesTwo’s Complement Examples
• Take the two’s complement of 0101.
• Take the two’s complement of 1010.
29
Two’s Complement AdditionTwo’s Complement Addition
• Add 6 + (-6) using two’s complement numbers.
• Add -2 + 3 using two’s complement numbers.
+01101010
10000
111