Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes There was one other problem with bytes: Compatibility Compatibility.

Similar presentations


Presentation on theme: "Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes There was one other problem with bytes: Compatibility Compatibility."— Presentation transcript:

1 Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes There was one other problem with bytes: Compatibility Compatibility Given the binary sequences: 0000000 0000001 0000010 0000011    1111110 1111101 1111110 1111111 Manufacturers Interpreted them differently Manufact. #1: A B C D    6 7 8 9 Manufact. #2: 0 1 2 3    v x y z Manufact. #3: + - * ?    TAB CR LF FF ASCII/EBCDIC

2 Page 2 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes Which is the Correct Interpretation??? Each is equally Correct Could 0000010 Could be either a ‘C’ OR a ‘2’ Could The letter ‘C’ Could be pronounced either ‘cee’ OR ‘ess’ What’s the Solution ??? ASCII The A A merican S S tandard C C ode for I I nformation I I nterchange

3 Page 3 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes Sample ASCII Codes: Binary Sequence 0000000 Value 0 Character NULL Description. NULL/Tape feed          0000111 7 BELRings Bell 0001000 8BSBack Space          000110113CRCarriage Return          001101127ESCEscape          010000032SPSpace           011000048 0Zero 0110001 491One          100000165ACapital ‘A’ 100001066BCapital ‘B’          110000197aLower Case ‘a’ 110001098bLower Case ‘b’

4 Page 4 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes A Preview of Things to Come: Memorize For the first Exam Memorize the Numeric Values for: NULL Value: 0 BEL (Ring The Bell)Value: 7 BS (Backspace)Value: 8 CR (Carriage Return)Value: 13 ESC (Escape)Value: 27 SP (Space)Value: 32 The digits (0, 1, …, 9) NOTE: The Digit 0 (zero) has the value:48 The Uppercase Alphabet NOTE: The Character ‘A’ has the value:65 The Lowercase Alphabet NOTE: The Character ‘a’ has the value:97

5 Page 5 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes Are We limited to only 128 (= 2 7 ) characters ?? The STANDARD ASCII Character Set Consists of 128 Characters (as given in Addendum 1.1) Yes and no: There is an EXTENDED ASCII Character set which uses ALL 8-bits (1-byte) available (parity is NOT an issue) The extended ASCII Character set consists of 256 (= 2 8 ) characters (See Addendum 1.2) The Majority of the characters included in the extended ASCII character set are extensions of the Greco-Roman Alphabet (e.g., ß, Ü, å) or ‘graphics’ characters (e.g.,  )

6 Page 6 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes What does the term ‘ASCII file’ Mean ?? An ASCII File assumes that every 8-bits (1-byte) in the file are grouped together according to the ASCII tables Aren’t ALL Files ASCII Files ?? NO NO - As we will see later, not all data is stored according to ASCII formats That Helps (sort-of) to explain why when we display non-ASCII files we sometimes get characters such as , , , , , and 

7 Page 7 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes Do ALL computers use ASCII to Represent Symbols??? NO NO - Although most do. IBM had the first Coding Scheme (dating back to 1880) EBCDIC E xtended B BB B inary C CC C oded D DD D ecimal I II I nterchange C CC C ode EBCDIC is still used in IBM Mainframes and to store data on large reel-to-reel Tape Drives

8 Page 8 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft  Repeat Slides for this SectionRepeat Slides for this Section  Go To Slide Index For Chapter 1Go To Slide Index For Chapter 1  Go To Slide Index For Chapter 2Go To Slide Index For Chapter 2  Go To Slide Index For TextbookGo To Slide Index For Textbook  Go To Home PageGo To Home Page This Concludes The Slides for this Section Choose an Option:


Download ppt "Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes There was one other problem with bytes: Compatibility Compatibility."

Similar presentations


Ads by Google