Number Representation Part 1 Fixed-Radix Unsigned Representations ECE 645: Lecture 1.

Slides:



Advertisements
Similar presentations
Thinking Mathematically
Advertisements

Lecture - 2 Number systems and computer data formats
Radix Conversion Given a value X represented in source system with radix  s, represent the same number in a destination system with radix  d Consider.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
CHAPTER 2: Number Systems
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
ECE 331 – Digital System Design
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Number Systems Lecture 02.
Lecture 10 Fast Dividers.
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
Data Representation Number Systems.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Number Systems - Part II
ECE 8053 Introduction to Computer Arithmetic (Website: Course & Text Content: Part 1: Number Representation.
Numeral Systems Subjects: Numeral System Positional systems Decimal
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
The number systems of Computer Science
Lecture Overview Introduction Positional Numbering System
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
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.
Number Systems Ron Christensen CIS 121.
Integer Representation for People Computer Organization and Assembly Language: Module 3.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
ECE 8053 Introduction to Computer Arithmetic (Website: Course & Text Content: Part 1: Number Representation.
Number systems, Operations, and Codes
Digital Logic Lecture 2 Number Systems
CHAPTER 3: Number Systems
CHAPTER 3: Number Systems The Architecture of Computer Hardware and Systems Software & Networking: An Information Technology Approach 4th Edition, Irv.
Data Representation, Number Systems and Base Conversions
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Number Systems. Prehistory Unary, or marks: / /////// = 7 /////// + ////// = ///////////// Grouping lead to Roman Numerals: VII + V = VVII = XII Better,
Digital Systems Digital Logic and Design Dr. Musab Bassam Zghool Text Book: Mano Morris M. “ Digital Logic And Computer Design ”
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
FAMU-FSU College of Engineering 1 Part III The Arithmetic/Logic Unit.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Number Representation Lecture Topics How are numeric data items actually stored in computer memory? How much space (memory locations) is.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE 3110: Introduction to Digital Systems Number Systems.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
CHAPTER 3: Number Systems
FAMU-FSU College of Engineering 1 Computer Architecture EEL 4713/5764, Spring 2006 Dr. Michael Frank Module #9 – Number Representations.
Number Representation Part 1 ECE 645: Lecture 4. Required Reading Chapter 1, Numbers and Arithmetic, Sections Chapter 2, Representing Signed Numbers.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
Number Representation Part 1 ECE 645: Lecture 4. Required Reading Chapter 1, Numbers and Arithmetic, Sections Chapter 2, Representing Signed Numbers.
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
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.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Chapter 2 Binary Number Systems.
Introduction To Number Systems
Number Representation
Part III The Arithmetic/Logic Unit
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Fixed-Point Representations.
Number Representation
Number Systems Lab session 1 Xuan Guo.
Chapter 3 Data Representation
Number System conversions
Data Structures Mohammed Thajeel To the second year students
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Introduction To Number Systems
Presentation transcript:

Number Representation Part 1 Fixed-Radix Unsigned Representations ECE 645: Lecture 1

Required Reading Chapter 1, Numbers and Arithmetic, Sections B. Parhami, Computer Arithmetic: Algorithms and Hardware Design J-P. Deschamps, G. Bioul, G. Sutter, Synthesis of Arithmetic Circuits: FPGA, ASIC and Embedded Systems, Chapter 1, Introduction Chapter Weighted systems

Codes for Numbers Egyptian –~4000 BC –“Sum of Symbols” =1 =10 =100 = (34) 10

Positional Code for Numbers Babylonians –Positional system –2000 BC –Radix 60 – = 1 = 10

Babylonian Example 1 x x x 60 0 = (4,856) 10

Positional Code with Zero Zero Represented by Space –Partial solution –What about trailing zeros? Babylonians Introduced New Symbol – or –4th to 1st Century BC Zero Allows Representation of Fractions –Fractions started with zero

Mixed System Roman Numerals –Sum of all symbols –I=1 V=5 X=10 L=50 C=100 D=500 M=1000 –Difficult to do arithmetic –e.g.,

Hindu-Arabic Numeral System Brahmi numerals, India, 400 BC-400 AD Evolution of numerals in early Europe

Positional Code Decimal System –Documented in the 9th century –Position of coefficient determines its value –Coefficient in position is multiplied by radix (10) raised to the power determined by its position, e.g.,

Migration of Positional Notation ~750 AD –Zero spread from India to Arabic countries ~1250 AD –Zero spread to Europe Importance of Zero –Ease of arithmetic which leads to improved commerce

Binary Number System Binary –Positional number system –Two symbols, B = { 0, 1 } –Easily implemented using switches –Easy to implement in electronic circuitry –Algebra invented by George Boole ( ) allows easy manipulation of symbols

12 Modern Arithmetic and Number Systems Modern number systems used in digital arithmetic can be broadly classified as: Fixed-point number representation systems Integers Rational numbers of the form x = a/2 f, a is an integer, f is a positive integer Floating-point number representation systems x * b E, where x is a rational number, b the integer base, and E the exponent Note that all digital numbers are eventually coded in bits {0,1} on a computer

13 fixed point floating point Encoding Numbers in 4-Bits

Number system Positional Non-positional Fixed-radixMixed-radix ConventionalUnconventional Signed-digit Non-redundantRedundant Binary Decimal Hexadecimal Classification of number systems (1)

Classification of number systems (2) Positional w i - weight of the digit x i Fixed-radix r - radix of the number system Conventional fixed-radix r integer, r > 0 x i  {0, 1, …, r-1}

Classification of number systems (3) Unconventional fixed-radix x i  {- , …,  } Non-redundant number of digits =  +  + 1  r Redundantnumber of digits =  +  + 1 > r Signed-digit  >0  negative digits

Integral and fractional part X = x k-1 x k-2 … x 1 x 0. x -1 x -2 … x -l Integral partFractional part Radix point NOT stored in the register understood to be in a fixed position Fixed-point representation

Fixed-Radix Conventional (Unsigned) Representations

19 Fixed Point Number system Positional Non-positional Fixed-radixMixed-radix Conventional (unsigned) Unconventional (signed) Signed-digit Non-redundantRedundant Binary Decimal Hexadecimal Fixed-Radix Conventional Number Systems

Range of numbers Decimal X = (x k-1 x k-2 … x 1 x 0.x -1 … x -l ) 10 X min X max 10 k l 0 Binary Number system X = (x k-1 x k-2 … x 1 x 0.x -1 … x -l ) k - 2 -l Conventional fixed-radix X = (x k-1 x k-2 … x 1 x 0.x -1 … x -l ) r 0r k - r -l ulp = r -l Notation: unit in the least significant position unit in the last position

Number of digits Number system Number of digits in the integer part necessary to cover the range 0..X max Decimal Binary Conventional fixed-radix

22 Radix Conversion Option 1) Radix conversion, using arithmetic in the old radix r Convenient when converting from r = 10 or familiar radix u =w. v = ( x k–1 x k–2... x 1 x 0. x –1 x –2... x –l ) r Old =( X K–1 X K–2... X 1 X 0. X –1 X –2... X –L ) R New Option 2) Radix conversion, using arithmetic in the new radix R Convenient when converting to R = 10 or familiar radix Whole partFractional part Example: (31) eight = (25) ten From: Parhami, Computer Arithmetic: Algorithms and Hardware Design Two methods:

23 Option 1: Arithmetic in old radix r Converting whole part w:(105) ten = (?) five Repeatedly divide by fiveQuotientRemainder Therefore, (105) ten = (410) five Converting fractional part v:( ) ten = (410.?) five Repeatedly multiply by fiveWhole PartFraction Therefore, ( ) ten  ( ) five From: Parhami, Computer Arithmetic: Algorithms and Hardware Design

Radix Conversion of the Integral Part X I = (x k-1 x k-2 … x 1 x 0 ) R = = R - destination radix = ((...((x k-1 R + x k-2 ) R + x k-3 ) R + … + x 2 ) R + x 1 ) R + x 0 Quotient Remainder (...((x k-1 R + x k-2 ) R + x k-3 ) R + … + x 2 ) R + x 1 x0x0...((x k-1 R + x k-2 ) R + x k-3 ) R + … + x 2 x1x1 x k-1 x k-2 x k-1 0 ……….

Radix Conversion of the Fractional Part X F = (. x -1 x -2 … x -l+1 x -l ) R = = R - destination radix = R -1 (x -1 + R -1 (x -2 + R -1 (…. + R -1 ( x -l+1 + R -1 x -l )….))) Integer partFractional part x -1 R -1 (x -2 + R -1 (….. + R -1 ( x -l+1 + R -1 x -l )….)) R -1 (….. + R -1 ( x -l+1 + R -1 x -l )….) x -2 …………………………………. x -l+1 R -1 x -l x -l...

26 Option 2: Arithmetic in new radix R Converting (22033) five = (?) ten ((((2  5) + 2)  5 + 0)  5 + 3)  |-----| : : : : 10 : : : : | | : : : 12 : : : | | : : 60 : : | | : 303 : | | 1518 Converting fractional part v: ( ) five = (105.?) ten ( ) five  5 5 =(22033) five =(1518) ten 1518 / 5 5 =1518 / 3125 = Therefore, ( ) five = ( ) ten Horner’s rule or formula From: Parhami, Computer Arithmetic: Algorithms and Hardware Design

27 Option 2 cont'd: Horner's rule for fractions Converting fractional part v: ( ) five = (?) ten (((((3 / 5) + 3) / 5 + 0) / 5 + 2) / 5 + 2) / 5 |-----| : : : : 0.6 : : : : | | : : : 3.6 : : : | | : : 0.72 : : | | : : | | | | Horner’s rule or formula From: Parhami, Computer Arithmetic: Algorithms and Hardware Design Horner’s rule is also applicable: Proceed from right to left and use division instead of multiplication

28 r=b g  b  R=b G 4=2 2  2  8=2 3 ( ) 4 = ( ) 2 = (261.62) 8 Radix Conversion Shortcut for r=b g, R=b G Trick here is to first convert to a number in radix b, then to R Cluster in groups of 3 (because 2 3 = 8) moving away from binary point