Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.

Slides:



Advertisements
Similar presentations
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

Lecture - 2 Number systems and computer data formats
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Connecting with Computer Science, 2e
Representing Information as Bit Patterns
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Data Representation in Computers
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Binary and Decimal Numbers
The Binary Number System
Chapter 3 Data Representation Text Characters. 2 Representing Text To represent a text document in digital form, we need to be able to represent every.
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.
Binary Representation and Computer Arithmetic
Dr. Bernard Chen Ph.D. University of Central Arkansas
Data Representation in Computers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Binary Arithmetic & Data representation
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
3-1 Data and Computers Computers are multimedia devices, dealing with a vast array of information categories. Computers store, present, and help us modify.
Number Systems Spring Semester 2013Programming and Data Structure1.
1 Problem Solving using computers Data.. Representation & storage Representation of Numeric data The Binary System.
Chapter 03 Data Representation. 2 Chapter Goals Distinguish between analog and digital information Explain data compression and calculate compression.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Data Representation, Number Systems and Base Conversions
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Data Representation.
Chapter 2 Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in.
Floating Point Binary A2 Computing OCR Module 2509.
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,
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Computer Math CPS120 Introduction to Computer Science Lecture 7.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Backgrounder: Binary Math
Chapter 3 Data Representation Text Characters
NUMBER SYSTEMS.
Data Representation.
Chapter 02 Nell Dale & John Lewis.
Number Representation
Introduction To Computer Science
Chapter 3 Data Storage.
Why use Binary? There are only four rules for addition in binary compared to 100 in decimal [0+0=0 ; 0+1=1 ; 1+0=1; 1+1=10]
Data Encoding Characters.
Representation of real numbers
Chapter 3 - Binary Numbering System
Presentation transcript:

Computer Math CPS120: Data Representation

Representing Data The computer knows the type of data stored in a particular location from the context in which the data are being used; –i.e. individual bytes, a word, a longword, etc – Bytes: 99 (10, 101 (10, 68 (10, 64 (10 Two byte words: 24,445 (10 and 17,472 (10 Longword: 1,667,580,992 (10

2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers A value less than 0, with a – sign Examples: -24, -1, , -32 Numbers

3 Integers A natural number, a negative number, zero Examples: 249, 0, , - 32 Rational Numbers An integer or the quotient of two integers Examples: -249, -1, 0, ¼, - ½ Numbers (Cont’d)

4 How many ones are there in 642? ? Or is it ? -- Octal Or maybe… ? -- Hexadecimal Natural Numbers

5 642 is in BASE 10 The base of a number determines the number of digits and the value of digit positions Natural Numbers

6 Continuing with our example… 642 in base 10 positional notation is: 6 x 10² = 6 x 100 = x 10¹ = 4 x 10 = x 10º = 2 x 1 = 2 = 642 in base 10 This number is in base 10 The power indicates the position of the number Positional Notation

7 d n * R n-1 + d n-1 * R n d 2 * R + d 1 As a formula: 642 is: 6 3 * * R is the base of the number n is the number of digits in the number d is the digit in the i th position in the number Positional Notation

68 What if 642 has the base of 13? 642 in base 13 is equivalent to 1068 in base x 13² = 6 x 169 = x 13¹ = 4 x 13 = x 13º = 2 x 1 = 2 = 1068 in base 10 Positional Notation

Representing Real Numbers Real numbers have a whole part and a fractional part. For example , , 357.0, and the digits represent values according to their position, and those position values are relative to the base. The positions to the right of the decimal point are the tenths position (10 -1 or one tenth), the hundredths position (10 -2 or one hundredth), etc.

Representing Real Numbers (Cont’d) In binary, the same rules apply but the base value is 2. Since we are not working in base 10, the decimal point is referred to as a radix point. The positions to the right of the radix point in binary are the halves position (2 -1 or one half), the quarters position (2 -2 or one quarter), etc.

Representing Real Numbers (Cont’d) A real value in base 10 can be defined by the following formula: The representation is called floating point because the number of digits is fixed but the radix point floats.

Representing Real Numbers (Cont’d) Likewise, a binary floating –point value is defined by the following formula: sign * mantissa * 2 exp

Representing Real Numbers (Cont’d) Scientific notation is a term with which you may already be familiar, so we mention it here. Scientific notation is a form of floating-point representation in which the decimal point is kept to the right of the leftmost digit. For example, would be written as E+4 in scientific notation.

Representing Text To represent a text document in digital form, we simply need to be able to represent every possible character that may appear. There are finite number of characters to represent. So the general approach for representing characters is to list them all and assign each a binary string. A character set is simply a list of characters and the codes used to represent each one. By agreeing to use a particular character set, computer manufacturers have made the processing of text data easier.

Alphanumeric Codes American Standard Code for Information Interchange (ASCII) –7-bit code –Since the unit of storage is a bit, all ASCII codes are represented by 8 bits, with a zero in the most significant digit – H e l l o W o r l d – C 6C 6F F 72 6C 64 Extended Binary Coded Decimal Interchange Code (EBCDIC)

The ASCII Character Set ASCII stands for American Standard Code for Information Interchange. The ASCII character set originally used seven bits to represent each character, allowing for 128 unique characters. Later ASCII evolved so that all eight bits were used which allows for 256 characters.

The ASCII Character Set (Cont’d)

Note that the first 32 characters in the ASCII character chart do not have a simple character representation that you could print to the screen.

The Unicode Character Set The extended version of the ASCII character set is not enough for international use. The Unicode character set uses 16 bits per character. Therefore, the Unicode character set can represent 216, or over 65 thousand, characters. Unicode was designed to be a superset of ASCII. That is, the first 256 characters in the Unicode character set correspond exactly to the extended ASCII character set.

The Unicode Character Set (Cont’d) A few characters in the Unicode character set