SlideShare a Scribd company logo
1 of 56
Download to read offline
Number Systems
Decimal (base 10) {0 1 2 3 4 5 6 7 8 9}
o Place value gives a logarithmic representation
of the number
o Ex. 4378 means
 4 X 103 = 4000
 3 X 102 = 300
 7 X 101 = 70
 8 X 100 = 8
o The place also gives the exponent of the base
Example
• 432,600
4 3 2 6 0 0
105
104
103
100
101
102
Powers of ten:
100 = 1 102 = 100 104 = 10000
101 = 10 103 = 1000 105 = 100000
Binary (base 2) {0 1}
Binary Decimal
0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
1001 9
1010 10
Example
1 1 0 1 1 0 0 1
27
26
25
20
21
22
24 23
Decimal Equivalent
 1101 1001
1 X 27 = 128
+ 1 X 26 = 64
+ 0 X 25 = 0
+ 1 X 24 = 16
+ 1 X 23 = 8
+ 0 X 22 = 0
+ 0 X 21 = 0
+ 1 X 20 = 1
217
Notice how powers of two
stand out:
20 = 1
21 = 10
22 = 100
23 = 1000
Decimal to Binary Conversion
 Ex. 575
o Find the largest power of two less than the number
o 29 = 512
o Subtract that power of two from the number
o 575 – 512 = 63
o Repeat steps 1 and 2 for the new result until you reach zero.
o 25 = 32 63 – 32 = 31
o 24 = 16 31 – 16 = 15
o 23 = 8 15 – 8 = 7
o 22 = 4 7 – 4 = 3
o 21 = 2 3 – 2 = 1
o 20 = 1 1 – 1 = 0
o Construct the number
o 1000111111
Another Example
144
o 27 = 128 144 – 128 = 16
o 24 = 16 16 – 16 = 0
Result 10010000
Hexadecimal (base 16)
 {0 1 2 3 4 5 6 7 8 9 A B C D E F}
 Assignments Dec Hex Dec Hex
0 0 8 8
1 1 9 9
2 2 10 A
3 3 11 B
4 4 12 C
5 5 13 D
6 6 14 E
7 7 15 F
Example
163
162
160
161
3 B 6 E
3 X 163 = 12288
11 X 162 = 2816
6 X 161 = 96
14 X 160 = 14
 15214
Hexadecimal is Convenient for
Binary Conversion
Binary Hex Binary Hex
0 0 1001 9
1 1 1010 A
10 2 1011 B
11 3 1100 C
100 4 1101 D
101 5 1110 E
110 6 1111 F
111 7 1 0000 10
1000 8  Nibble
Binary to Hex Conversion
 Group binary number by fours (nibbles)
o 1101 1001 0110
 Convert each nibble into hex equivalent
o 1101 1001 0110
D 9 6
Decimal to Hex Conversion
 Ex. 284
o 162 = 256 284 – 256 = 28
o 161 = 16 28 - 16 = 12 (Hex C)
o Result 1 1 C
Another Example with an Extension
 1054
o 162 = 256
 But we have several multiples of 256 in 1054
o 1054/256 = 4.12 take integer part
o This eliminates 4*256 = 1024
 1054 – 1024 = 30
o 161 = 16 30 – 16 = 14 (Hex E)
o Result 4 1 E
Truth Table
Binary Decimal Hexadecimal
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Truth Table
Binary Decimal Hexadecimal
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
1000 8 8
1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F
Sexagesimal
(Base 60)
Practice
Convert 212 decimal to binary
o 212 – 27 = 84
o 84 – 26 = 20
o 20 – 24 = 4
o 4 – 22 = 0
o Result: 1101 0100
More Practice
Convert 1101 0010 binary to hex
o 0010 = 2
o 1101 = 13 = D
o Result D2
Notation
Some books use a subscript to denote the
base.
o Ex: 1210 = 12 decimal
o 1216 = 12 hex = 18 decimal
Logic Gates
Transistors as Switches
• VBB voltage controls whether the transistor
conducts in a common base configuration.
• Logic circuits can be built
Boolean Algebra
AND
In order for current to flow, both switches
must be closed
¤ Logic notation AB = C
(Sometimes AB = C)
A B C
0 0 0
0 1 0
1 0 0
1 1 1
OR
Current flows if either switch is closed
¤ Logic notation A + B = C
A B C
0 0 0
0 1 1
1 0 1
1 1 1
Properties of AND and OR
Commutation
o A + B = B + A
o A  B = B  A
Same as
Same as
Commutation Circuit
A + B B + A
A  B B  A
Properties of AND and OR
Associative Property
A + (B + C) = (A + B) + C
A  (B  C) = (A  B)  C
=
Properties of AND and OR
Distributive Property
A + B  C = (A + B)  (A + C)
A + B  C
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Distributive Property
(A + B)  (A + C)
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Binary Addition
A B S C(arry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
Notice that the carry results are the same as AND
C = A  B
Inversion (NOT)
A Q
0 1
1 0
Logic: A
Q 
Exclusive OR (XOR)
Either A or B, but not both
This is sometimes called the
inequality detector, because the
result will be 0 when the inputs are the
same and 1 when they are different.
The truth table is the same as for
S on Binary Addition. S = A  B
A B S
0 0 0
1 0 1
0 1 1
1 1 0
Getting the XOR
A B S
0 0 0
1 0 1
0 1 1
1 1 0
Two ways of getting S = 1
B
A
or
B
A 

Circuit for XOR
Accumulating our results: Binary addition is the
result of XOR plus AND
B
A
B
A
B
A 




Half Adder
Called a half adder because we haven’t allowed for any carry bit
on input. In elementary addition of numbers, we always need to
allow for a carry from one column to the next.
18
25
4
3 (plus a carry)
Half Adder
Full Adder
INPUTS OUTPUTS
A B CIN COUT S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Full Adder Circuit
Chaining the Full Adder
Possible to use the same
scheme for subtraction by
noting that
A – B = A + (-B)
Binary Counting
Use 1 for ON
Use 0 for OFF
= 00101011
So our example has 25 + 23 + 21 + 20 = 32 + 8 + 2 + 1 = 43
Counting in Binary
1 1 11 1011 21 10101
2 10 12 1100 22 10110
3 11 13 1101 23 10111
4 100 14 1110 24 11000
5 101 15 1111 25 11001
6 110 16 10000 26 11010
7 111 17 10001 27 11011
8 1000 18 10010 28 11100
9 1001 19 10011 29 11101
10 1010 20 10100 30 11110
NAND (NOT AND)
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
B
A
Q 

NOR (NOT OR)
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
B
A
Q 

DeMorgan’s Theorem
A NAND gate is equivalent to an inversion followed by an OR
A NOR gate is equivalent to an inversion followed by and AND
DeMorgan Truth Table
A B
0 0 1 1 1 1
0 1 1 1 0 0
1 0 1 1 0 0
1 1 0 0 0 0
NAND NOR
Exclusive NOR
A B Q
0 0 1
0 1 0
1 0 0
1 1 1
Equality Detector
B
A
Q 

Summary
Summary for all 2-input gates
Inputs Output of each gate
A B AND NAND OR NOR XOR XNOR
0 0 0 1 0 1 0 1
0 1 0 1 1 0 1 0
1 0 0 1 1 0 1 0
1 1 1 0 1 0 0 1
Logic Gates and Symbols
AND
NAND
More Gates and Symbols
NOR
NOT
OR
And More
XOR
NXOR
Multi-input Gates
Three input OR
Logic Gate ICs
Example 7400
More ICs
And More

More Related Content

Similar to Week 5 - Number Systems.pdf

Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesGouda Mando
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxchapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxSurendra Loya
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
numbersystem-171028183820.pptx
numbersystem-171028183820.pptxnumbersystem-171028183820.pptx
numbersystem-171028183820.pptxMariaJoseph591921
 
Data representation
Data representationData representation
Data representationChew Hoong
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
Modern+digital+electronics rp+jain
Modern+digital+electronics rp+jainModern+digital+electronics rp+jain
Modern+digital+electronics rp+jainVenugopala Rao P
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRabiaAsif31
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptssuser52a19e
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalUtkirjonUbaydullaev1
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRAJKUMARP63
 

Similar to Week 5 - Number Systems.pdf (20)

Number system
Number systemNumber system
Number system
 
01.Number Systems
01.Number Systems01.Number Systems
01.Number Systems
 
Logic Gates (1).ppt
Logic Gates (1).pptLogic Gates (1).ppt
Logic Gates (1).ppt
 
Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and Codes
 
01.number systems
01.number systems01.number systems
01.number systems
 
Lec 02
Lec 02Lec 02
Lec 02
 
Binary octal
Binary octalBinary octal
Binary octal
 
number system
number systemnumber system
number system
 
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptxchapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
numbersystem-171028183820.pptx
numbersystem-171028183820.pptxnumbersystem-171028183820.pptx
numbersystem-171028183820.pptx
 
Data representation
Data representationData representation
Data representation
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Modern+digital+electronics rp+jain
Modern+digital+electronics rp+jainModern+digital+electronics rp+jain
Modern+digital+electronics rp+jain
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
binary-numbers.ppt
binary-numbers.pptbinary-numbers.ppt
binary-numbers.ppt
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 

Recently uploaded

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

Week 5 - Number Systems.pdf

  • 1. Number Systems Decimal (base 10) {0 1 2 3 4 5 6 7 8 9} o Place value gives a logarithmic representation of the number o Ex. 4378 means  4 X 103 = 4000  3 X 102 = 300  7 X 101 = 70  8 X 100 = 8 o The place also gives the exponent of the base
  • 2. Example • 432,600 4 3 2 6 0 0 105 104 103 100 101 102 Powers of ten: 100 = 1 102 = 100 104 = 10000 101 = 10 103 = 1000 105 = 100000
  • 3. Binary (base 2) {0 1} Binary Decimal 0 0 1 1 10 2 11 3 100 4 101 5 110 6 111 7 1000 8 1001 9 1010 10
  • 4. Example 1 1 0 1 1 0 0 1 27 26 25 20 21 22 24 23
  • 5. Decimal Equivalent  1101 1001 1 X 27 = 128 + 1 X 26 = 64 + 0 X 25 = 0 + 1 X 24 = 16 + 1 X 23 = 8 + 0 X 22 = 0 + 0 X 21 = 0 + 1 X 20 = 1 217 Notice how powers of two stand out: 20 = 1 21 = 10 22 = 100 23 = 1000
  • 6. Decimal to Binary Conversion  Ex. 575 o Find the largest power of two less than the number o 29 = 512 o Subtract that power of two from the number o 575 – 512 = 63 o Repeat steps 1 and 2 for the new result until you reach zero. o 25 = 32 63 – 32 = 31 o 24 = 16 31 – 16 = 15 o 23 = 8 15 – 8 = 7 o 22 = 4 7 – 4 = 3 o 21 = 2 3 – 2 = 1 o 20 = 1 1 – 1 = 0 o Construct the number o 1000111111
  • 7. Another Example 144 o 27 = 128 144 – 128 = 16 o 24 = 16 16 – 16 = 0 Result 10010000
  • 8. Hexadecimal (base 16)  {0 1 2 3 4 5 6 7 8 9 A B C D E F}  Assignments Dec Hex Dec Hex 0 0 8 8 1 1 9 9 2 2 10 A 3 3 11 B 4 4 12 C 5 5 13 D 6 6 14 E 7 7 15 F
  • 9. Example 163 162 160 161 3 B 6 E 3 X 163 = 12288 11 X 162 = 2816 6 X 161 = 96 14 X 160 = 14  15214
  • 10. Hexadecimal is Convenient for Binary Conversion Binary Hex Binary Hex 0 0 1001 9 1 1 1010 A 10 2 1011 B 11 3 1100 C 100 4 1101 D 101 5 1110 E 110 6 1111 F 111 7 1 0000 10 1000 8  Nibble
  • 11. Binary to Hex Conversion  Group binary number by fours (nibbles) o 1101 1001 0110  Convert each nibble into hex equivalent o 1101 1001 0110 D 9 6
  • 12. Decimal to Hex Conversion  Ex. 284 o 162 = 256 284 – 256 = 28 o 161 = 16 28 - 16 = 12 (Hex C) o Result 1 1 C
  • 13. Another Example with an Extension  1054 o 162 = 256  But we have several multiples of 256 in 1054 o 1054/256 = 4.12 take integer part o This eliminates 4*256 = 1024  1054 – 1024 = 30 o 161 = 16 30 – 16 = 14 (Hex E) o Result 4 1 E
  • 14. Truth Table Binary Decimal Hexadecimal 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
  • 15. Truth Table Binary Decimal Hexadecimal 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7 1000 8 8 1001 9 9 1010 10 A 1011 11 B 1100 12 C 1101 13 D 1110 14 E 1111 15 F
  • 17. Practice Convert 212 decimal to binary o 212 – 27 = 84 o 84 – 26 = 20 o 20 – 24 = 4 o 4 – 22 = 0 o Result: 1101 0100
  • 18. More Practice Convert 1101 0010 binary to hex o 0010 = 2 o 1101 = 13 = D o Result D2
  • 19. Notation Some books use a subscript to denote the base. o Ex: 1210 = 12 decimal o 1216 = 12 hex = 18 decimal
  • 21. Transistors as Switches • VBB voltage controls whether the transistor conducts in a common base configuration. • Logic circuits can be built
  • 23. AND In order for current to flow, both switches must be closed ¤ Logic notation AB = C (Sometimes AB = C) A B C 0 0 0 0 1 0 1 0 0 1 1 1
  • 24. OR Current flows if either switch is closed ¤ Logic notation A + B = C A B C 0 0 0 0 1 1 1 0 1 1 1 1
  • 25. Properties of AND and OR Commutation o A + B = B + A o A  B = B  A Same as Same as
  • 26. Commutation Circuit A + B B + A A  B B  A
  • 27. Properties of AND and OR Associative Property A + (B + C) = (A + B) + C A  (B  C) = (A  B)  C =
  • 28. Properties of AND and OR Distributive Property A + B  C = (A + B)  (A + C) A + B  C A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1
  • 29. Distributive Property (A + B)  (A + C) A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1
  • 30. Binary Addition A B S C(arry) 0 0 0 0 1 0 1 0 0 1 1 0 1 1 0 1 Notice that the carry results are the same as AND C = A  B
  • 31. Inversion (NOT) A Q 0 1 1 0 Logic: A Q 
  • 32. Exclusive OR (XOR) Either A or B, but not both This is sometimes called the inequality detector, because the result will be 0 when the inputs are the same and 1 when they are different. The truth table is the same as for S on Binary Addition. S = A  B A B S 0 0 0 1 0 1 0 1 1 1 1 0
  • 33. Getting the XOR A B S 0 0 0 1 0 1 0 1 1 1 1 0 Two ways of getting S = 1 B A or B A  
  • 34. Circuit for XOR Accumulating our results: Binary addition is the result of XOR plus AND B A B A B A     
  • 35. Half Adder Called a half adder because we haven’t allowed for any carry bit on input. In elementary addition of numbers, we always need to allow for a carry from one column to the next. 18 25 4 3 (plus a carry)
  • 37. Full Adder INPUTS OUTPUTS A B CIN COUT S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1
  • 39. Chaining the Full Adder Possible to use the same scheme for subtraction by noting that A – B = A + (-B)
  • 40. Binary Counting Use 1 for ON Use 0 for OFF = 00101011 So our example has 25 + 23 + 21 + 20 = 32 + 8 + 2 + 1 = 43
  • 41. Counting in Binary 1 1 11 1011 21 10101 2 10 12 1100 22 10110 3 11 13 1101 23 10111 4 100 14 1110 24 11000 5 101 15 1111 25 11001 6 110 16 10000 26 11010 7 111 17 10001 27 11011 8 1000 18 10010 28 11100 9 1001 19 10011 29 11101 10 1010 20 10100 30 11110
  • 42. NAND (NOT AND) A B Q 0 0 1 0 1 1 1 0 1 1 1 0 B A Q  
  • 43. NOR (NOT OR) A B Q 0 0 1 0 1 0 1 0 0 1 1 0 B A Q  
  • 44. DeMorgan’s Theorem A NAND gate is equivalent to an inversion followed by an OR A NOR gate is equivalent to an inversion followed by and AND
  • 45. DeMorgan Truth Table A B 0 0 1 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 NAND NOR
  • 46. Exclusive NOR A B Q 0 0 1 0 1 0 1 0 0 1 1 1 Equality Detector B A Q  
  • 47. Summary Summary for all 2-input gates Inputs Output of each gate A B AND NAND OR NOR XOR XNOR 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1
  • 48. Logic Gates and Symbols AND NAND
  • 49. More Gates and Symbols NOR NOT OR