DDCA Ch1
DDCA Ch1
DDCA Ch1
• Background
• The Game Plan
• The Art of Managing Complexity
• The Digital Abstraction
Digital Design and Computer Architecture
• Number Systems
David Money Harris and Sarah L. Harris
• Logic Gates
• Logic Levels
• CMOS Transistors
• Power Consumption
Copyright © 2007 Elsevier 1-<1> Copyright © 2007 Elsevier 1-<2>
• Microprocessors have revolutionized our world • The purpose of this course is that you:
– Cell phones, Internet, rapid advances in medicine, etc. – Learn what’s under the hood of a computer
• The semiconductor industry has grown from $21 – Learn the principles of digital design
billion in 1985 to $213 billion in 2004 – Design and build a microprocessor
1
The Art of Managing Complexity Abstraction
Application
• Abstraction • Hiding details when Software
programs
Analog amplifiers
Circuits filters
transistors
Devices
diodes
Physics electrons
2
Example: Flintlock Rifle Example: Flintlock Rifle
• Hierarchy • Modularity
– Three main modules: – Function of stock:
lock, stock, and mount barrel and
barrel lock
– Submodules of lock: – Interface of stock:
hammer, flint, length and location
frizzen, etc. of mounting pins
• Regularity
– Interchangeable
parts
Copyright © 2007 Elsevier 1-<9> Copyright © 2007 Elsevier 1-<10>
3
Digital Discipline: Binary Values George Boole, 1815 - 1864
• Typically consider only two discrete values: • Born to working class parents
– 1’s and 0’s • Taught himself mathematics and
– 1, TRUE, HIGH joined the faculty of Queen’s
College in Ireland.
– 0, FALSE, LOW
• Wrote An Investigation of the Laws
• 1 and 0 can be represented by specific voltage of Thought (1854)
levels, rotating gears, fluid levels, etc. • Introduced binary variables
• Digital circuits usually depend on specific voltage • Introduced the three fundamental
levels to represent 1 and 0 logic operations: AND, OR, and
NOT.
• Bit: Binary digit
• Decimal numbers • 20 = • 28 =
• 21 = • 29 =
1000's column
10's column
1's column
100's column
• 22 = • 210 =
537410 = • 23 = • 211 =
• 24 = • 212 =
• Binary numbers
• 25 = • 213 =
8's column
2's column
1's column
4's column
• 26 = • 214 =
11012 = • 27 = • 215 =
4
Number Conversion Binary Values and Range
5
Hexadecimal to Binary Conversion Bits, Bytes, Nibbles…
byte
• Bytes & Nibbles
10010110
• Hexadecimal to decimal conversion: nibble
– Convert 0x4AF to decimal
• Bytes CEBF9AD7
most least
significant significant
byte byte
Copyright © 2007 Elsevier 1-<25> Copyright © 2007 Elsevier 1-<27>
6
Addition Binary Addition Examples
• Binary 11 carries
1011
• Add the following 1011
+ 0011 4-bit binary + 0110
1110 numbers
7
Sign/Magnitude Numbers Sign/Magnitude Numbers
• Don’t have same problems as sign/magnitude • Same as unsigned binary, but the most
numbers: significant bit (msb) has value of -2N-1
– Addition works n −2
i =0
• Most positive 4-bit number:
• Most negative 4-bit number:
• The most significant bit still indicates the sign
(1 = negative, 0 = positive)
• Range of an N-bit two’s comp number:
Copyright © 2007 Elsevier 1-<39> Copyright © 2007 Elsevier 1-<40>
8
“Taking the Two’s Complement” Two’s Complement Examples
• Flip the sign of a two’s complement number • Take the two’s complement of 610 = 01102
• Method:
1. Invert the bits
2. Add 1
• Example: Flip the sign of 310 = 00112
• What is the decimal value of 10012?
• Add 6 + (-6) using two’s complement • A value can be extended from N bits to M bits
numbers (where M > N) by using:
– Sign-extension
0110 – Zero-extension
+ 1010
9
Sign-Extension Number System Comparison
• Sign bit is copied into most significant bits. Number System Range
Unsigned [0, 2N-1]
• Number value remains the same.
Sign/Magnitude [-(2N-1-1), 2N-1-1]
Two’s Complement [-2N-1, 2N-1-1]
• Example 1:
– 4-bit representation of 3 = 0011 For example, 4-bit representation:
– 8-bit sign-extended value: 00000011 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
• Example 2: Unsigned 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
10
Two-Input Logic Gates More Two-Input Logic Gates
Y = AB Y=A+B A B Y A B Y A B Y A B Y
0 0 0 0 0 1 0 0 1 0 0
A B Y A B Y 0 1 1 0 1 1 0 1 0 0 1
0 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0
0 1 1 1 1 0 1 1 0 1 1 0 1 1
0 1 0
1 0 0 1 0 1
1 1 1 1 1 1
11
Logic Levels The Static Discipline
• Define a range of voltages to represent 1 and 0 • Given logically valid inputs, every circuit
• Define different ranges for outputs and inputs to element must produce logically valid outputs
allow for noise in the system
• Noise is anything that degrades the signal • Discipline ourselves to use limited ranges of
• For example, a gate (driver) could output a 5 voltages to represent discrete values
volt signal but, because of losses in the wire and
other noise, the signal could arrive at the
receiver with a degraded value, for example, 4.5
volts Noise
Driver Receiver
12
DC Transfer Characteristics DC Transfer Characteristics
13
Transistors Robert Noyce, 1927 - 1990
• Logic gates are usually built out of transistors • Nicknamed “Mayor of Silicon
• Transistor is a three-ported voltage-controlled switch Valley”
– Two of the ports are connected depending on the voltage • Cofounded Fairchild
on the third port
Semiconductor in 1957
– For example, in the switch below the two terminals (d and
s) are connected (ON) only when the third terminal (g) is 1 • Cofounded Intel in 1968
g=0 g=1
• Co-invented the integrated circuit
d d d
g OFF ON
s s s
Copyright © 2007 Elsevier 1-<69> Copyright © 2007 Elsevier 1-<70>
• Transistors are built out of silicon, a semiconductor • Metal oxide silicon (MOS) transistors:
• Pure silicon is a poor conductor (no free charges) – Polysilicon (used to be metal) gate
• Doped silicon is a good conductor (free charges) – Oxide (silicon dioxide) insulator
– n-type (free negative charges, electrons) – Doped silicon
source gate drain
– p-type (free positive charges, holes) Polysilicon
Free electron Free hole SiO2
Si Si Si Si Si Si Si Si Si
- +
n n
+ -
Si Si Si Si As Si Si B Si
p substrate
Si Si Si Si Si Si Si Si Si
gate
14
Transistors: nMOS Transistors: pMOS
+++++++
------- p p
n n n n
channel n
p p substrate
substrate substrate
source drain
Copyright © 2007 Elsevier 1-<73> Copyright © 2007 Elsevier 1-<74>
15
CMOS Gates: NOT Gate CMOS Gates: NAND Gate
nMOS
pull-down
network
16
Other CMOS Gates Transmission Gates
How do you build a two-input AND gate? • nMOS pass 1’s poorly
EN
• pMOS pass 0’s poorly
• Transmission gate is a better switch A B
– passes both 0 and 1 well
• When EN = 1, the switch is ON: EN
– EN = 0 and A is connected to B
• When EN = 0, the switch is OFF:
– A is not connected to B
17
Gordon Moore, 1929 - Moore’s Law
• Cofounded Intel in
1968 with Robert
Noyce.
• Moore’s Law: the
number of transistors
on a computer chip
doubles every year
(observed in 1965)
• “If the automobile had followed the same development cycle as
• Since 1975, transistor the computer, a Rolls-Royce would today cost $100, get one
counts have doubled million miles to the gallon, and explode once a year . . .”
every two years. – Robert Cringley
Copyright © 2007 Elsevier 1-<89> Copyright © 2007 Elsevier 1-<90>
• Power = Energy consumed per unit time • Power to charge transistor gate capacitances
• Two types of power consumption: • The energy required to charge a capacitance, C, to
– Dynamic power consumption VDD is CVDD2
– Static power consumption • If the circuit is running at frequency f, and all
transistors switch (from 1 to 0 or vice versa) at
that frequency, the capacitor is charged f/2 times
per second (discharging from 1 to 0 is free).
• Thus, the total dynamic power consumption is:
Pdynamic = ½CVDD2f
18
Static Power Consumption Power Consumption Example
• Power consumed when no gates are switching • Estimate the power consumption of a wireless
• It is caused by the quiescent supply current, IDD, handheld computer
also called the leakage current – VDD = 1.2 V
• Thus, the total static power consumption is: – C = 20 nF
– f = 1 GHz
Pstatic = IDDVDD – IDD = 20 mA
19