Agenda Last class: Software and extensions Today: Memory –How computers store data –Number systems –Digitization
Memory Recall: Storage Devices –How does it save info? –What form is the info?
Magnetic Tape In cassettes, VCR tapes, records, floppy disks Iron (II) oxide (red) can be magnetized to “save” info Invented: 1933 Physics 12: Electromagnetism!
Laser Discs, CD’s, DVD’s CD = Compact Disc –~1980’s DVD = Digital Video Disc –~1995 Uses a laser to read and write data A thin track goes inside to outside – m thick –5000 m long
Laser Discs, CD’s, DVD’s The track has bumps –CD players use lasers to read the bumps –That’s why it has shiny colours! Physics 11 topic
Memory Chips Uses electric circuits to “save” information –Very complex – not in class
What form is the info? How do bumps change to music or video? ???
Digitization Change into numbers Computers store info as numbers The number can only be a 0 or 1 –1 bit is a 0 or 1 –1 byte = 8 bits
Digitization How can 0 or 1 become –Numbers? (Today) –Letters? –Colours? –Pictures? –Movies? –Sounds (music, voice)?
Digitizing Numbers We use a decimal number system (base 10) –A digit can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Computers use a binary system (base 2) (1 bit) –A digit can be 0, 1 –How do you write 2? 3? 4?
Converting Numbers Write the number as powers of the base. Eg: 2468 = or 2 x x x x 10 0 Bing “ decimal to binary” Or go to Decimal-to-Binaryhttp:// Decimal-to-Binary core5/nav2tool.htmlhttp://acc6.its.brooklyn.cuny.edu/~gurwitz/ core5/nav2tool.html
Converting Numbers Write the number as powers of the base. Eg: 2468 = or 2 x x x x 10 0 Change to binary? 2468 = ? x 2 ? + ? x 2 ? + … Can only be 0 or 1
Converting Numbers Change to binary? 2468 = ? x 2 ? + ? x 2 ? + … Find the biggest power of 2 less than 2468 Subtract 2468 – 2048 = 420 Find the biggest power of 2 less than 420 Repeat…
Converting Numbers Change to decimal? _1_ + _0_ + _1_ + _0_ + _0_ + _1_ x x x 2 0 = = 41
Octal: Base 8 Binary is very long ( ), so many programs use –Octal (Base 8: ) 2468 = ?x8 ? + ?x8 ? + … –2468 = __ x __ x __ x __ x Can be 0, 1, 2, 3, 4, 5, 6, 7
Hexadecimal: Base 16 Binary is very long ( ), so many programs use –Hexadecimal (Base 16: ABCDEF) 2468 = ?x16 ? + ?x16 ? + … Hex Editor converter.phphttp:// converter.php? Can be ABCDEF
DecimalBinaryOctalHexadecimal Biggest number using 1 byte of memory? Biggest number using 2 bytes of memory?
DecimalBinaryOctalHexadecimal A Biggest number using 1 byte of memory? = ? Biggest number using 2 bytes of memory? = ?
Biggest number using 1 byte of memory? = 1x x x x x x x x x = 255 –In hexadecimal this takes 2 bits: FF = 15 x x16 1 = = 255 Using 2 bytes = 16 bits of memory? … = –In hexadecimal this takes 4 bits: FFFF = 15x x x x16 3 = = 65535
Adding You can change to decimal and then add, or just add them Binary: = ? Octal: = ? Hexadecimal: 7A + C4 = ?
Adding You can change to decimal and then add, or just add them Binary: = –22+13=35 Octal: = 1625 – = 917 Hexadecimal: 7A + C4 = 13E – = 318
Homework Worksheet on binary / octal / hexadecimal numbers Lab 2 mark is in HEXADECIMAL –So it looks like a bad mark, but really…