SlideShare a Scribd company logo
1 of 41
CMSC 131 Object-Oriented Programming I Instructor: Larry Herman Section: 0302 Room: CSI 2118
People to Know Instructor Larry Herman Email:  larry@cs.umd.edu Teaching Assistant Philip Dasler Email:  daslerpc@cs.umd.edu
Things I Lied About / Need to Clarify You must use Eclipse as provided on the class website. You can’t use laptops in lecture. Closer to 80 students in lectures. Recommended books are just that.  Also, they are all the same. Office hours will be in A.V. Williams 1112
More Administrivia Check for access to the grades server grades.cs.umd.edu Also, a link can be found on the class web page If you are officially registered for the course, you should have access. Grades server allows  View scores View statistics Report an absence
Let’s Play a Game What was covered in lecture?
Let’s Play a Game What was covered in lecture? Parts of a computer Bits, bytes, and words (0s and 1s) N bits can represent 2N values SI Prefixes (kilo, mega, kibibyte, mebi, etc.) ASCII Programming language types machine code assembly
An Aside Prefixes 1027 ?? 1024yotta1021zetta1018exa1015peta1012tera109giga106 	mega103 	kilo102hecto101deka
An Aside Prefixes 1027hella 1024yotta1021zetta1018exa1015peta1012tera109giga106 	mega103 	kilo102hecto101deka
bases
Relearning How to Count What number is this? 32,768
Relearning How to Count But how do you know? 32,768
Relearning How to Count Hundreds Tens Thousands 32,768 Ones Ten Thousands Positional Notation
Relearning How to Count             8           60         700            2,000        + 30,000            32,768
Relearning How to Count             8		8 x 1           60		6 x 10         700      	7 x 100      2,000       	2 x 1000 + 30,000		3 x 10000    32,768
Relearning How to Count             8		8 x 100           60		6 x 101         700      	7 x 102      2,000       	2 x 103 + 30,000		3 x 104    32,768
Relearning How to Count             8		8 x 100           60		6 x 101         700      	7 x 102      2,000       	2 x 103 + 30,000		3 x 104    32,768 Base 10 (or radix 10)
Other Bases Can be done with any base number. Numbers in Base N are made of the digits in the range 0 to N-1 Base 10 numbers are made up of 0, 1, 2, . . . 8, 9 Examples Base 3 numbers use 0, 1, and 2 Base 6 numbers use 0, 1, 2, 3, 4, and 5 Base 8 numbers use 0, 1, 2, 3, 4, 5, 6, and 7
Other Bases - Example Notation:   Xn means some number X in Base n Example: Convert 13924 from Base 4 to Base 10.
Other Bases - Example          22 x 40        369 x 41        48      3 x 42 +  	    64       1 x 43 	  15010 Base 4
Other Bases What is 2536 in Base 10?
Other Bases What is 2536 in Base 10? 10510
Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10?
Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610
Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10?
Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10? 11310
Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example:  convert 7610 into Base 7 7610 divided by 7 gives 10	the remainder is 6	__6 1010 divided by 7 gives 1	the remainder is 3   	_36 110divided by 7 gives 0	the remainder is 1   136 7610  = 1367
Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example:  convert 11310 into Base 5 11310 divided by 5 gives 22	the remainder is 3	__3 2210 divided by 5 gives 4	the remainder is 2   	_23 410divided by 5 gives 0	the remainder is 4   423 11310  = 4235
Reminder! 45 = ?  
Reminder! 45 = 0 0 with a remainder of 4  
Bringing It Back So what does this have to do with computers? Computers store everything as a series of 0s and 1s. This is actually just regular numbers in Base 2! What is 101010 in Base 10?
Some Common Terms Base 2,	Binary Base 8,	Octal Base 10,	Decimal Base 16,	Hexadecimal or Hex These are the most common bases used in computing.
Wait, Base 16? But there aren’t enough numbers!
Wait, Base 16? But there aren’t enough numbers! Hex uses the following digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F Thus, 4210 = 2A16
Easy Conversions We use binary, octal, and hex often because they are all powers of two. This allows for easy conversions by just translating digits.
Easy Conversions Octal is Base 8 Binary is Base 2 8 is just 23  Thus, for every three digits in binary we can directly translate to a single octal digit.
Easy Conversions Example: Convert 758 to binary. 78 is 111 in binary. 58 is 101 in binary. Thus, 758 = 1111012
Easy Conversions Works just as well for hex or backwards. Convert 1011111101112 to hex. 10112  is B in hex. 11112  is F in hex. 01112  is 7 in hex. Thus, 1011111101112 = BF716
Easy Conversions
Why Use Bases? Computers store information in two states:  “charged” or “uncharged” These can easily be represented by 0s and 1s, making binary a convenient method for mathematical manipulation Hex is more compact and easily converts to and from binary 111111101110110111111010110011102 = FEEDFACE16
Questions?
Fun Stuff Individual digits 23 22 21 20 Hours Minutes Seconds Hint:  In ASCII, the letter ‘A’ is represented by the number 65.

More Related Content

What's hot (19)

Computer number systems
Computer number systemsComputer number systems
Computer number systems
 
Number System
Number SystemNumber System
Number System
 
DIGITAL DESIGN
DIGITAL DESIGNDIGITAL DESIGN
DIGITAL DESIGN
 
08. Numeral Systems
08. Numeral Systems08. Numeral Systems
08. Numeral Systems
 
NUMBER SYSTEM
NUMBER SYSTEMNUMBER SYSTEM
NUMBER SYSTEM
 
Number systems
Number systemsNumber systems
Number systems
 
Number System
Number SystemNumber System
Number System
 
01 intro
01 intro01 intro
01 intro
 
Number system
Number systemNumber system
Number system
 
Number system
Number systemNumber system
Number system
 
Number system 1
Number system 1Number system 1
Number system 1
 
data representation
 data representation data representation
data representation
 
Binary octal
Binary octalBinary octal
Binary octal
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
01.Number Systems
01.Number Systems01.Number Systems
01.Number Systems
 
Number system
Number systemNumber system
Number system
 
Number system....
Number system....Number system....
Number system....
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
Conversion of number system with base concept
Conversion of number system with base conceptConversion of number system with base concept
Conversion of number system with base concept
 

Similar to CMSC 131 Discussion 09-07-2011

Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1DIGDARSHAN KUNWAR
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsshivas379526
 
Lesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLexume1
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversionsSusantha Herath
 
ADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptxADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptxKUMARS641064
 
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
 
Binary ,octa,hexa conversion
Binary ,octa,hexa conversionBinary ,octa,hexa conversion
Binary ,octa,hexa conversionChaudharyShoaib7
 
Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...ArtemKovera
 
Chapter 2.ppt
Chapter 2.pptChapter 2.ppt
Chapter 2.pptNMohd3
 

Similar to CMSC 131 Discussion 09-07-2011 (20)

Number Systems
Number SystemsNumber Systems
Number Systems
 
Number system
Number systemNumber system
Number system
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1
 
Number system
Number systemNumber system
Number system
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Cit 1101 lec 02
Cit 1101 lec 02Cit 1101 lec 02
Cit 1101 lec 02
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
Lesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representation
 
Number systems and conversions
Number systems and conversionsNumber systems and conversions
Number systems and conversions
 
ADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptxADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptx
 
LCDF3_Chap_01x.pptx
LCDF3_Chap_01x.pptxLCDF3_Chap_01x.pptx
LCDF3_Chap_01x.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
 
Binary ,octa,hexa conversion
Binary ,octa,hexa conversionBinary ,octa,hexa conversion
Binary ,octa,hexa conversion
 
Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...Computer data representation (integers, floating-point numbers, text, images,...
Computer data representation (integers, floating-point numbers, text, images,...
 
Chapter 2.ppt
Chapter 2.pptChapter 2.ppt
Chapter 2.ppt
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 

Recently uploaded

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

CMSC 131 Discussion 09-07-2011

  • 1. CMSC 131 Object-Oriented Programming I Instructor: Larry Herman Section: 0302 Room: CSI 2118
  • 2. People to Know Instructor Larry Herman Email: larry@cs.umd.edu Teaching Assistant Philip Dasler Email: daslerpc@cs.umd.edu
  • 3. Things I Lied About / Need to Clarify You must use Eclipse as provided on the class website. You can’t use laptops in lecture. Closer to 80 students in lectures. Recommended books are just that. Also, they are all the same. Office hours will be in A.V. Williams 1112
  • 4. More Administrivia Check for access to the grades server grades.cs.umd.edu Also, a link can be found on the class web page If you are officially registered for the course, you should have access. Grades server allows View scores View statistics Report an absence
  • 5. Let’s Play a Game What was covered in lecture?
  • 6. Let’s Play a Game What was covered in lecture? Parts of a computer Bits, bytes, and words (0s and 1s) N bits can represent 2N values SI Prefixes (kilo, mega, kibibyte, mebi, etc.) ASCII Programming language types machine code assembly
  • 7. An Aside Prefixes 1027 ?? 1024yotta1021zetta1018exa1015peta1012tera109giga106 mega103 kilo102hecto101deka
  • 8. An Aside Prefixes 1027hella 1024yotta1021zetta1018exa1015peta1012tera109giga106 mega103 kilo102hecto101deka
  • 10. Relearning How to Count What number is this? 32,768
  • 11. Relearning How to Count But how do you know? 32,768
  • 12. Relearning How to Count Hundreds Tens Thousands 32,768 Ones Ten Thousands Positional Notation
  • 13. Relearning How to Count 8 60 700 2,000 + 30,000 32,768
  • 14. Relearning How to Count 8 8 x 1 60 6 x 10 700 7 x 100 2,000 2 x 1000 + 30,000 3 x 10000 32,768
  • 15. Relearning How to Count 8 8 x 100 60 6 x 101 700 7 x 102 2,000 2 x 103 + 30,000 3 x 104 32,768
  • 16. Relearning How to Count 8 8 x 100 60 6 x 101 700 7 x 102 2,000 2 x 103 + 30,000 3 x 104 32,768 Base 10 (or radix 10)
  • 17. Other Bases Can be done with any base number. Numbers in Base N are made of the digits in the range 0 to N-1 Base 10 numbers are made up of 0, 1, 2, . . . 8, 9 Examples Base 3 numbers use 0, 1, and 2 Base 6 numbers use 0, 1, 2, 3, 4, and 5 Base 8 numbers use 0, 1, 2, 3, 4, 5, 6, and 7
  • 18. Other Bases - Example Notation: Xn means some number X in Base n Example: Convert 13924 from Base 4 to Base 10.
  • 19. Other Bases - Example 22 x 40 369 x 41 48 3 x 42 + 64 1 x 43 15010 Base 4
  • 20. Other Bases What is 2536 in Base 10?
  • 21. Other Bases What is 2536 in Base 10? 10510
  • 22. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10?
  • 23. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610
  • 24. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10?
  • 25. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10? 11310
  • 26. Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example: convert 7610 into Base 7 7610 divided by 7 gives 10 the remainder is 6 __6 1010 divided by 7 gives 1 the remainder is 3 _36 110divided by 7 gives 0 the remainder is 1 136 7610 = 1367
  • 27. Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example: convert 11310 into Base 5 11310 divided by 5 gives 22 the remainder is 3 __3 2210 divided by 5 gives 4 the remainder is 2 _23 410divided by 5 gives 0 the remainder is 4 423 11310 = 4235
  • 29. Reminder! 45 = 0 0 with a remainder of 4  
  • 30. Bringing It Back So what does this have to do with computers? Computers store everything as a series of 0s and 1s. This is actually just regular numbers in Base 2! What is 101010 in Base 10?
  • 31. Some Common Terms Base 2, Binary Base 8, Octal Base 10, Decimal Base 16, Hexadecimal or Hex These are the most common bases used in computing.
  • 32. Wait, Base 16? But there aren’t enough numbers!
  • 33. Wait, Base 16? But there aren’t enough numbers! Hex uses the following digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F Thus, 4210 = 2A16
  • 34. Easy Conversions We use binary, octal, and hex often because they are all powers of two. This allows for easy conversions by just translating digits.
  • 35. Easy Conversions Octal is Base 8 Binary is Base 2 8 is just 23 Thus, for every three digits in binary we can directly translate to a single octal digit.
  • 36. Easy Conversions Example: Convert 758 to binary. 78 is 111 in binary. 58 is 101 in binary. Thus, 758 = 1111012
  • 37. Easy Conversions Works just as well for hex or backwards. Convert 1011111101112 to hex. 10112 is B in hex. 11112 is F in hex. 01112 is 7 in hex. Thus, 1011111101112 = BF716
  • 39. Why Use Bases? Computers store information in two states: “charged” or “uncharged” These can easily be represented by 0s and 1s, making binary a convenient method for mathematical manipulation Hex is more compact and easily converts to and from binary 111111101110110111111010110011102 = FEEDFACE16
  • 41. Fun Stuff Individual digits 23 22 21 20 Hours Minutes Seconds Hint: In ASCII, the letter ‘A’ is represented by the number 65.