1 / 53

Computer Science Overview Chapter One-Data Storage

Computer Science Overview Chapter One-Data Storage. JainShing Wu. Data. What is data? Values of qualitative or quantitative variables, belonging to a set of items What is data in computer? 0 or 1 (binary digit => Bit). Data. Boolean True or False Ex: Earth is flat. ( x ) => False

deiondre
Télécharger la présentation

Computer Science Overview Chapter One-Data Storage

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. Computer Science OverviewChapter One-Data Storage JainShing Wu

  2. Data • What is data? • Values of qualitative or quantitative variables, belonging to a set of items • What is data in computer? • 0or 1 (binary digit => Bit)

  3. Data • Boolean • True or False • Ex: Earth is flat. (x) => False Taiwan is surrounding by the sea. (O)=>True

  4. Boolean Operation • AND OR NOT XOR

  5. AND Operation • Designed to reflect the truth or falseness of two statements 0AND 0 0 0AND 1 0 1AND 0 0 1AND 1 1 Statement : 我會愛妳到海枯石爛 => ? False Statement 1 :我會愛妳 => True Statement 2 : 海枯 AND 石爛 => False False True

  6. OR Operation • Designed to reflect the truth or falseness of two statements 0OR 0 0 0OR 1 1 1OR 0 1 1OR 1 1 Statement : 我會愛妳到海枯石爛 => ? True Statement 1 :我會愛妳 => True Statement 2 : 海枯 OR 石爛 => True False True

  7. XOR Operation • Designed to reflect the truth or falseness of two statements 0XOR 0 0 0XOR 1 1 1XOR 0 1 1XOR 1 0 Statement : 我會愛妳到海枯石爛 => ? False Statement 1 :我會愛妳 => True Statement 2 : 海枯 XOR 石爛 => True False True

  8. NOT Operation • Designed to reflect the truth or falseness of one statement NOT 1 0 NOT 0 1 Original : I will love you forever! => True Not => : I will not love you forever! => False

  9. Boolean Gates

  10. Boolean Gates

  11. Flip-Flop • Circuit • Has two stable states • Used to store state information • Demonstrates how devices can be constructed from gates • Provides an example of abstraction and the usage of abstract tools

  12. RS Flip-Flop

  13. Very Large-Scale Integration (VLSI) • Contains millions of electrical components • These components are constructed on a chip • Create miniature devices containing millions of flip-flops

  14. Hexadecimal Notation

  15. Representation of Bit Patterns • Text • American Standard Code for Information Interchange (ASCII) code • 1 Character (4 bits)

  16. Representation of Bit Patterns • Number • Integer (2 bytes) • Binary (二進位→bin)→0,1 • Octal(八進位→oct)→0,1,2,3,4,5,6,7 • Decimal(十進位→dec)→0,1,2,3,4,5,6,7,8,9 • Hexadecimal(十六進位→hex) →0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F • Floating number • Float • Double

  17. Representation of Bit Patterns • Image • Sound • Video

  18. Text • EX: Kaohsiung =>4B 61 6F 68 73 69 75 6E 67=>0100 1011 0110 0001 0110 1111 0110 1000 0111 0011 0110 1001 0111 0101 0110 1110 0110 0111

  19. Text • Lowercase letter in ASCII code is greater than Uppercase letter in ASCII code • Ex: a=> 61, A=> 41, space=> 20, • LF=> 0A, CR=> 0D

  20. Text • Problem of 中文 presentation • Too many Chinese characters • 倚天中文輸入 (Big5) • Free for campus • Using two bytes for one Chinese characters • Using high bits in first byte (129-255) and low bits in second byte • EX: “中”=> A4A4

  21. Problem of Chinese Characters • Problem of Mr. 許蓋功 • All of them has 5C in second byte • “\” used in programming language as escape character • \n 換行 (0A) • \r 歸位 (0D) • \r tab

  22. Unicode • Consistent • Encoding • Representation • Handling of text expressed in most of the world's writing systems • UTF-8 UTF-16 UTF-32

  23. Numbers in Computer • Binary system • Presentation • Calculation • Problem • Signed VS unsigned

  24. Binary System • Integer (2 Bytes) • 0~65535 (unsigned) • (0000~FFFF) • -32768~32767 (signed) • The highest bit as sign bit • 0: positive, 1: negative

  25. Binary System 12345 • EX: 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 192 385 48 771 86 12 24 0 3 1 6 3086 1543 6172 2 6172 2 3086 2 2 2 2 2 2 2 2 2 2 2 771 48 192 96 385 24 3 1 12 6 1543 2 12345 6172 3086 12 48 3 0 6 96 384 24 192 770 1542 12344 0 0 1 1 0 0 0 0 0 0 1 1 1 1

  26. Negative Number Representation • 1’ complement • 2’ complement

  27. 1’ Complement • The negative number is the complement of positive number • The highest bit represent the number is positive (0) or negative (1) • EX: 12345( 0011 0000 0011 1011)-12345( 1100 1111 1100 0100) • Range • Positive (0~32767 -> 0000~7FFF) • Negative (-1~-32768 -> FFFF~8000)

  28. Problem of 1’s complement • Zero • Positive zero and negative zero 0000 0000 0000 0000 => positive zero 1111 1111 1111 1111 => negative zero

  29. 2’ Complement • To solve the zero problem of 1’s complement • The result of 1’s complement + 1 • EX: 12345 (0011 0000 0011 1001) -12345 (1100 1111 1100 0110) 1’ complement -12345 (1100 1111 1100 0111) 2’ complement

  30. Floating Number in Computer • IEEE 754 • (-1)S * c * bq • S: signed bit (正負號)c: significand (內容值)b: base (底)q: exponent (次方)

  31. Floating Number Sign bit => 0

  32. Floating Number • Single precision • 32 bits • Double precision • 64 bits

  33. Image • Records the colors of the picture • Each dot of the picture called “pixel” • Each pixel contains the Red, Green , Blue (RGB) information

  34. Image • Types • Raw data • Bitmap (BMP) • Compressed data • JPEG, GIF, PCX, PNG,TIFF, …

  35. Sound file • Records the digital sound wave • Use computer to simulate the sound of the real musical instruments • Hatsune Miku plan • Using computer to simulate human singing song behaviors

  36. Video File • Comprises a series of orthogonal bitmap digital images displayed in rapid succession at a constant rate • Frame per second (FPS) • Large amount of data

  37. Data Storage • Memory • Mass storage • Storage on internet

  38. Memory • A storage of related data • Types of computer memory • Read only memory (ROM) • Random accessed memory (RAM)

  39. Read Only Memory (ROM) • Stored some necessary data • Ex : Initial program (BIOS) • Types of ROM • mask ROM • Programmable read-only memory (PROM) • Erased programmable read-only memory (EPROM) • Electrically Erasable Programmable Read-Only Memory (EEPROM)

  40. Random accessed memory (RAM) • Dynamic random accessed memory (DRAM) • Double data rate synchronous dynamic random-access memory (DDR SDRAM) • Non-volatile random-access memory • Flash drive

  41. Mass Storage • Store the necessary data • Types • Tape • Floppy disk • Hard disk • CDROM • Flash drive • Storage on internet

  42. Floppy Drive Arm motor Read-write head

  43. Floppy Disk • 1: High capacity disk • 2: Hub that engages with the drive motor • 3: Shutter • 4: Plastic housing • 5: Polyester sheet • 6: Magnetic coated plastic disk • 7: one sector of data on the disk • 8: Write protector

  44. Hard Disk

  45. Hard Disk • Track • Cylinder • Sector • Head

  46. Storage on Internet • Storage on mainframe • Storage on cloud

  47. Storage on Mainframe • Mainframe provides large storage space to store data • Backup by mainframe manager • Fixed

  48. Storage on Cloud • Store data on the cloud structure • Backup by the cloud manager • Data is separated into many blocks and may be stored in different places

  49. Problem • Large amount of data => requires more storage space • Data compression

  50. Data Compression • Reducing the storage space • Using short data to represent original one • EX: WWWWWWWWWWBBBBBWWWWWWWWWWWWWWWWWWW=>W10B5W19

More Related