Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.

Slides:



Advertisements
Similar presentations
Data Representation. Units & Prefixes Review kilo, mega, and giga are different in binary! bit (b) – binary digit Byte (B) – 8 binary digits KiloByte.
Advertisements

1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
The Binary Numbering Systems
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Data Representation Computer Organization &
Data Representation COE 205
Connecting with Computer Science, 2e
Representing Information as Bit Patterns
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Chapter 3 Data Representation.
Introduction to Programming with Java, for Beginners
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
Binary and Hexadecimal Numbers
Chapter 3 Data Representation. Chapter goals Describe numbering systems and their use in data representation Compare and contrast various data representation.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
2 Systems Architecture, Fifth Edition Chapter Goals Describe numbering systems and their use in data representation Compare and contrast various data.
Binary Number Systems.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 5 Data representation.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Computing Higher - Unit 1… Computer Systems 1 Higher Computing Unit 1 – Topic 1 Data Representation.
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
Computers Organization & Assembly Language
How Computers Work Dr. John P. Abraham Professor UTPA.
Lecture 11: Machine Processing Intro to IT COSC1078 Introduction to Information Technology Lecture 11 Machine Processing James Harland
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
Programming Games Formulas. Date. Representation in [computer] Storage. Credit Card. Homework: Finish slide show. Upload application.
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
Cis303a_chapt03-2a.ppt Range Overflow Fixed length of bits to hold numeric data Can hold a maximum positive number (unsigned) X X X X X X X X X X X X X.
Homework: New coin toss. [Start dice game.]
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
DATA REPRESENTATION CHAPTER DATA TYPES Different types of data (Fig. 2.1) The computer industry uses the term “MULTIMEDIA” to define information.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
1 Information Representation in Computer Lecture Nine.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Programming Games Logic. Slide show. Range input. Storage. Datatypes. Binary numbers. Homework: Catch up. This includes uploading projects to your server.
Data Representation. What is data? Data is information that has been translated into a form that is more convenient to process As information take different.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Software Design and Development Storing Data Computing Science.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Text and Images Key Revision Points.
Invitation to Computer Science, C++ Version, Fourth Edition
Lec 3: Data Representation
Programming in Machine Language
Data Representation Binary Numbers Binary Addition
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Invitation to Computer Science, Java Version, Third Edition
Ch2: Data Representation
Data Types.
The Building Blocks: Binary Numbers, Boolean Logic, and Gates
Chapter 2 Data Representation.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
Storing Negative Integers
How Computers Store Data
A-level Computer Science
Presentation transcript:

Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.

Overview Representation of information. How is everything/anything represented 'in' the computer (in storage)? –ANSWER: everything is represented using 1s and 0s. What the 1s and 0s mean depends on what the information is, for example, the datatype whole number, number with fraction, true/false value, character string, other…

Storage Everything (data and programs) is stored in the circuitry of 'the computer'. The circuitry includes transistors that are switches: on or off states, 0 or 1. Each switch is called a bit. So….numbers are stored using the binary (base 2) system Symbols (characters, letters, etc.) are stored using agreed upon systems of encoding –ASCII: 8 bits per character –UNICODE: 16 bits per character

Why? Why not use circuits that can directly represent numbers using the decimal (base 10) system? Answer: Easier to make on/off switches than something with 10 states. Easier to build circuitry for calculations for the base 2 addition and base 2 times tables than the ones you remember…

What is stored? Numbers: binary number system Characters: ASCII or UNICODE encoding Machine instructions Composite datatypes, for example String of characters representing text –Will get to arrays Images More…

Recall base 10 Recall 1s column, 10s column, 100s column Recall borrowing (re-grouping) and carrying Do problem(s)

Base 2 Same principle –1s column, 2s column, 4s column, ???? Your age? My age? Addition –Subtraction? Multiplication?

Joke Explain joke on shirt

Bits A bit is a one or a zero (1 or 0). 3 bits can hold how many different patterns? 000, 001, 010, 011, 100, 101, 110, bits can hold how many different patterns? What is the formula?

Byte A byte is 8 bits. See in specs for computers, memory, etc. KB, Kb, Gb, GB, other. So, how many patterns, what is the biggest number, held by a byte?

Another Joke

Base 16 Hexadecimal: used for quick way to describe bits, mostly commonly for color coding Symbols used are 0, 1, 2, …, 9, A, B, C, D, E, F You have seen color coding: RGB (red, green blue) in hexadecimal FF0000 is red 00FF00 is green ??

Numbers with fraction part Aka numbers with a decimal point How to represent? ANSWER: floating point numbers aka scientific notation – * 10 2 is the same as * 10 0 –Terminology: (or ) is the mantissa or significand and the 2 (or 0) is the exponent. Computer format: use 2 or 16 in place of 10 Example using 32 bits: – 1 bit for the sign (0 for +, 1 for -) – 8 bits for the exponent –23 bits for the mantissa (width, i.e., 23, is the precision)

Characters ASCII coding The character A is represented by The character a is represented by The character 1 is represented by The character 2 is represented by …. Unicode is a 16 bit format big enough (hopefully) for all the world's languages

String of characters …such as a name or a label or a piece of text Fixed length: allocate 1 byte (8 bits) for each character –UNICODE 2 bytes Variable length: store string in two parts –One part holds length as a number and pointer (address) of the whole string –String itself

Boolean Named after George Boole True / False Theoretically: 1 bit, 0 for false, 1 for true but The addressability requirement means it could be 1 byte or even bigger String of Booleans can be combined. –A byte can represent the answer to 8 true/false questions.

Images There are several different ways to represent images. Consider this simple way: – For each pixel, have 3 bytes of information: the bytes representing the level of red, green and blue. – So, for an image 400 by 300 pixels, how many bytes required for storage?

Machine instructions: back up Processing code is translated, multi-stage process, to basic language of the computer. Very, very basic instructions: –LR Load a register (part of the Central Processing Unit (CPU) with contents at particular address –AR add values in register –JUMP to a new instruction –Etc. Contains machine instruction command and other information, such as storage addresses, in binary.

Classwork / Homework Catch up. Upload of work past due, but will get some credit. Examine images and compare different types in quality and size. Make posting on forum.