1 / 32

In this lecture, you will find answers to these questions

In this lecture, you will find answers to these questions. What are bits How do bits represent digital media information, such as (graphics, videos, text, …?) How do we convert among numbers having different bases: Base 2 Base 10 Base 16 (hexadecimal). Units of Storage. Bit Nibble Byte

tessa
Download Presentation

In this lecture, you will find answers to these questions

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. In this lecture, you will find answers to these questions • What are bits • How do bits represent digital media information, such as (graphics, videos, text, …?) • How do we convert among numbers having different bases: • Base 2 • Base 10 • Base 16 (hexadecimal)

  2. Units of Storage • Bit • Nibble • Byte • Kilobyte ( 1024) 2^10 • Megabyte 1,048,576 (2^20) • Gigabyte 1,073,742,824 ) ( 2^30) • Terabyte 1,099,511,627,776 (2^40) • Petabyte 1,125,899,906,842,624 (2 ^ 50) • Exabyte 1,152,921,504,606,846,976 ( 2 ^ 60) • Googlebyte126765060022822940196703205376 (2^100)

  3. Bits • In computer systems, data are stored and represented in binary digits, called bits. • 8 bits make a byte, a nibble is 4 bits • The binary digits are (0,1) • We want to be able to use these bits to represent types of digital media (sound, graphics, text…).

  4. Using 2 binary digits, how many combinations are possible? • 0,0 • 0,1 • 1,0 • 1.1 • So: 4 combinations = 2^2 (2 to the number of bits)

  5. Possible Values: 3 bits • Using n bits, can have 2 ^ n combinations • Using 3 bits => 2^3 = 8 combinations • 000 • 001 • 010 • 100 • 111 • 110 • 011 • 101

  6. Using More bits: • Can encode more information • Takes more space • Bits and color; An example • Assume we have 3-bit color • => ? colors • Maybe: • 000 black • 001 gray • …

  7. How many values can be represented using: • 8 bits? • Note: gif files have a maximum of 8 bits/pixel for color • 24 bits? • 2 ^24 • 16,777,216 • Jpg uses 24 bits/pixel • 8 bits for red, 8 for green, 8 for blue • 256 * 256 * 256 , GIF- Graphics Interchange Format Jpg – Joint Photographic Expert Group Both used to represent graphical images

  8. Relevant Number Bases: • 10 • 2 • 16 • And converting between them

  9. Decimal Notation : Base-10 • Commonly used in our daily life • Uses combinations of 10 different symbols (numerals, digits) to construct any desired value • The 10 numerals are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

  10. What do base 10 numbers mean? The decimal number 5872 may interpreted as follows. Rules: Regardless of the base, position rightmost always place value of 1 (units position) Each subsequent position = n times previous one: 1, 10, 100, 1000 ( n is the base, 10 here)… 2 (1) + 7(10)+8(100)+5(1000) + 70 + 800 + 5000 = 5872

  11. The rule (again)Place values/holders • Rightmost numeral always place holder of 1 • Each succeeding number: n * previous • Where n is the base

  12. Place Values for binary (n=2) • 1 • 2 • 4 =2(2) • 8 = 2 (4) • 16 = 2(8) • 32,… Remember: n * previous place holder

  13. Practice • List first 4 place values for • Octal (base 8)? • Hex (base) 16?

  14. Converting to base 10 • Multiply each number times the place holder and add • Place values for octal? • 1,8,64,… • 17 octal as base 10? • 7 (1)+ 1 ( 8) =15

  15. Octal base 8 and base 2 to base 10 • Place holders: 1,8,64,512,… • What would 234 base 8 be converted to base 10? • 4 (1) + 3 (8)+ 2 (64) • = 156 • What is 101 base 2 as decimal? • Place holders:1,2,4,8,16,… • 1(1) + 0(2) + 1(4) =5

  16. Hexadecimal : Base 16 • It's often used to represent colors • Numerals: • 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F • Where: • A=10 • B=11 • C=12 • D=13 • E=14 • F=15

  17. Hex and colors • What is #FF decimal? = 15 (1) + 15(16) • =15 +240 = 256 • Three color values: R,G,B • 8 bits for each color…ie • Red range (0 – 256)…256 = #FF • Green (0-256) • Blue (0-256) • Equals 2 ^24

  18. Where do we use hex? • Color Picker…used almost by every Adobe product • Two main color models: RGB and CMYK

  19. Binary Notation Base-2 • Uses combinations of 2 different numerals to construct any values • The 2 different symbols (numerals) are: 0, 1

  20. Converting any base number to decimal…extension from before • The number farthest on the right always has a place holder value of 1 • Each succeeding number is n times previous one, where n is the base • Multiply each numeral by its place holder and add • Recall Base 16 place holders: 1,16,256,… • e.g.17 base 16 = 7(1) + 1(16)=23

  21. Reverse: Convert Base-10 to Base-2 • Divide the number by 2, noting the remainder • Divide the new quotient by 2, yielding a new remainder. • Repeat until the quotient is zero • The reverse order of the sequence of the remaindersis the binary representation of the decimal number. • Question: If I divide by 2, what are the possible remainders? • Divide by 7?

  22. Base-10 to Base-2 Example To convert 1910 to binary notation: 19 / 2 = 9 remainder 1 9 / 2 = 4 remainder 1 4 / 2 = 2 remainder 0 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1

  23. Base-10 to Base-2 Example To convert 1910 to binary notation: 19 / 2 = 9 remainder 1 9 / 2 = 4 remainder 1 4 / 2 = 2 remainder 0 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 100112

  24. Using bits for text data • We assign codes (ASCII) to characters

  25. Text example: bits and text • Open Notepad • Type “Eight bits make a byte.” don’t hit enter • Save as ASCII.txt inside InClass folder • Right-click and view the properties… note the file size:23..each space takes up one character • Each character has a code (ASCII), even a space does

  26. ASCII • Properties:

  27. ASCII • stands for American Standard Code for Information Interchange • Each character requires 8 bits. Q: What’s the maximum number of ASCII Characters? • an encoding standard for text characters, including the 26-letter English alphabets and symbols in computer programs.

  28. Using bits to represent images • Bitmap/Raster images, (bmp files) such as digital photos • Stores color value of each pixel encoded as bits • 1-, 4-, 8-, 16-, 24-, and 32-bits/pixel • Vector graphics, such as graphics created in Illustrator…uses anchors and paths and math • coordinates of anchor points encoded using bits • tangent of each anchor points encoded into bits • Egs. Draw a 1” red line from x=2, y=7 to (4,9)

  29. Vectors • Anchors and tangents

  30. Rasters, bmp and Photoshop • Here is an original tiff (Tagged Image File Format) (no compression, just pixels), resaved as a bmp File>Save as bmp

  31. Using bits to represent sound • sampled audio • amplitude for each sample encoded into bitsFor CD quality audio, sample rate of 44,100 samples per second of the audio, 16 bit depth (amplitude) • Called Pulse Code Modulation …PCM

More Related