1 / 15

Representing Nonnumeric Data

Representing Nonnumeric Data. Everything is really a number. Its all 1’s and 0’s. How do we represent other things? Words/Pictures/Sound? The trick is to come up with an encoding scheme…. Text. To store English we need Letters (upper case & lower) Punctuation

abel-black
Download Presentation

Representing Nonnumeric Data

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. Representing Nonnumeric Data Everything is really a number

  2. Its all 1’s and 0’s • How do we represent other things? • Words/Pictures/Sound? • The trick is to come up with an encoding scheme…

  3. Text • To store English we need • Letters (upper case & lower) • Punctuation • Special marks (space, newline, etc…) • Assigned each a number between 0 and 127 • A is 65, B is 66… • a is 97, b is 98… • ASCII encoding : most popular such scheme

  4. ASCII table • Partial table  • Full Table:http://www.ascii-code.com/ • A = 65 = 01000001 • My name:

  5. Text • Why 0-127? • Well it seemed like enough • 127 is 2^7 – the biggest number you can write with 7 binary digits. • Need more characters? • Extended ASCII – 8 bits (1 byte) – 256 characters • Make your own encoding scheme:http://en.wikipedia.org/wiki/Character_encoding • Unicode – universal scheme – up to 4 bytes per character

  6. Basic Types of Graphics • Two basic types of 2D graphic Bitmap Vector

  7. Bitmaps • Image divided into pixels • Each pixel either on (1) or off (0)

  8. Adding gray • 2 digits for each square give 4 “colors” (00, 01, 10, 11)

  9. Adding gray • 2 digits for each square give 4 “colors” (00, 01, 10, 11)

  10. Bit Depth

  11. Vector Art • Vector images are mathematically based • Everything described as lines and curves • Shapes are filled with solid color, gradients or patterns

  12. Computer Sounds • Two approaches to representing sound as numbers: • MIDI sequences • Samples

  13. MIDI • Musical Instrument Digital Interface • Sheet music for your computer. • Does not store actual sounds – just instructions for generating the sounds. • Very compact • Been around since the 60’s

  14. Samples • Sounds are just pressure waves:

  15. Samples • Simulate a wave with lots of data points • Intensities at points in time • Computer reconstructs wave from points

More Related