CS 171 Unit 4 Data Representation and Storage

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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Learning Computer Speak Becoming familiar with basic concepts: Languages Bytes and Bits (and Nybbles) Character Representations Numeric Representations Integral Floating-point
Background 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)
Background image of page 3

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

View Full DocumentRight 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)
Background 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>)
Background image of page 5

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

View Full DocumentRight 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.
Background 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 Bits are numbered according to their representation starting with most significant (big-end) Numbered from left to right, from 7 to 0. Number corresponds to power of 2.
Background image of page 7

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

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

This note was uploaded on 06/28/2011 for the course CS 171 taught by Professor Ravi during the Spring '11 term at Minnesota.

Page1 / 35

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

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online