110 likes | 119 Views
Bits & Bytes How Computers Represent Data. Data Representation. How do computers represent data?. Computers are digital and use electricity: Recognize only two discrete states: on or off Use binary system with two unique digits: 0(off) and 1(on), called bits ( bi nary digi ts ).
E N D
Data Representation How do computers represent data? Computers are digital and use electricity: • Recognize only two discrete states: on or off • Use binary system with two unique digits: 0(off) and 1(on), called bits (binary digits)
Data Representation What is a byte? • 8 bits grouped together as a unit • Provides 256 different combinations of 0s and 1s • Allows representation of 256 individual characters • Numbers, uppercase/lowercase letters and punctuation marks
Data Representation • Decimal – base 10 • Each position can have 10 values: • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 • Binary – base 2 • Each position can have 2 values: • 0, 1 • Hexadecimal – base 16 • Each position can have 16 values: • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Kilo, Mega, Giga, Tera … Storage of data (bits & bytes) is often categorized as: Kilo (KB) • Roughly 1,000; actually 210 (1,024) Mega (MB) • Roughly 1,000,000; actually 220 (1,048,576) Giga (GB) • Roughly 1,000,000,000; actually 230 (1,073,741,824) Tera (TB) • Roughly 1,000,000,000,000; actually 240 (1,099,511,627,776) Peta (PB) • Roughly 1,000,000,000,000,000; actually 250 (1,125,899,900,000,000) Exa, Zetta, Yotta…
Text Representation What are the popular coding systems to represent text? • ASCII (8 bit) - American Standard Code for Information Interchange - most common today (typically only uses 7 bits) • EBCDIC (8 bit) - Extended Binary Coded Decimal Interchange Code – IBM mainframes • Unicode (16 bit) – newer coding scheme capable of representing allworld’s languages
Text Representation - ASCII Decimal | Hexadecimal | Character | Binary • http://www.beginningtoseethelight.org/ascii/index.htm
Text Representation – ASCII Extended Decimal | Hexadecimal | Character | Binary • http://www.beginningtoseethelight.org/ascii/index.htm
Text Representation – Unicode Unicode includes same codes as ASCII with either a prefixed or suffixed null character as well as many others • http://www.beginningtoseethelight.org/ascii/index.htm
Representing Images Pixels - picture element • Grid of small points (dots) that make up an image • More pixels results in clearer /more precise image Two Methods • Bit-mapped graphics • Use bytes – each pixel represented by an array of bits • Vector graphics • Image comprised of points, lines, curves, and shapes • Use mathematical formulas to define and represent image