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.

Slides:



Advertisements
Similar presentations
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Advertisements

Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
COE 202: Digital Logic Design Signed Numbers
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Copyright 2008 Koren ECE666/Koren Part.1.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
UNIVERSITY OF MASSACHUSETTS Dept
Data Representation ICS 233
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
CSE20 Lecture 3 Number Systems: Negative Numbers 1.Sign and Magnitude Representation 2.1’s Complement Representation 3.2’s Complement Representation 1.
Number Systems Lecture 02.
Fixed-Point Negative Numbers Two Common Forms: 1.Signed-Magnitude Form 2.Complement Forms Signed-Magnitude Numbers First Digit is Sign Digit, Remaining.
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Binary Representation and Computer Arithmetic
Dr. Bernard Chen Ph.D. University of Central Arkansas
The Binary Number System
Data Representation Number Systems.
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Data Representation – Binary Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
General Fixed Radix Number Systems Nonredundant Positive radix, ß n digits in digit set Vector:
Computer Arithmetic Nizamettin AYDIN
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
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 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
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.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
Lecture Overview Introduction Positional Numbering System
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Number Systems. Why binary numbers? Digital systems process information in binary form. That is using 0s and 1s (LOW and HIGH, 0v and 5v). Digital designer.
CPS120: Introduction to Computer Science Computer Math: Signed Numbers.
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
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.
Computer Number Systems. d n-1 d n-2 d n d 2-m d 1-m d -m Conventional Radix Number r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } -m ≤
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
ECE 8053 Introduction to Computer Arithmetic (Website: Course & Text Content: Part 1: Number Representation.
Topic 1 – Number Systems. What is a Number System? A number system consists of an ordered set of symbols (digits) with relations defined for addition,
AEEE2031 Data Representation and Numbering Systems.
Fixed & Floating Number Format Dr. Hugh Blanton ENTC 4337/5337.
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
FAMU-FSU College of Engineering 1 Part III The Arithmetic/Logic Unit.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
IT1004: Data Representation and Organization Negative number representation.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
FAMU-FSU College of Engineering 1 Computer Architecture EEL 4713/5764, Spring 2006 Dr. Michael Frank Module #9 – Number Representations.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
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.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Data Representation COE 301 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum.
Data Representation COE 308 Computer Architecture
Chapter 2 Binary Number Systems.
Data Representation ICS 233
Data Representation.
Data Representation in Computer Systems
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Systems and Binary Numbers
Data Representation ICS 233
Data Representation COE 308 Computer Architecture
Presentation transcript:

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 the integral part of the number, X I, in the  d system : R is the Desired digit (LSD) – Can Repeatedly Divide to Obtain Converted Value Consider the integral part of the number, X I, in the  d system : If X I is divided by  d, we obtain x 0 as a remainder and quotient

Radix Conversion Example X I =  s =10  d =3 Fixed-point Decimal to Ternary Integer Conversion Check by evaluating the radix polynomial X I =

Radix Conversion (fractional) Consider the fractional part of the value in  d Fixed point system Thus, P I is the Desired Digit We can Repeatedly Multiply by the  d Value

Radix Conversion Example X I =  s =10  d =5 Fixed-point Decimal to Pentary Fractional Conversion is Finite Fraction for  s =10, but infinite fraction for  d =5

Fixed Point Negative Numbers Two Common Forms: 1.Signed-magnitude Form 2.Complement Forms Signed Magnitude First Digit is Sign Digit, Remaining n-1 are the Magnitude Convention (binary) –0 is a Positive Sign bit –1 is a Negative Sign bit Convention (non-binary) –0 is a Positive Sign digit –  -1 is a Negative Sign digit Only 2  n-1 Digit Sequences are Utilized

Signed Magnitude Example Largest Representable Value is:

Signed Magnitude Example (cont)

Signed Magnitude Ternary Example Notice that fractional part is infinite in  =10 but finite in  =3

Signed Magnitude Ternary Bounds Positive Numbers: Negative Numbers: Range:

Signed Magnitude Comments Two Representations for zero, +0 and –0 Addition of +K and –K is not zero EXAMPLE Yields a Sum of –20 10 !!!!!

Complement Representations Two Types of Complement Representations 1. radix complement (binary – 2’s complement) 2. diminished radix complement (binary – 1’s complement) Positive Values Represented Same Way as Signed Magnitude for Both Types Negative Value, -Y, Represented as R-Y Where R is a Constant Obeys the Identity: Advantage is No Decisions Needed Based on Operand Sign Before Operations are Applied

Complement Representation Example If |Y|>X, Then the Answer is R-(Y-X) If X>|Y|, Then the Answer Should be X-Y –But X+(R-Y)=R+(X-Y), Thus R Must be Discarded! Solution is to Choose the Value of R Carefully X is Positive, Y is Negative, Compute X+Y Using Complement Representation

Requirements for Complementation Value, R Select R to Simplify (or Eliminate) Correction for the X>|Y| Case Calculation of Complement of Y, (R-Y) Should be Simple and Fast Definition of Complement for Single Digit, x i Definition of Complement for a Word, X

Complementation Value, R Add Word and Complement Together: Answer to Addition Now Add 1 ulp Therefore, we see that:

Radix Complement Form The Radix Complement Form is Defined When: Using  k is Convenient Since Storing Result in Register of Length n Causes MSD of 1 to be Discarded due to Finite Register Length Therefore, it is Easy to Compute the Complement of X by: 1.Take the Complement of X 2.Add 1ulp to Complement

Radix Complement Form (cont) No Correction is Needed When We have Positive X and Negative Y Such That: Since R=  k And  k is discarded Due to Finite Register Length

Radix Complement Example Since n = m + k  m=0 Therefore 1 ulp = 2 0 =1 Given X, the radix complement (2’s complement) is: Range of Positive Numbers is [0000,0111] 2’s Complement of Largest, 0111: In Radix Complement, There is a Single Representation of Zero (0000) and Each Positive Number has Corresponding Negative Number With MSB=1

Radix Complement Example In Radix Complement, There is a Single Representation of Zero (0000) and Each Positive Number has Corresponding Negative Number With MSB=1 Accounts for 1(zero)+7(pos.)+7(neg.), But Extra Bit Pattern Left One Additional Negative Number, =-8 10,  X  +7 10

Diminished Radix Complement In Diminished Radix Complement, the Complementation Process is Easier Since the Addition of 1 ulp is Avoided Range of Positive Numbers is: [0000 2, ]=[0 10,7 10 ] 1’s Complement of Largest is = ’s Complement of Zero is Two Representations of Zero! In All Cases MSB is Sign Bit

Comparison of Two’s Complement, One’s Complement and Signed-Magnitude SequenceTwo’s Complement One’s Complement Signed- Magnitude