Chapter 03 Data Representation. 2 Chapter Goals Distinguish between analog and digital information Explain data compression and calculate compression.

Slides:



Advertisements
Similar presentations
3.1 3 Data Storage Foundations of Computer Science  Cengage Learning.
Advertisements

The Binary Numbering Systems
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
James Tam Numerical Representations On The Computer: Negative And Rational Numbers How are negative and rational numbers represented on the computer? How.
Chapter 03 Data Representation
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Introduction to Programming with Java, for Beginners
Signed Numbers.
Chapter Chapter Goals Distinguish between analog and digital information. Explain data compression and calculate compression ratios.
Data Representation ICS 233
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Introduction to Computing Systems from bits & gates to C & beyond Chapter 2 Bits, Data Types & Operations Integer Representation Floating-point Representation.
Chapter 5 Data representation.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
Data Representation Number Systems.
1 Week 3: Data Representation: Negative Numbers READING: Chapter 3.
CPS120 Introduction to Computer Science Lecture 4
Chapter 3 The Information Layer: Data Representation.
Lecture 5.
Binary Representation. Binary Representation for Numbers Assume 4-bit numbers 5 as an integer  as an integer  How? 5.0 as a real number  How?
Data Representation – Binary Numbers
Chapter 3 Data Representation.
Lecture 3 Data Representation
Representing Integer Data Book : Chapter ( Subject has no point !! ) A99ACF.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Chapter 3 Data Representation (slides modified by Erin Chambers)
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
IT253: Computer Organization
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Data Representation.
Chapter 3 Representation. Key Concepts Digital vs Analog How many bits? Some standard representations Compression Methods 3-2.
3-1 Data and Computers Computers are multimedia devices, dealing with a vast array of information categories. Computers store, present, and help us modify.
CPS120: Introduction to Computer Science Computer Math: Signed Numbers.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
Bits, Data Types, and Operations Slides based on set prepared by Gregory T. Byrd, North Carolina State University.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Number Systems Revision of conversations What is a register Addition Complementation.
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.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Number Systems & Operations
1 Information Representation in Computer Lecture Nine.
CS1Q Computer Systems Lecture 2 Simon Gay. Lecture 2CS1Q Computer Systems - Simon Gay2 Binary Numbers We’ll look at some details of the representation.
Chapter 03 Data Representation. 2 Chapter Goals Distinguish between analog and digital information Explain data compression and calculate compression.
Chapter 03 Data Representation. 2 Chapter Goals Distinguish between analog and digital information Explain data compression and calculate compression.
Data Representation.
IT1004: Data Representation and Organization Negative number representation.
CPSC 171 Introduction to Computer Science Binary.
Chapter 03 Nell Dale & John Lewis. 3-2 Chapter Goals Distinguish between analog and digital information. Explain data compression and calculate compression.
HONR101 Analytics in a Big Data World Monday, January 18,
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
3.1 3 Data Storage Foundations of Computer Science  Cengage Learning.
Data Representation COE 301 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum.
Chapter 03 Data Representation.
Backgrounder: Binary Math
Data Representation.
3 Data Storage Foundations of Computer Science ã Cengage Learning.
Chapter 3 Data Storage.
Chapter 2 Bits, Data Types & Operations Integer Representation
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Chapter3 Fixed Point Representation
Presentation transcript:

Chapter 03 Data Representation

2 Chapter Goals Distinguish between analog and digital information Explain data compression and calculate compression ratios Explain the binary formats for negative and floating-point values Describe the characteristics of the ASCII and Unicode character sets Perform various types of text compression

3 Chapter Goals Explain the nature of sound and its representation Explain how RGB values define a color Distinguish between raster and vector graphics Explain temporal and spatial video compression

4 Data and Computers Computers are multimedia devices,dealing with a vast array of information categories Computers store, present, and help us modify Numbers Text Audio Images and graphics Video

5 Data compression Reduction in the amount of space needed to store the data Compression ratio The size of the compressed data divided by the size of the original data Between 0 and 1 (0% and 100%) Compression techniques can be lossless, which means the data can be retrieved without any loss of the original information lossy, which means some information may be lost in the process of compaction

6 Analog and Digital Data The world is infinite and continuous Zeno’s paradox: “That which is in locomotion must arrive at the half-way stage before it arrives at the goal. ” — Aristotle, Physics VI:9 Computers are finite and discrete! How do we represent an infinite world? We represent enough of the world to satisfy our computational needs and our senses of sight and sound Actually, there are analog computers!

7 Analog and Digital Information Information can be represented in one of two ways: analog or digital Analog data A continuous representation, analogous to the actual information it represents Digital data A discrete representation, breaking the information up into separate elements

8 Analog and Digital Information Figure 3.1 A mercury thermometer continually rises in direct proportion to the temperature Thermometer is an analog device

9 Analog and Digital Information Computers cannot work well with analog data, so we digitize the data Digitize Breaking data into pieces and representing those pieces separately Why do we use binary to represent digitized data? Price Reliability (Remember Leibniz and Babbage!)

10 Electronic Signals Important facts about electronic signals An analog signal continually fluctuates in voltage up and down A digital signal has only a high or low state, corresponding to the two binary digits All electronic signals (both analog and digital) degrade as they move down a line The voltage of the signal fluctuates due to environmental effects

11 Electronic Signals (Cont’d) Periodically, a digital signal is reclocked to regain its original shape Figure 3.2 An analog and a digital signal Figure 3.3 Degradation of analog and digital signals

12 Binary Representations One bit can be either 0 or 1 One bit can represent two things (Why?) Two bits can represent four things (Why?) How many things can three bits represent? How many things can four bits represent? How many things can eight bits represent?

Individual work: read entire Section

14 Binary Representations Bit combinations Figure 3.4 Why does the number of combinations double with every extra bit?

15 Binary Representations How many things can n bits represent? What happens every time you increase the number of bits by one? More advanced example: “one byte – two byte” representation

16 Representing Negative Values Signed-magnitude number representation The sign represents the ordering, and the digits represent the magnitude of the number

17 Representing Negative Values There is a problem with the sign-magnitude representation: plus zero and minus zero Solution: “Complement” representation

18 Ten’s complement Using two decimal digits, represent 100 numbers If unsigned, the range would be … let 1 through 49 represent 1 … 49 let 50 through 99 represent -50 … -1

19 Ten’s complement To perform addition, add the numbers and discard any carry Now you try it 48 (signed-magnitude) How does it work in the new scheme?

20 Ten’s complement A-B=A+(-B) Add the negative of the second to the first Try

21 Two’s Complement (Vertical line is easier to read) Do you notice something interesting about the left-most bit (MSB)?

22 Two’s complement on 4 bits (k = 4)

23 Two’s complement Addition and subtraction are the same as in unsigned: But ignore any Carry out of the MSB:

Have a nice weekend! Individual work: Read and take notes → up to p.62, before Number overflow End of chapter exercises 1- 6, 33, 40, 41 The first exam will be next Friday (Sept. 18), during class time. Next Wednesday is review for exam. 24

25 Two’s complement Formula to compute the negative of a number on k digits: for ten’s comp: -I = Negative(I) → 10 k - I for two’s comp:-I = Negative(I) → 2 k - I Practice: find the 8-bit two’s comp. representations of:

26 Two’s complement Q: Given a number in two’s complement, how do we find its magnitude? A: Just like for unsigned numbers, only MSB is subtracted! Practice: find the magnitudes of the following two’s comp. numbers:

27 What happens if the computed value won't fit in the given number of bits k? Overflow If k = 8 bits, adding 127 to 3 overflows … but adding -1 to 3 doesn’t! Conclusion: overflow is specific to the representation (unsigned, sign-mag., two’s comp., floating point etc.)

28 Overflow Problems occur when mapping an infinite world onto a finite machine!

29 Representing Real Numbers Real numbers A number with a whole part and a fractional part , , 357.0, and Positions to the right of the decimal point are the tenths, hundredths, thousandths etc: 10 -1, 10 -2, …

30 Representing Real Numbers Same rules apply in binary as in decimal Decimal point is actually the radix point Positions to the right of the radix point in binary are 2 -1 (one half), 2 -2 (one quarter), 2 -3 (one eighth) …

31 Representing Real Numbers 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

32 Representing Real Numbers A binary floating-point value is defined by the formula sign * mantissa * 2 exp

33 Representing Real Numbers Scientific notation A form of floating-point representation in which the decimal point is kept to the right of the leftmost digit is E+4 in scientific notation What is in scientific notation? What is in scientific notation?

This was all the material for Friday’s exam: up to and including Section 3.2 This presentation is available on the webpage Make sure you understand all the examples! Review Wednesday! 34