Dr. Clincy Professor of CS

Slides:



Advertisements
Similar presentations
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Advertisements

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
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Lecture 8 Floating point format
Binary Representation and Computer Arithmetic
The Binary Number System
Data Representation Number Systems.
CSC 221 Computer Organization and Assembly Language
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Simple Data Type Representation and conversion of numbers
Information Representation (Level ISA3) Floating point numbers.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
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.
Topic 2 – Introduction to Computer Codes. Computer Codes A code is a systematic use of a given set of symbols for representing information. As an example,
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Data Representation in Computer Systems
Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted.
Binary Fractions. Fractions A radix separates the integer part from the fraction part of a number Columns to the right of the radix have negative.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CSC 221 Computer Organization and Assembly Language
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Cosc 2150: Computer Organization Chapter 9, Part 3 Floating point numbers.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
William Stallings Computer Organization and Architecture 8th Edition
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Backgrounder: Binary Math
Binary Fractions.
Dr. Clincy Professor of CS
Computer Science 210 Computer Organization
A brief comparison of integer and double representation
Dr. Clincy Professor of CS
Lecture No. 4 Number Systems
Introduction To Computer Science
Dr. Clincy Professor of CS
Number Systems and Binary Arithmetic
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
William Stallings Computer Organization and Architecture 7th Edition
Dr. Clincy Professor of CS
Data Structures Mohammed Thajeel To the second year students
Luddy Harrison CS433G Spring 2007
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Number Representations
Data Representation Data Types Complements Fixed Point Representation
EEL 3705 / 3705L Digital Logic Design
Dr. Clincy Professor of CS
Computer Science 210 Computer Organization
Arithmetic Logical Unit
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
ECEG-3202 Computer Architecture and Organization
Floating Point Numbers - continuing
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Topic 3d Representation of Real Numbers
Chapter3 Fixed Point Representation
Numbers with fractions Could be done in pure binary
Number Representations
1.6) Storing Integer: 1.7) storing fraction:
Chapter 1 Introduction.
Presentation transcript:

Dr. Clincy Professor of CS CS 3501 - Chapter 2 Dr. Clincy Professor of CS Dr. Clincy Lecture 6

Error Control Techniques Approaches Detection Simple Parity (Double Parity) – already covered Cyclic Redundancy Checksum – already covered Error correction Hamming Approach Dr. Clincy Lecture 6

Understanding Hamming Distance Concept Dr. Clincy Lecture 6

Error Correction – Hamming Code Concept Computers make errors occasionally due to voltage spikes and etc. Recall Encoding Concept – codes representing characters Hamming Distance of 1: change in 1 bit creates a new code A-000 D-001 F-110 C-011 H-101 G-111 B-010 E-100 What happens with 1 bit in error ? Dr. Clincy Lecture 6

Hamming Distance of 2 What happens with 1 bit in error ? 001 C-110 B-011 D-101 111 010 100 What happens with 1 bit in error ? What happens with 2 bits in error ? Dr. Clincy Lecture 6

Hamming Distance of 3 What happens with 1 bit in error ? 001 110 011 101 B-111 010 100 What happens with 1 bit in error ? What happens with 2 bits in error ? What happens with 3 bits in error ? Dr. Clincy Lecture 6

Hamming Error Correcting Approach 1st: Determine the number of parity bits to add to the code word for checking 2nd: determine bit positions of each added parity bits 3rd: Determine what each parity bit checks Dr. Clincy Lecture 6

Hamming Code Example (Understand the “how” vs “why”) Example: Given a 4-bit code and even parity request – recall parity Determine number of parity bits to add: 20=1, 21=2, 22=4: also determine bit positions of parity bits – 1, 2 and 4 (with labels C1, C2 and C4) Let the 4-bit code have labels I3, I5, I6 and I7 due to the parity bit positions Therefore the seven bits would be transmitted in the following order: C1 C2 I3 C4 I5 I6 I7 Determine what each parity bit checks: add the parity positions to determine this (must be less than or equal to 7 in this case): C1 case: 1+2=3, 1+4=5, 1+2+4=7; C2 case: 2+1=3, 2+1+4=7, 2+4=6; C4 case: 4+1=5, 4+2=6, 4+2+1=7 For example, transmitting the 4-bit code of 0101 (I3I5I6I7) would be 0100101 (red bits are parity bits) If I3 was corrupted during transmission, C1 and C2 would detect it (1+2=3) If I5 was corrupted during transmission, C1 and C4 would detect it (1+4=5) If I6 was corrupted during transmission, C2 and C4 would detect it (2+4=6) If I7 was corrupted during transmission, C1 , C2 and C4 would detect it (1+2+4=7) Dr. Clincy Lecture 6

Floating Point Numbers Dr. Clincy Lecture 6

Floating-Point Representation The signed magnitude, one’s complement, and two’s complement representation that we have just presented deal with signed integer values only. Without modification, these formats are not useful in scientific or business applications that deal with real number values. Floating-point representation solves this problem. For example, how would 123.44 be stored compared to 12344 ? How can we use the existing infrastructure of the computer to store real numbers ? Dr. Clincy Lecture 6

Scientific-Notation Vs Floating-Point Representation Computers use a form of scientific notation for floating-point representation Numbers written in scientific notation have three components: Computer representation of a floating-point number consists of three fixed-size fields: Size determines range Size determines precision Dr. Clincy Lecture 6

Floating-Point Representation Floating-point numbers allow an arbitrary number of decimal places to the right of the decimal point. For example: 0.5  0.25 = 0.125 They are often expressed in scientific notation. For example: 0.125 = 1.25  10-1 5,000,000 = 5.0  106 Dr. Clincy Lecture 6

The Concept Dr. Clincy Lecture 6

The Simple Model We introduce a hypothetical “Simple Model” to explain the concepts In this model: A floating-point number is 14 bits in length The exponent field is 5 bits The significand field is 8 bits The significand is always preceded by an implied binary point. Thus, the significand always contains a fractional binary value. The exponent indicates the power of 2 by which the significand is multiplied. Dr. Clincy Lecture 6

Simple Model Illustrated Example: Express 3210 in the simplified 14-bit floating-point model. We know that 32 is 25. So in (binary) scientific notation 32 = 1.0 x 25 = 0.1 x 26. In a moment, we’ll explain why we prefer the second notation versus the first. Using this information, we put 110 (= 610) in the exponent field and 1 in the significand as shown. Dr. Clincy Lecture 6

Problems with the Simple Model The illustrations shown at the right are all equivalent representations for 32 using our simplified model. Not only do these synonymous representations waste space, but they can also cause confusion. Another problem with our system is that we have made no allowances for negative exponents. We have no way to express 0.5 (=2 -1)! (Notice that there is no sign in the exponent field.) All of these problems can be fixed with no changes to our basic model. Dr. Clincy Lecture 6

Normalization To resolve the problem of synonymous forms, we establish a rule that the first digit of the significand must be 1, with no ones to the left of the radix point. This process, called normalization, results in a unique pattern for each floating-point number. In our simple model, all significands must have the form 0.1xxxxxxxx For example, 4.5 = 100.1 x 20 = 1.001 x 22 = 0.1001 x 23. The last expression is correctly normalized. In our simple instructional model, we use no implied bits. Dr. Clincy Lecture 6

Negative Exponents To provide for negative exponents, we will use a biased exponent. A bias is a number that is approximately midway in the range of values expressible by the exponent. We subtract the bias from the value in the exponent to determine its true value. In our case, we have a 5-bit exponent. We will use 16 for our bias. This is called excess-16 representation. In our model, exponent values greater than 16 are positive. an exponent of 4, would be 16+4=20 an exponent of 10, would be 16+10=26 In our model, exponent values less than 16 are negative, representing fractional numbers. an exponent of -4, would be 16-4=12 an exponent of -10, would be 16-10=6 Dr. Clincy Lecture 6

Examples Example 1: Example 2: Express 3210 in the revised 14-bit floating-point model. We know that 32 = 1.0 x 25 = 0.1 x 26. To use our excess 16 biased exponent, we add 16 to 6, giving 2210 (=101102). So we have: Example 2: Express 0.062510 in the revised 14-bit floating-point model. We know that 0.0625 is 2-4. So in (binary) scientific notation 0.0625 = 1.0 x 2-4 = 0.1 x 2 -3. To use our excess 16 biased exponent, we add 16 to -3, giving 1310 (=011012). Dr. Clincy Lecture 6

Another Example Example: Express -26.62510 in the revised 14-bit floating-point model. We find 26.62510 = 11010.1012. Normalizing, we have: 26.62510 = 0.11010101 x 2 5. To use our excess 16 biased exponent, we add 16 to 5, giving 2110 (=101012). We also need a 1 in the sign bit. Dr. Clincy Lecture 6