# Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.

## Presentation on theme: "Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte."— Presentation transcript:

Data Representation

Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte (KB) – 2 10 bytes MegaByte (MB) – 2 20 bytes GigaByte (GB) – 2 30 bytes

Data Representation EVERYTHING on the computer is represented using binary  Integers  Characters  Strings  Colors

Data Representation If we have 2 bits, how many different binary numbers can we make?  00, 01, 10, 11 And if we had 3? How about 4? Umm...32? A unique binary string/number represents a single thing # of bits required for representation depends on the number of symbols/measurements

How many combinations? Each bit can only be a 0 or 1 (2 choices) The number of distinct combinations of n-bits is given by 2 n

Character Representation Standardized codes  ASCII (American)  Unicode (international characters) ASCII Example:  ASCII Table ASCII Table  ASCII  Binary Converter ASCII  Binary Converter

String Representation Simple character strings are just sequences of characters Hexadecimal Example:  42 55 49 42 55 49 42 55 49 00 00 is used to terminate (end) the string

Pixel and Color Depth Pixel ~ Picture element What does an image look like when we zoom in? What does an image look like when we zoom in? An image is a matrix of numbers  Numbers ~ Colors Number of bits restricts the number colors we can use (pixel/color depth)pixel/color depth GIF vs. JPEG vs. RAW

Hexadecimal Colors RGB ~ Red, Green, Blue 8-bits used per color (24 bits total) Each color can be represented using 2 hexadecimal digits (0-9, A-F) Examples:  Red = FF0000  Green = 00FF00 How many total colors are there?

Additional Items (not required) Signed and unsigned integers  i.e. negative numbers Floating-point numbers

Download ppt "Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte."

Similar presentations