SlideShare a Scribd company logo
1
Number Systems
2
Numbers
• Each number system is associated with a base or radix
– The decimal number system is said to be of base or radix 10
• A number in base r contains r digits 0,1,2,...,r-1
– Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9
• Numbers are usually expressed in positional notation
– MSD: most significant digit
– LSD: least significant digit
3
Numbers
• The value of the number is given in the polynomial form
4
Numbers
In addition to decimal, three other number systems are
also important: Binary, Octal, and Hexadecimal
5
Unsigned Binary Numbers
• The binary number system: Base-2
• Two digits: 0 and 1
• The digits in a binary number are called bits
– MSB: most significant bit
– LSB: least significant bit
6
Unsigned Binary Numbers
7
Unsigned Binary Numbers
Powers of 2:
20
= 1 24
= 16 28
= 256
21
= 2 25
= 32 29
= 512
22
= 4 26
= 64 210
= 1024
23
= 8 27
= 128
)(:2);(:2);(:2 302010
gigaGmegaMkiloK
• For a computer with the word size of 32-bit
- 4 data-bit unit – nibble (half byte)
- 8 data-bit unit - byte
- 16 data-bit unit – two bytes (half-word)
- 32 data-bit unit – word (four bytes)
- 64 data-bit unit – double-word
8
Converting Binary to Decimal
• For example, here is 1101.01 in binary:
1 1 0 1 . 0 1 Bits
23
22
21
20
2-1
2-2
Weights (in base 10)
(1 x 23
) + (1 x 22
) + (0 x 21
) + (1 x 20
) + (0 x 2-1
) + (1 x 2-2
) =
8 + 4 + 0 + 1 + 0 + 0.25 = 13.25
(1101.01)2 = (13.25)10
9
Converting Decimal to Binary
• To convert a decimal integer into binary, keep dividing by
2 until the quotient is 0. Collect the remainders in
reverse order
• To convert a fraction, keep multiplying the fractional
part by 2 until it becomes 0. Collect the integer parts in
forward order
• Example: 162.375:
• So, (162.375)10 = (10100010.011)2
162 / 2 = 81 rem 0
81 / 2 = 40 rem 1
40 / 2 = 20 rem 0
20 / 2 = 10 rem 0
10 / 2 = 5 rem 0
5 / 2 = 2 rem 1
2 / 2 = 1 rem 0
1 / 2 = 0 rem 1
0.375 x 2 = 0.750
0.750 x 2 = 1.500
0.500 x 2 = 1.000
10
Why does this work?
• This works for converting from decimal to
any base
• Why? Think about converting 162.375 from
decimal to decimal
• Each division strips off the rightmost digit
(the remainder). The quotient represents
the remaining digits in the number
• Similarly, to convert fractions, each
multiplication strips off the leftmost digit
(the integer part). The fraction
162 / 10= 16 rem 2
16 / 10 = 1 rem 6
1 / 10 = 0 rem 1
0.375 x 10 = 3.750
0.750 x 10 = 7.500
0.500 x 10 = 5.000
11
Octal and Hexadecimal Numbers
• The octal number system: Base-8
• Eight digits: 0,1,2,3,4,5,6,7
• The hexadecimal number system: Base-16
• Sixteen digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
• For our purposes, base-8 and base-16 are most useful as
a “shorthand” notation for binary numbers
10
1012
8 )5.87(84878281)4.127( =×+×+×+×= −
10
0123
16 )46687(16151651661611)65( =×+×+×+×= −
FB
12
Decimal Binary Octal Hex
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Numbers with Different Bases
You can convert between base-10
base-8 and base-16 using techniques
like the ones we just showed for
converting between decimal and
binary
13
Binary and Octal Conversions
• Converting from octal to binary: Replace each octal digit with its
equivalent 3-bit binary sequence
• Converting from binary to octal: Make groups of 3 bits, starting
from the binary point. Add 0s to the ends of the number if
needed. Convert each bit group to its corresponding octal digit.
= 6 7 3 . 1 2
= 110 111 011 . 001 010
=
10110100.0010112 = 010 110 100 . 001 0112
= 2 6 4 . 1 38
11170113
11060102
10150011
10040000
BinaryOctalBinaryOctal
8)12.673(
2)001010.110111011(
14
Binary and Hex Conversions
• Converting from hex to binary: Replace each hex digit with its
equivalent 4-bit binary sequence
• Converting from binary to hex: Make groups of 4 bits, starting
from the binary point. Add 0s to the ends of the number if needed.
Convert each bit group to its corresponding hex digit
261.3516 = 2 6 1 . 3 516
= 0010 0110 0001 . 0011 01012
10110100.0010112 = 1011 0100 . 0010 11002
= B 4 . 2 C16
1111F1011B0111700113
1110E1010A0110600102
1101D100190101500011
1100C100080100400000
BinaryHexBinaryHexBinaryHexBinaryHex
15
Unsigned Binary Coded Decimal (BCD)
16
Number Systems Summary
• Computers are binary devices
– We’re forced to think in terms of base 2.
– We learned how to convert numbers between binary, decimal,
octal and hexadecimal
• We’ve already seen some of the recurring themes of
architecture:
– We use 0 and 1 as abstractions for analog voltages.
– We showed how to represent numbers using just these two
signals.

More Related Content

What's hot

Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
Meenakshi Paul
 
Number systems r002
Number systems  r002Number systems  r002
Number systems r002
arunachalamr16
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
Debarati Das
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
Chamila Fernando
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point Conversion
Rajesh Sharma
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to number system
AswiniT3
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
Dr. Anita Goel
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
Forrester High School
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
pyingkodi maran
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
adil raja
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
arunachalamr16
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Datagavhays
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
arunachalamr16
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
arunachalamr16
 
Data Representation
Data RepresentationData Representation
Data Representation
Education Front
 
Unit 3 Data Representation
Unit 3 Data RepresentationUnit 3 Data Representation
Unit 3 Data Representation
Miss Short
 
Digital logic mohammed salim ch2
Digital logic mohammed salim ch2Digital logic mohammed salim ch2
Digital logic mohammed salim ch2
Asst Lect Mohammed Salim
 
Number system
Number system  Number system
Number system
anjineyalus
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, Binary
Richard Homa
 

What's hot (19)

Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Number systems r002
Number systems  r002Number systems  r002
Number systems r002
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point Conversion
 
Introduction to number system
Introduction to number systemIntroduction to number system
Introduction to 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
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Data
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Unit 3 Data Representation
Unit 3 Data RepresentationUnit 3 Data Representation
Unit 3 Data Representation
 
Digital logic mohammed salim ch2
Digital logic mohammed salim ch2Digital logic mohammed salim ch2
Digital logic mohammed salim ch2
 
Number system
Number system  Number system
Number system
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, Binary
 

Similar to 02 number systems

Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
Lovely Professional University
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
PeriyanayagiS
 
Lecture 2 ns
Lecture 2 nsLecture 2 ns
Lecture 2 ns
Rabiul Sarker
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
Ram Pratap Singh
 
Standard 9th Number System Power point presentation
Standard 9th Number System Power point presentationStandard 9th Number System Power point presentation
Standard 9th Number System Power point presentation
hemangipednekar0812
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
MarlonMagtibay2
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
4NM21IS132SAISHARATH
 
Number system
Number systemNumber system
Number system
Darpan Chelani
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
MamataAnilgod
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
HamnaKhalid25
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
NabeelaNousheen
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptx
deepaMS4
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
Mubashir Ali
 
Number Systems - AK.pptx
Number Systems - AK.pptxNumber Systems - AK.pptx
Number Systems - AK.pptx
AmitSharma798754
 
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
MdJubayerFaisalEmon
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
ColleenVender2
 
Digital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdfDigital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdf
Kannan Kanagaraj
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
Shaikh Kamrul Islam (Konok kamrul)
 
data representation
 data representation data representation
data representation
Haroon_007
 
Number Systems
Number SystemsNumber Systems
Number Systems
Infinity Tech Solutions
 

Similar to 02 number systems (20)

Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Lecture 2 ns
Lecture 2 nsLecture 2 ns
Lecture 2 ns
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Standard 9th Number System Power point presentation
Standard 9th Number System Power point presentationStandard 9th Number System Power point presentation
Standard 9th Number System Power point presentation
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Number system
Number systemNumber system
Number system
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Week 4-Number Systems.pptx
Week 4-Number Systems.pptxWeek 4-Number Systems.pptx
Week 4-Number Systems.pptx
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
dtei-180910104911-converted.pptx
dtei-180910104911-converted.pptxdtei-180910104911-converted.pptx
dtei-180910104911-converted.pptx
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
 
Number Systems - AK.pptx
Number Systems - AK.pptxNumber Systems - AK.pptx
Number Systems - AK.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
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Digital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdfDigital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdf
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
data representation
 data representation data representation
data representation
 
Number Systems
Number SystemsNumber Systems
Number Systems
 

Recently uploaded

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 

02 number systems

  • 2. 2 Numbers • Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 • A number in base r contains r digits 0,1,2,...,r-1 – Decimal (Base 10): 0,1,2,3,4,5,6,7,8,9 • Numbers are usually expressed in positional notation – MSD: most significant digit – LSD: least significant digit
  • 3. 3 Numbers • The value of the number is given in the polynomial form
  • 4. 4 Numbers In addition to decimal, three other number systems are also important: Binary, Octal, and Hexadecimal
  • 5. 5 Unsigned Binary Numbers • The binary number system: Base-2 • Two digits: 0 and 1 • The digits in a binary number are called bits – MSB: most significant bit – LSB: least significant bit
  • 7. 7 Unsigned Binary Numbers Powers of 2: 20 = 1 24 = 16 28 = 256 21 = 2 25 = 32 29 = 512 22 = 4 26 = 64 210 = 1024 23 = 8 27 = 128 )(:2);(:2);(:2 302010 gigaGmegaMkiloK • For a computer with the word size of 32-bit - 4 data-bit unit – nibble (half byte) - 8 data-bit unit - byte - 16 data-bit unit – two bytes (half-word) - 32 data-bit unit – word (four bytes) - 64 data-bit unit – double-word
  • 8. 8 Converting Binary to Decimal • For example, here is 1101.01 in binary: 1 1 0 1 . 0 1 Bits 23 22 21 20 2-1 2-2 Weights (in base 10) (1 x 23 ) + (1 x 22 ) + (0 x 21 ) + (1 x 20 ) + (0 x 2-1 ) + (1 x 2-2 ) = 8 + 4 + 0 + 1 + 0 + 0.25 = 13.25 (1101.01)2 = (13.25)10
  • 9. 9 Converting Decimal to Binary • To convert a decimal integer into binary, keep dividing by 2 until the quotient is 0. Collect the remainders in reverse order • To convert a fraction, keep multiplying the fractional part by 2 until it becomes 0. Collect the integer parts in forward order • Example: 162.375: • So, (162.375)10 = (10100010.011)2 162 / 2 = 81 rem 0 81 / 2 = 40 rem 1 40 / 2 = 20 rem 0 20 / 2 = 10 rem 0 10 / 2 = 5 rem 0 5 / 2 = 2 rem 1 2 / 2 = 1 rem 0 1 / 2 = 0 rem 1 0.375 x 2 = 0.750 0.750 x 2 = 1.500 0.500 x 2 = 1.000
  • 10. 10 Why does this work? • This works for converting from decimal to any base • Why? Think about converting 162.375 from decimal to decimal • Each division strips off the rightmost digit (the remainder). The quotient represents the remaining digits in the number • Similarly, to convert fractions, each multiplication strips off the leftmost digit (the integer part). The fraction 162 / 10= 16 rem 2 16 / 10 = 1 rem 6 1 / 10 = 0 rem 1 0.375 x 10 = 3.750 0.750 x 10 = 7.500 0.500 x 10 = 5.000
  • 11. 11 Octal and Hexadecimal Numbers • The octal number system: Base-8 • Eight digits: 0,1,2,3,4,5,6,7 • The hexadecimal number system: Base-16 • Sixteen digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F • For our purposes, base-8 and base-16 are most useful as a “shorthand” notation for binary numbers 10 1012 8 )5.87(84878281)4.127( =×+×+×+×= − 10 0123 16 )46687(16151651661611)65( =×+×+×+×= − FB
  • 12. 12 Decimal Binary Octal Hex 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Numbers with Different Bases You can convert between base-10 base-8 and base-16 using techniques like the ones we just showed for converting between decimal and binary
  • 13. 13 Binary and Octal Conversions • Converting from octal to binary: Replace each octal digit with its equivalent 3-bit binary sequence • Converting from binary to octal: Make groups of 3 bits, starting from the binary point. Add 0s to the ends of the number if needed. Convert each bit group to its corresponding octal digit. = 6 7 3 . 1 2 = 110 111 011 . 001 010 = 10110100.0010112 = 010 110 100 . 001 0112 = 2 6 4 . 1 38 11170113 11060102 10150011 10040000 BinaryOctalBinaryOctal 8)12.673( 2)001010.110111011(
  • 14. 14 Binary and Hex Conversions • Converting from hex to binary: Replace each hex digit with its equivalent 4-bit binary sequence • Converting from binary to hex: Make groups of 4 bits, starting from the binary point. Add 0s to the ends of the number if needed. Convert each bit group to its corresponding hex digit 261.3516 = 2 6 1 . 3 516 = 0010 0110 0001 . 0011 01012 10110100.0010112 = 1011 0100 . 0010 11002 = B 4 . 2 C16 1111F1011B0111700113 1110E1010A0110600102 1101D100190101500011 1100C100080100400000 BinaryHexBinaryHexBinaryHexBinaryHex
  • 15. 15 Unsigned Binary Coded Decimal (BCD)
  • 16. 16 Number Systems Summary • Computers are binary devices – We’re forced to think in terms of base 2. – We learned how to convert numbers between binary, decimal, octal and hexadecimal • We’ve already seen some of the recurring themes of architecture: – We use 0 and 1 as abstractions for analog voltages. – We showed how to represent numbers using just these two signals.