1 digital design and computer architecture lecture 1 digital design and computer architecture harris...
Post on 22-Dec-2015
314 views
TRANSCRIPT
1
Digital Design and Computer Digital Design and Computer ArchitectureArchitecture
Lecture 1Digital Design and Computer Architecture
Harris & HarrisMorgan Kaufmann / Elsevier, 2007
2
LogisticsLogistics
• Handouts:– Syllabus, Lecture Notes
• Lab 1 posted on the website:– www.jlc.tcu.edu.tw
• Reading for next Monday (9/29:點名 )– 1.6-1.7, 1.9, 2.1-2.3
3
OverviewOverview
• More Logistics:– Course Objectives– Course Requirements– Schedule
• Digital Design– Managing Complexity– Number Systems– Logic Gates
4
Course ObjectivesCourse Objectives
• To become a competent digital designer• To learn to recognize and apply the principles of
abstraction, modularity, hierarchy, and regularity in digital design
• To hone your debugging skills by designing, building, and testing digital circuits
• To design, build, and test your own clock• To understand what’s under the hood of a
computer• To have fun while you’re doing it!
5
Course RequirementsCourse Requirements• Class Participation
– If you need to miss class, email me beforehand
• Assignments:– Weekly problem sets (10%), due Monday Morning– Semester labs (電子鐘 15% + 組合語言程式 15%)– Reading
• Exams– Midterm (25%)– Final (35%)
• Team policy for bi-weekly discussion– (75%個人成績 +25%團體成績 ) for Midterm and Final– Number of team member 5~6, – Bonus for participation: +3; – leader +5
6
SyllabusSyllabus• Read the syllabus!
7
Digital DesignDigital Design
General engineering principles for complex systems:– Abstraction– Discipline– The three -Y’s
• Hierarchy• Modularity• Regularity
8
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
9
DisciplineDiscipline
• Intentionally restricting your design choices (so that you can work more productively at a higher level of abstraction)
10
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
11
Digital AbstractionDigital Abstraction
• 1’s and 0’s
• bits: binary digit
12
• 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
13
• Decimal to binary conversion:– Convert 101012 to decimal
• Decimal to binary conversion:– Convert 4710 to binary
Number ConversionNumber Conversion
14
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
15
• Hexadecimal to binary conversion:– Convert 4AF16 (0x4AF) to binary
• Hexadecimal to decimal conversion:– Convert 0x4AF to decimal
Number ConversionNumber Conversion
16
Bits, Bytes, Nibbles…Bits, Bytes, Nibbles…
• Bits
• Bytes & Nibbles
• Bytes• (how they are put in memory?)
10010110nibble
byte
CEBF9AD7least
significantbyte
mostsignificant
byte
10010110least
significantbit
mostsignificant
bit
17
• Decimal
• Binary
AdditionAddition
37345168+8902
carries 11
10110011+1110
11 carries
18
• Add the following 4-bit binary numbers
• Add the following 4-bit binary numbers
Binary Addition ExamplesBinary Addition Examples
10010101+
10110110+
19
Signed Binary NumbersSigned Binary Numbers
• Sign and Magnitude:– 1 sign bit, N-1 magnitude bits
– Example: -5 = 11012
+5 = 01012
• Two’s Complement( why? )– 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
20
““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
21
Two’s Complement ExamplesTwo’s Complement Examples
• Take the two’s complement of 0101.
• Take the two’s complement of 1010.
22
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
23
Logic GatesLogic Gates
NOT
Y = A
A Y0 11 0
A Y
BUF
Y = A
A Y0 01 1
A Y
24
Two-Input Logic GatesTwo-Input Logic Gates
AND
Y = AB
A B Y0 0 00 1 01 0 01 1 1
AB
Y
OR
Y = A + B
A B Y0 0 00 1 11 0 11 1 1
AB
Y
25
More Two-Input Logic GatesMore Two-Input Logic Gates
XNOR
Y = A + B
A B Y0 00 11 01 1
AB
Y
XOR NAND NOR
Y = A + B Y = AB Y = A + B
A B Y0 0 00 1 11 0 11 1 0
A B Y0 0 10 1 11 0 11 1 0
A B Y0 0 10 1 01 0 01 1 0
AB
Y AB
Y AB
Y
26
Multiple-Input Logic GatesMultiple-Input Logic Gates
NOR3
Y = A+B+C
B C Y0 00 11 01 1
AB YC
A0000
0 00 11 01 1
1111
AND4
Y = ABCD
AB YCD
How about 4-input XOR?
27
Next TimeNext Time
• Beneath the digital abstraction
• Transistors
• Boolean algebra