SlideShare une entreprise Scribd logo
1  sur  31
1
Number System
Lecture 2
2
Introduction to Number Systems
• We are all familiar with the decimal number
system (Base 10). Some other number
systems that we will work with are:
• Binary  Base 2
• Octal  Base 8
• Hexadecimal  Base 16
3
Characteristics of Numbering Systems
1) The digits are consecutive.
2) The number of digits is equal to the size of
the base.
3) Zero is always the first digit.
4) The base number is never a digit.
5) When 1 is added to the largest digit, a sum
of zero and a carry of one results.
6) Numeric values determined by the implicit
positional values of the digits.
4
Significant Digits
Decimal: 82347
Most significant digit Least significant digit
Binary: 101010
Most significant digit Least significant digit
5
Binary Number System
• Also called the “Base 2 system”
• The binary number system is used to model
the series of electrical signals computers
use to represent information
• 0 represents the no voltage or an off state
• 1 represents the presence of voltage or an
on state
6
Binary Numbering Scale
Base 2
Number
Base 10
Equivalent
Power
Positional
Value
000 0 20 1
001 1 21 2
010 2 22 4
011 3 23 8
100 4 24 16
101 5 25 32
110 6 26 64
111 7 27 128
7
Binary Addition
4 Possible Binary Addition Combinations:
(1) 0 (2) 0
+0 +1
00 01
(3) 1 (4) 1
+0 +1
01 10
SumCarry
Note that leading zeroes are frequently dropped.
SumCarry
8
Decimal to Binary Conversion
• The easiest way to convert a decimal
number to its binary equivalent is to use the
Division Algorithm
• This method repeatedly divides a decimal
number by 2 and records the quotient and
remainder
• The remainder digits (a sequence of zeros and
ones) form the binary equivalent in least
significant to most significant digit sequence
9
Division Algorithm
Convert 67 to its binary equivalent:
6710 = x2
Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row
Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row
Step 3: 16 / 2 = 8 R 0 Repeat again
Step 4: 8 / 2 = 4 R 0 Repeat again
Step 5: 4 / 2 = 2 R 0 Repeat again
Step 6: 2 / 2 = 1 R 0 Repeat again
Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0
1 0 0 0 0 1 12
10
Binary to Decimal Conversion
• The easiest method for converting a binary number
to its decimal equivalent is to use the Multiplication
Algorithm
• Multiply the binary digits by increasing powers of
two, starting from the right
• Then, to find the decimal number equivalent, sum
those products
11
Multiplication Algorithm
Convert (10101101)2 to its decimal equivalent:
Binary 1 0 1 0 1 1 0 1
Positional Values
xxxxxxxx
2021222324252627
128 +0+32 +0+ 8 + 4 +0+ 1Products
17310
12
Octal Number System
• Also known as the Base 8 System
• Uses digits 0 - 7
• Readily converts to binary
• Groups of three (binary) digits can be used to
represent each octal digit
• Also uses multiplication and division algorithms for
conversion to and from base 10
13
Decimal to Octal Conversion
Convert 42710 to its octal equivalent:
427 / 8 = 53 R 3 Divide by 8; R is LSD
53 / 8 = 6 R 5 Divide Q by 8; R is next digit
6 / 8 = 0 R 6 Repeat until Q = 0
6538
14
Octal to Decimal Conversion
Convert 6538 to its decimal equivalent:
6 5 3
xxx
82 81 80
384 + 40 + 3
42710
Positional Values
Products
Octal Digits
15
Octal to Binary Conversion
Each octal number converts to 3 binary digits
To convert 6538 to binary, just
substitute code:
6 5 3
110 101 011
Code
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
16
Hexadecimal Number System
• Base 16 system
• Uses digits 0-9 &
letters A,B,C,D,E,F
• Groups of four bits
represent each
base 16 digit
17
Decimal to Hexadecimal Conversion
Convert 83010 to its hexadecimal equivalent:
830 / 16 = 51 R 14
51 / 16 = 3 R 3
3 / 16 = 0 R 3
33E16
= E in Hex
18
Hexadecimal to Decimal Conversion
Convert 3B4F16 to its decimal equivalent:
Hex Digits
3 B 4 F
xxx
163 162 161 160
12288 +2816 + 64 +15
15,18310
Positional Values
Products
x
19
Binary to Hexadecimal Conversion
• The easiest method for converting binary to
hexadecimal is to use a substitution code
• Each hex number converts to 4 binary digits
20
Convert 0101011010101110011010102 to hex
using the 4-bit substitution code :
0101 0110 1010 1110 0110 1010
Substitution Code
5 6 A E 6 A
56AE6A16
21
Substitution code can also be used to convert binary to
octal by using 3-bit groupings:
010 101 101 010 111 001 101 010
Substitution Code
2 5 5 2 7 1 5 2
255271528
22
Complement
• Complement is the negative equivalent of a number.
• If we have a number N then complement of N will
give us another number which is equivalent to –N
• So if complement of N is M, then we can say M = -N
So complement of M = -M = -(-N) = N
• So complement of complement gives the original
number
23
Types of Complement
• For a number of base r, two types of complements
can be found
• 1. r’s complement
• 2. (r-1)’s complement
• Definition:
• If N is a number of base r having n digits then
• r’s complement of N = rn – N and
• (r-1)’s complement of N = rn-N-1
24
Example
• Suppose N = (3675)10
• So we can find two complements of this number.
The 10’s complement and the 9’s complement.
Here n = 4
• 10’s complement of (3675) = 104-3675
= 6325
• 9’s complement of (3675) = 104-3675 -1
= 6324
25
Short cut way to find (r-1)’s complement
• In the previous example we see that 9’s
complement of 3675 is 6324. We can get the result
by subtracting each digit from 9.
• Similarly for other base, the (r-1)’s complement can
be found by subtracting each digit from r-1 (the
highest digit in that system).
• For binary 1’s complement is even more easy. Just
change 1 to 0 and 0 to 1. (Because 1-1=0 and 1-
0=1)
26
Example:
• (110100101)2 1’s complement 001011010
• (110100101)2 2’s complement 001011011
27
Use of Complement
• Complement is used to perform subtraction using addition
• Mathematically A-B = A + (-B)
• So we can get the result of A-B by adding complement of B
with A.
• So A-B = A + Complement of (B)
• Now we can use either r’s complement or (r-1)’s
complement
28
Complementary Arithmetic
• 1’s complement
• Switch all 0’s to 1’s and 1’s to 0’s
Binary # 10110011
1’s complement 01001100
29
Complementary Arithmetic
• 2’s complement
• Step 1: Find 1’s complement of the number
Binary # 11000110
1’s complement 00111001
• Step 2: Add 1 to the 1’s complement
00111001
+ 00000001
00111010
30
Complementary Arithmetic
1000 8 8
-100 -4 6
14
1000 100
Add 2’s Com 100 1’s complement 011
Discard MSB 1100 2’s complement 100
Result 100
Addition, subtraction, multiplication and division all can
be done by only addition.
31
Thank You

Contenu connexe

Tendances

binary number system
 binary number system binary number system
binary number systemvishal gupta
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdfmiftah88
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary AritmeticsDelowar Hossain
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversionRam Pratap Singh
 
Number System Conversion
Number System ConversionNumber System Conversion
Number System ConversionFaraz Ahmed
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systemsLee Chadwick
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMZaheer Abbasi
 
Number Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsNumber Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsSrikrishna Thota
 
Number system
Number systemNumber system
Number systemkashee99
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmeticSanjay Saluth
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental Aman anand kumar
 

Tendances (20)

binary number system
 binary number system binary number system
binary number system
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary Aritmetics
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
number system
number systemnumber system
number system
 
Number System Conversion
Number System ConversionNumber System Conversion
Number System Conversion
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
Chapter 7 rohith
Chapter 7 rohithChapter 7 rohith
Chapter 7 rohith
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Complements
ComplementsComplements
Complements
 
Number Base Conversion Digital Electronics
Number Base Conversion Digital ElectronicsNumber Base Conversion Digital Electronics
Number Base Conversion Digital Electronics
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Number system
Number systemNumber system
Number system
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmetic
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Number system
Number systemNumber system
Number system
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental
 

Similaire à Lecture 2 ns

Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptxHamnaKhalid25
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Jumaed
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxMamataAnilgod
 
02 number systems
02 number systems02 number systems
02 number systemsjohn01383
 
Course Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdfCourse Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdfMdJubayerFaisalEmon
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptxLibanMohamed26
 
Boolean Algebra Arithmetic SIG UNSIGN.ppt
Boolean Algebra  Arithmetic SIG UNSIGN.pptBoolean Algebra  Arithmetic SIG UNSIGN.ppt
Boolean Algebra Arithmetic SIG UNSIGN.pptAshishChandrakar12
 
data representation
 data representation data representation
data representationHaroon_007
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdfAsthaChaurasia4
 
Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02muhammadsarab
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsshivas379526
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...Arti Parab Academics
 

Similaire à Lecture 2 ns (20)

Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
Alu1
Alu1Alu1
Alu1
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Number system
Number systemNumber system
Number system
 
02 number systems
02 number systems02 number systems
02 number systems
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Course Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdfCourse Name: Digital System Design Number System.pdf
Course Name: Digital System Design Number System.pdf
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 
Boolean Algebra Arithmetic SIG UNSIGN.ppt
Boolean Algebra  Arithmetic SIG UNSIGN.pptBoolean Algebra  Arithmetic SIG UNSIGN.ppt
Boolean Algebra Arithmetic SIG UNSIGN.ppt
 
data representation
 data representation data representation
data representation
 
Computer Number system
Computer Number systemComputer Number system
Computer Number system
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdf
 
Ch. 1.pdf
Ch. 1.pdfCh. 1.pdf
Ch. 1.pdf
 
Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02Numbersystem 130621192712-phpapp02
Numbersystem 130621192712-phpapp02
 
Number system
Number systemNumber system
Number system
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 

Dernier

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
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
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 

Dernier (20)

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
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
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Lecture 2 ns

  • 2. 2 Introduction to Number Systems • We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are: • Binary  Base 2 • Octal  Base 8 • Hexadecimal  Base 16
  • 3. 3 Characteristics of Numbering Systems 1) The digits are consecutive. 2) The number of digits is equal to the size of the base. 3) Zero is always the first digit. 4) The base number is never a digit. 5) When 1 is added to the largest digit, a sum of zero and a carry of one results. 6) Numeric values determined by the implicit positional values of the digits.
  • 4. 4 Significant Digits Decimal: 82347 Most significant digit Least significant digit Binary: 101010 Most significant digit Least significant digit
  • 5. 5 Binary Number System • Also called the “Base 2 system” • The binary number system is used to model the series of electrical signals computers use to represent information • 0 represents the no voltage or an off state • 1 represents the presence of voltage or an on state
  • 6. 6 Binary Numbering Scale Base 2 Number Base 10 Equivalent Power Positional Value 000 0 20 1 001 1 21 2 010 2 22 4 011 3 23 8 100 4 24 16 101 5 25 32 110 6 26 64 111 7 27 128
  • 7. 7 Binary Addition 4 Possible Binary Addition Combinations: (1) 0 (2) 0 +0 +1 00 01 (3) 1 (4) 1 +0 +1 01 10 SumCarry Note that leading zeroes are frequently dropped. SumCarry
  • 8. 8 Decimal to Binary Conversion • The easiest way to convert a decimal number to its binary equivalent is to use the Division Algorithm • This method repeatedly divides a decimal number by 2 and records the quotient and remainder • The remainder digits (a sequence of zeros and ones) form the binary equivalent in least significant to most significant digit sequence
  • 9. 9 Division Algorithm Convert 67 to its binary equivalent: 6710 = x2 Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row Step 3: 16 / 2 = 8 R 0 Repeat again Step 4: 8 / 2 = 4 R 0 Repeat again Step 5: 4 / 2 = 2 R 0 Repeat again Step 6: 2 / 2 = 1 R 0 Repeat again Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0 1 0 0 0 0 1 12
  • 10. 10 Binary to Decimal Conversion • The easiest method for converting a binary number to its decimal equivalent is to use the Multiplication Algorithm • Multiply the binary digits by increasing powers of two, starting from the right • Then, to find the decimal number equivalent, sum those products
  • 11. 11 Multiplication Algorithm Convert (10101101)2 to its decimal equivalent: Binary 1 0 1 0 1 1 0 1 Positional Values xxxxxxxx 2021222324252627 128 +0+32 +0+ 8 + 4 +0+ 1Products 17310
  • 12. 12 Octal Number System • Also known as the Base 8 System • Uses digits 0 - 7 • Readily converts to binary • Groups of three (binary) digits can be used to represent each octal digit • Also uses multiplication and division algorithms for conversion to and from base 10
  • 13. 13 Decimal to Octal Conversion Convert 42710 to its octal equivalent: 427 / 8 = 53 R 3 Divide by 8; R is LSD 53 / 8 = 6 R 5 Divide Q by 8; R is next digit 6 / 8 = 0 R 6 Repeat until Q = 0 6538
  • 14. 14 Octal to Decimal Conversion Convert 6538 to its decimal equivalent: 6 5 3 xxx 82 81 80 384 + 40 + 3 42710 Positional Values Products Octal Digits
  • 15. 15 Octal to Binary Conversion Each octal number converts to 3 binary digits To convert 6538 to binary, just substitute code: 6 5 3 110 101 011 Code 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1 6 1 1 0 7 1 1 1
  • 16. 16 Hexadecimal Number System • Base 16 system • Uses digits 0-9 & letters A,B,C,D,E,F • Groups of four bits represent each base 16 digit
  • 17. 17 Decimal to Hexadecimal Conversion Convert 83010 to its hexadecimal equivalent: 830 / 16 = 51 R 14 51 / 16 = 3 R 3 3 / 16 = 0 R 3 33E16 = E in Hex
  • 18. 18 Hexadecimal to Decimal Conversion Convert 3B4F16 to its decimal equivalent: Hex Digits 3 B 4 F xxx 163 162 161 160 12288 +2816 + 64 +15 15,18310 Positional Values Products x
  • 19. 19 Binary to Hexadecimal Conversion • The easiest method for converting binary to hexadecimal is to use a substitution code • Each hex number converts to 4 binary digits
  • 20. 20 Convert 0101011010101110011010102 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 Substitution Code 5 6 A E 6 A 56AE6A16
  • 21. 21 Substitution code can also be used to convert binary to octal by using 3-bit groupings: 010 101 101 010 111 001 101 010 Substitution Code 2 5 5 2 7 1 5 2 255271528
  • 22. 22 Complement • Complement is the negative equivalent of a number. • If we have a number N then complement of N will give us another number which is equivalent to –N • So if complement of N is M, then we can say M = -N So complement of M = -M = -(-N) = N • So complement of complement gives the original number
  • 23. 23 Types of Complement • For a number of base r, two types of complements can be found • 1. r’s complement • 2. (r-1)’s complement • Definition: • If N is a number of base r having n digits then • r’s complement of N = rn – N and • (r-1)’s complement of N = rn-N-1
  • 24. 24 Example • Suppose N = (3675)10 • So we can find two complements of this number. The 10’s complement and the 9’s complement. Here n = 4 • 10’s complement of (3675) = 104-3675 = 6325 • 9’s complement of (3675) = 104-3675 -1 = 6324
  • 25. 25 Short cut way to find (r-1)’s complement • In the previous example we see that 9’s complement of 3675 is 6324. We can get the result by subtracting each digit from 9. • Similarly for other base, the (r-1)’s complement can be found by subtracting each digit from r-1 (the highest digit in that system). • For binary 1’s complement is even more easy. Just change 1 to 0 and 0 to 1. (Because 1-1=0 and 1- 0=1)
  • 26. 26 Example: • (110100101)2 1’s complement 001011010 • (110100101)2 2’s complement 001011011
  • 27. 27 Use of Complement • Complement is used to perform subtraction using addition • Mathematically A-B = A + (-B) • So we can get the result of A-B by adding complement of B with A. • So A-B = A + Complement of (B) • Now we can use either r’s complement or (r-1)’s complement
  • 28. 28 Complementary Arithmetic • 1’s complement • Switch all 0’s to 1’s and 1’s to 0’s Binary # 10110011 1’s complement 01001100
  • 29. 29 Complementary Arithmetic • 2’s complement • Step 1: Find 1’s complement of the number Binary # 11000110 1’s complement 00111001 • Step 2: Add 1 to the 1’s complement 00111001 + 00000001 00111010
  • 30. 30 Complementary Arithmetic 1000 8 8 -100 -4 6 14 1000 100 Add 2’s Com 100 1’s complement 011 Discard MSB 1100 2’s complement 100 Result 100 Addition, subtraction, multiplication and division all can be done by only addition.