Storing Information 9278 9279 9280 9281 9282 9283 9284 9285 9286 Each memory cell stores a set number of bits (usually 8 bits, or one byte) (byte addressable)

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

CSci 1130 Intro to Programming in Java
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
1 C++ Syntax and Semantics The Development Process.
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Constants and Data Types Constants Data Types Reading for this class: L&L,
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
Introduction to C Programming CE Lecture 2 Basics of C programming.
ECE122 L3: Expression Evaluation February 6, 2007 ECE 122 Engineering Problem Solving with Java Lecture 3 Expression Evaluation and Program Interaction.
1 Key Concepts:  Data types in C.  What is a variable?  Variable Declaration  Variable Initialization  Printf()  Scanf()  Working with numbers in.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
Variables, Constants and Built-in Data Types Chapter 2: Java Fundamentals.
Representation and Conversion of Numeric Types 4 We have seen multiple data types that C provides for numbers: int and double 4 What differences are there.
String Escape Sequences
1 Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class:
CSCI 1100/1202 January 16, Why do we need variables? To store intermediate results in a long computation. To store a value that is used more than.
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
Outline Character Strings Variables and Assignment Primitive Data Types Expressions Data Conversion Interactive Programs Graphics Applets Drawing Shapes.
CISC105 – General Computer Science Class 9 – 07/03/2006.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
Primitive Variables.
Numeric types of C Integers – Signed and unsigned – In a few different sizes – 209 Floating point – In different sizes –
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
Assignment An assignment statement changes the value of a variable The assignment operator is the = sign total = 55; Copyright © 2012 Pearson Education,
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Primitive Variables.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
Copyright Curt Hill Variables What are they? Why do we need them?
© 2011 Pearson Education, publishing as Addison-Wesley Monday  Class Requirements  Earn hawk points today with the Name Game  Network Login.
Info stored in computer (memory) Numbers All in binaray – can be converted to octal, hex Characters ASCII – 1-byte/char Unicode – 2-byte/char Unicode-table.com/en.
© 2006 Pearson Education Chapter 1: Computer Systems.
Programming in Java (COP 2250) Lecture 4 Chengyong Yang Fall, 2005.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
Computer Math CPS120: Binary Representations. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits.
Introduction to Computer Organization & Systems Topics: Types in C: floating point COMP C Part III.
Road map char data type Reading –Liang 5: Chapter 2: 2.7.4; 2.9; –Liang 6: Chapter 2: 2.7.4; 2.9 –Liang 7: Chapter 2: 2.7.4; 2.9.
Department of Electronic & Electrical Engineering Types and Memory Addresses Pointers & and * operators.
Primitive Data Types 1 In PowerPoint, point at the speaker icon, then click the "Play" button.
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Programming with Java. Chapter 1 Focuses on: –components of a computer –how those components interact –how computers store and manipulate information.
COM S 207 Type and Variable Instructor: Ying Cai Department of Computer Science Iowa State University
1.4 Representation of data in computer systems Character.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
© 2004 Pearson Addison-Wesley. All rights reserved August 27, 2007 Primitive Data Types ComS 207: Programming I (in Java) Iowa State University, FALL 2007.
Fundamentals 2.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Variables Mr. Crone.
Primitive Data Types August 28, 2006 ComS 207: Programming I (in Java)
CSC 1051 – Data Structures and Algorithms I
Data Conversion & Scanner Class
EPSII 59:006 Spring 2004.
Multiple variables can be created in one declaration
Data Types The type states how much and what kind of data the variable can store. integers- whole numbers no fractional parts int, short, long floating.
CprE 185: Intro to Problem Solving (using C)
IDENTIFIERS CSC 111.
Tejalal Choudhary “Computer Programming” Fundamentals of “C”
Unit-2 Objects and Classes
Computers & Programming Languages
Introduction to Java Programming
Escape Sequences Some Java escape sequences: See Roses.java (page 68)
Fundamentals 2.
Chapter 2: Java Fundamentals
Presenting information as bit patterns
Data Types Imran Rashid CTO at ManiWeber Technologies.
Chapter # 2 Part 2 Programs And data
Chapter 2: Java Fundamentals
Chap 2. Identifiers, Keywords, and Types
Presentation transcript:

Storing Information 9278 9279 9280 9281 9282 9283 9284 9285 9286 Each memory cell stores a set number of bits (usually 8 bits, or one byte) (byte addressable) 10011010 Large values are stored in consecutive memory locations

Bit Permutations 1 bit 1 2 bits 00 01 10 11 3 bits 000 001 010 011 100 1 2 bits 00 01 10 11 3 bits 000 001 010 011 100 101 110 111 4 bits 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Each additional bit doubles the number of possible permutations

Numeric Primitive Data The difference between the various numeric primitive types is their size, and therefore the values they can store: Type byte short int long float double Storage 8 bits 16 bits 32 bits 64 bits Min Value -128 -32,768 -2,147,483,648 < -9 x 1018 +/- 3.4 x 1038 with 7 significant digits +/- 1.7 x 10308 with 15 significant digits Max Value 127 32,767 2,147,483,647 > 9 x 1018

Representing Text Digitally For example, every character is stored as a number, including spaces, digits, and punctuation Corresponding upper and lower case letters are separate characters H i , H e a t h e r . 72 105 44 32 72 101 97 116 104 101 114 46