CS 171 Unit 4 Data Representation and Storage

CS 171 Unit 4 Data Representation and Storage - CS 171 Unit...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 171 Unit 4 Data Representation and Storage Furman Haddix Assistant Professor Minnesota State University, Mankato Spring 2011
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Learning Computer Speak Becoming familiar with basic concepts: Languages Bytes and Bits (and Nybbles) Character Representations Numeric Representations Integral Floating-point
Image of page 2
Machine Language The first language of computers Only language that a computer understands Binary – exceedingly tedious to write Language found in Object and Executable Program Files Second generation languages are assembly languages Architecture specific Must be converted (by an assembler) to machine language before execution Third generation languages are high-level languages, e.g., C++, Java Architecture independent Must be converted (by a compiler) to machine language before execution Fourth generation languages are usually functional languages, e.g., SQL (Structure Query Language for databases Architecture independent Often converted to a high-level language by a preprocessor (then compiled)
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Machine Language Representation Bits and bits (Lots of Bytes!) Usually interpreted for human consumption Binary numbers converted to decimal numbers (or hexadecimal) Character representation translations EBCDIC ASCII (C++) UNICODE (Java, XML)
Image of page 4
C++ Data Types Built-in data types Boolean bool Character char wchar_t Integral int long short Floating-point double float long double Built-in data type modifiers auto const extern signed static unsigned Library-defined data types string istream (cin from <iostream>) ostream (cout from <iostream>) ifstream (from <fstream>) ofstream (from <fstream>)
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
C++ Data Types char ASCII encoding is used to represent characters ASCII char are 128 characters, including upper and lower case letters, and decimal digits. char are 8 bits (one byte) Extended ASCII char are 256 characters (2 8 ), includes some European languages Unicode (not used in C++) intends to include all languages ever written on Earth.
Image of page 6
Bytes and Bits A bit is the smallest amount of information that can be encoded. Based on electrical concept of on and off Also thought of as 1 and 0, or true and false Historically, a byte has been many things Has varied in number of bits Today it is standard eight bits
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern