1 / 9

Type of Information

Type of Information. Why variables matter… Any information has a “Data Type”. Why do data-types matter?. Size and Weight Data-types are means of controlling how much memory is used per “unit", and Specifying/defining what kind of operations apply to a variable. Basic Data Understanding.

bryce
Download Presentation

Type of Information

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. Type of Information Why variables matter… Any information has a “Data Type”

  2. Why do data-types matter? • Size and Weight • Data-types are means of • controlling how much memory is used per “unit", and • Specifying/defining what kind of operations apply to a variable

  3. Basic Data Understanding • How exactly is the data stored in the memory? •  binary (i.e. machine) language: 0 and 1’s • How is the number 2 represented then? • Remember that the symbol we see is NOT the value represented by it. • For example: what number do these represent? V ||||

  4. Definitions • Reference: • a single 0 or 1 is called a bit = “binary digit” • a group of 8 is called a byte. • Most data is expressed in bytes. 0010111000110111100110000001011111010110001101101010000101000100010101010001110111110100100110011001000011011101111110000100001011100001010111100011000100000100000110010011111101100101100101110001110100101111011100011100010010100100001010110000001010101100110101101111100011101001101000110111111100000001100100001011011010100101010000100000111100011111001011100111001001010101101000000000101101000010000011111111011110100111100101111101010001101011100000110000001110011110100010011110111011010100000110011000010111001110011010110001111111111011101011111110100010111100111010000010110111101100011100001011101010001001010101111011100001101011010111111000001100111110100110010100000111011100110010100111

  5. Definition – a DATA TYPE • Simply put: "The type-of-data stored in a variable" 2 bytes 8 bytes

  6. Example Remember: “A double is 8 bytes” • How many 0’s and 1’s did this last code use to store the values?

  7. Importance of planning ahead • Apollo Guidance Computer • 4 kB of magnetic core with r/w memory • 16-bit memory buffer register, to hold data words moving to and from memory • Shuttle • 5 identical redundant IBM 32-bit general purpose computers (GPCs), model AP-101 • The IBM AP-101 computers originally had about 424 kilobytes of magnetic core memory each.

  8. Lessons learned • Data types are a way of controlling memory usage and operations that can be performed • MATLAB defaults to either double or char • A double takes 8 bytes (64 bits in memory) • A char takes 2 bytes (16 bits in memory) per letter Interesting fact: Most languages require the PROGRAMMER to decide ahead of time what each variable will be! Size of documents are usually referred to in Kilo/Mega/Giga Bytes! Now you know what it means!

  9. Vocabulary • New Vocabulary: • a bit • a byte • numerical vs. text • double • char

More Related