Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representing Nonnumeric Data

Similar presentations


Presentation on theme: "Representing Nonnumeric Data"— 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?

3 Text To store English we need Letters (upper case & lower) Punctuation
Special marks (space, newline, etc…)

4 Text To store English we need Assign each a number
Letters (upper case & lower) Punctuation Special marks (space, newline, etc…) Assign each a number ASCII encoding : most popular such scheme

5 ASCII table Partial table  Full Table: http://www.ascii-code.com/
DEC OCT HEX BIN Symbol 47 057 2F / 48 060 30 49 061 31 1 50 062 32 2 51 063 33 3 52 064 34 4 53 065 35 5 54 066 36 6 55 067 37 7 56 070 38 8 57 071 39 9 58 072 3A : 59 073 3B ; 60 074 3C < 61 075 3D = 62 076 3E > 63 077 3F ? 64 100 40 @ 65 101 41 A 66 102 42 B 67 103 43 C 68 104 44 D 69 105 45 E 70 106 46 F 71 107 G 72 110 H 73 111 I Partial table  Full Table: A = 65 = My name: A n d r e w

6 Text Why 0-127? Need more characters? 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 Unicode – universal scheme – up to 4 bytes per character

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 Image Size Image is 2000 pixels wide & 1000 pixels tall.
2000 x 1000 = 2,000,000 pixels Bits per Pixel 24 8 1 Number Colors 16,777,216 256 (color) 256 (grays) 2 Image Size 48,000,000 bits or ~5.7 MBytes 16,000,000 bits or ~1.9 MBytes 2,000,000 bits or ~244 KBytes

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


Download ppt "Representing Nonnumeric Data"

Similar presentations


Ads by Google