1 / 7

Basic Data Types

Characters vs. Numbers. Basic Data Types. Adding in Binary : There are only four (4) possible combinations :. 0 + 0 0. 0 + 1 1. 1 + 0 1. 1 + 1 10.

Download Presentation

Basic Data Types

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Characters vs. Numbers Basic Data Types Adding in Binary: There are only four (4) possible combinations: 0 + 0 0 0 + 1 1 1 + 0 1 1 + 1 10 Remember: Since binary contains the only the digits 0 & 1, the number 2 must be represented using 2 digits (10) Similarly, in Decimal, there is no symbol for ten, so we must use two symbols: 1 and 0 (10).

  2. 1 0 1 + 1 0 1 1 1 1 1 1 1 1 + 1 0 1 0 0 1 1 1 1 + 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 + 1 0 0 1 1 0 + 1 0 0 1 1 0 1 1 0 1 0 1 1 1 1 0 Some additional Examples of adding in Binary: Basic Data Types

  3. From the ASCII Tables, we know: Basic Data Types 0110011 is the sequence of bits needed to represent ‘3’ 0110100 is the sequence of bits needed to represent ‘4’ Therefore: 0110011 + 0110100 1100111 Must be the sequence of bits needed to represent ‘7’ According to the ASCII Tables 1100111 is the sequence of bits needed to represent the character ‘g’. What Gives??

  4. Yielding: ASCII is a coding to scheme used to represent ONLY CHARACTERS AND/OR SYMBOLS. Basic Data Types The character ‘3’ is no more a number than it is in the string “TJF-3H9” (License Plate Number??). Trying to add the characters ‘3’ and ‘4’ makes no more sense than trying to add the strings : How Now Brown Cow? + To be or not to be. Good Golly, Miss Molly

  5. Does that mean the computer really doesn’t work with numbers, only symbols?? Basic Data Types NO - The computer works ONLY with numeric values: The character ‘3’ is actually the numeric value: 51 The character ‘4’ is actually the numeric value: 52 The character ‘g’ is actually the numeric value: 103 Check your ASCII Tables

  6. Why are there differences?? Why isn’t the character ‘3’ stored the same way as the number 3??? Basic Data Types In order to draw the distinction between Numbers and Characters. How would the numbers 3 and 4 be stored? Basically, in the same manner in which we stored them when we first started talking about bits.

  7. This Concludes The Slides for this Section Choose an Option:  Repeat Slides for this Section  Go To Next Set of Slides For this Chapter  Go To Slide Index For Chapter 2  Go To Slide Index For Chapter 3  Go To Slide Index For Textbook  Go To Home Page

More Related