Number Representation Part 1

Total Page:16

File Type:pdf, Size:1020Kb

Number Representation Part 1 ECE 645: Lecture 4 Number Representation Part 1 Fixed-Point Representations. Endianness. Required Reading B. Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 1, Numbers and Arithmetic, Sections 1.1-1.6 Chapter 2, Representing Signed Numbers Endianness, from Wikipedia, the free encyclopedia http://en.wikipedia.org/wiki/Endianness Historical Representations: Ancient Egyptians Numerals (1) – ~4000 BC – “Sum of Symbols” = (34)10 Historical Representations: Ancient Egyptians Numerals (2) What number does this stone carving from Karnak represent? Historical Representations: Ancient Egyptians Numerals (3) Historical Representations: Ancient Egyptians Numerals (4) Symbol for a fraction (part): Special symbols for most commonly used fractions: Historical Representations: Ancient Babylonian Numerals (1) – First known positional system – 3100 BC – Radix 60 (sexagesimal) – Two symbols: = 1 = 10 − Integers and fractions were represented identically - a radix point was not written but rather made clear by context Babylonian Numerals: Example 1 x 602 20 x 601 56 x 600 = (4,856)10 Historical Representations: Ancient Babylonian Numerals (2) Digits from 1 to 59 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., MCDXLVII - IX ? 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., 3 2 1 0 4 *10 + 8*10 + 5*10 + 6*10 = (4,856)10 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 (1815-1864) allows easy manipulation of symbols 3 2 1 0 (0101)2 = 0*2 +1*2 + 0*2 +1*2 = (5)10 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/2f, a is an integer, f is a positive integer • Floating-point number representation systems • x * bE, 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 16 Encoding Numbers in 4-Bits −16 −14 −12 −10 −8 −6 −4 −2 0 2 4 6 8 10 12 14 16 Number format Unsigned integers Signed-magnitude ± fixed 3 + 1 fixed-point, point xxx.x Signed fraction, ±.xxx ± 2’s-compl. fraction, x.xxx 2 + 2 floating-point, s × 2 e e s floating e in [−2, 1], s in [0, 3] point 2 + 2 logarithmic (log = xx.xx) log x 17 Classification of number systems (1) Number system Positional Non-positional Fixed-radix Mixed-radix Conventional Unconventional Binary Signed-digit Decimal Hexadecimal Non-redundant Redundant Classification of number systems (2) Positional k−1 X x w w - weight of the digit x = ∑ i ⋅ i i i i=−l Fixed-radix k−1 X x ri r - radix of the number system = ∑ i ⋅ i=−l Conventional fixed-radix k−1 r integer, r > 0 X = x ⋅ ri ∑ i xi ∈ {0, 1, …, r-1} i=−l Classification of number systems (3) Unconventional fixed-radix k−1 i X x r xi ∈ {-α, …, β } = ∑ i ⋅ i=−l Signed-digit α>0 ⇒ negative digits Non-redundant number of digits = α + β + 1 ≤ r Redundant number of digits = α + β + 1 > r Example of a mixed-radix positional system? What is it? What is it? What is it? Samrat Yantra in Jantar Mantar - Jaipur, India - The largest sundial in the world - 90 feet (27 m) tall - Conceived by Maharaja Sawai Raja Jai Singh II - Built of local stone and marble 1728-1734 - The style's horizontal angle is equal the sundial's geographical latitude 27° north - The time is read by observing where the shadow is sharpest at the time - Accuracy of 2 seconds - Reconstructed in 1901 Jantar Mantar - Jaipur, India Original Units of Time - 1 day = 60 ghadis (1 ghadi = 24 minutes) - 1 ghadi = 60 pals (1 pal = 24 seconds) - 1 pal = 4 breaths (1 breath = 6 seconds) Original weights: 60*60*4 60*4 4 breaths day ghadi pal Current weights: 24*60*60 60*60 60 seconds day hour minute Fixed-point representation Integral and fractional part X = xk-1 xk-2 … x1 x0 . x-1 x-2 … x-l Integral part Fractional part Radix point • NOT stored in the register • understood to be in a fixed position Fixed-Radix Conventional (Unsigned) Representations Fixed-Radix Conventional Number Systems Fixed Point Number system Positional Non-positional Fixed-radix Mixed-radix Conventional Unconventional (signed) (unsigned) Binary Signed-digit Decimal Hexadecimal Non-redundant Redundant 29 Range of numbers Number system Xmin Xmax Decimal k -l X = (xk-1 xk-2 … x1 x0.x-1 … x-l)10 0 10 - 10 Binary k -l X = (xk-1 xk-2 … x1 x0.x-1 … x-l)2 0 2 - 2 Conventional fixed-radix k -l X = (xk-1 xk-2 … x1 x0.x-1 … x-l)r 0 r - r Notation: unit in the least significant position -l ulp = r unit in the last position Number of digits Number of digits in the integer Number system part necessary to cover the range 0..Xmax Decimal k = ⎣log10 X max ⎦+1 = = ⎡log10(X max +1)⎤ Binary k = ⎣log2 X max ⎦+1 = = ⎡log2 (X max +1)⎤ Conventional k = ⎣logr X max ⎦+1 = fixed-radix = ⎡logr (X max +1)⎤ Radix Conversion Whole part Fractional part u = w . v = ( xk–1xk–2 . x1x0 . x–1x–2 . x–l )r Old = ( XK–1XK–2 . X1X0 . X–1X–2 . X–L )R New Example: (31)eight = (25)ten Two methods: Option 1) Radix conversion, using arithmetic in the old radix r Convenient when converting from r = 10 or familiar radix Option 2) Radix conversion, using arithmetic in the new radix R Convenient when converting to R = 10 or familiar radix From: Parhami, Computer Arithmetic: Algorithms and Hardware Design 32 Option 1: Arithmetic in old radix r Converting whole part w: (105)ten = (?)five Repeatedly divide by five Quotient Remainder 105 0 21 1 4 4 0 Therefore, (105)ten = (410)five Converting fractional part v: (105.486)ten = (410.?)five Repeatedly multiply by five Whole Part Fraction .486 2 .430 2 .150 0 .750 3 .750 3 .750 Therefore, (105.486)ten ≅ (410.22033)five From: Parhami, Computer Arithmetic: Algorithms and Hardware Design 33 Radix Conversion of the Integral Part R - destination radix k−1 X = (x x … x x ) = x ⋅ R i = I k-1 k-2 1 0 R ∑ i i=0 = ((...((xk-1 R + xk-2) R + xk-3 ) R + … + x2 ) R + x1 ) R + x0 Quotient Remainder (...((xk-1 R + xk-2) R + xk-3 ) R + … + x2 ) R + x1 x0 ...((xk-1 R + xk-2) R + xk-3 ) R + … + x2 x1 ………. ………. xk-1 R + xk-2 xk-3 xk-1 xk-2 0 xk-1 Radix Conversion of the Fractional Part R - destination radix −1 i X = (. x x … x x ) = x i ⋅ R = F -1 -2 -l+1 -l R ∑ i=−l -1 -1 -1 -1 -1 = R (x-1 + R (x-2 + R (…. + R ( x-l+1 + R x-l )….))) Integer part Fractional part -1 -1 -1 -1 x-1 R (x-2 + R (….. + R ( x-l+1 + R x-l)….)) x -1 -1 -1 -2 R (….. + R ( x-l+1 + R x-l)….) ………. ………. -1 -1 x-l+2 R ( x-l+1 + R x-l) x -1 -l+1 R x-l x-l 0 Option 2: Arithmetic in new radix R Converting fractional part v: (410.22033)five = (105.?)ten 5 (0.22033)five × 5 = (22033)five = (1518)ten 5 1518 / 5 = 1518 / 3125 = 0.48576 Therefore, (410.22033)five = (105.48576)ten Converting (22033)five = (?)ten ! ((((2 × 5) + 2) × 5 + 0) × 5 + 3) × 5 + 3 ! ! |-----| : : : : ! ! 10 : : : : ! ! |-----------| : : : ! ’ ! 12 : : : !Horner s ! |---------------------| : : ! rule or ! 60 : : ! ! |-------------------------------| : !formula ! 303 : ! ! |-----------------------------------------| ! !! 1518 From: Parhami, Computer Arithmetic: Algorithms and Hardware Design 36 Option 2 cont'd: Horner's rule for fractions Horner’s rule is also applicable: Proceed from right to left and use division instead of multiplication Converting fractional part v: (0.22033)five = (?)ten ! ! ! (((((3 / 5) + 3) / 5 + 0) / 5 + 2) / 5 + 2) / 5! Horner’s |-----| : : : : ! 0.6 : : : : ! rule or |-----------| : : : ! formula 3.6 : : : ! |---------------------| : : ! 0.72 : : ! |-------------------------------| : ! 2.144 : ! |-----------------------------------------| ! 2.4288 ! |-----------------------------------------------|! 0.48576! From: Parhami, Computer Arithmetic: Algorithms and Hardware Design 37 Radix Conversion Shortcut for r=bg, R=bG r=bg → b → R=bG 4=22 → 2 → 8=23 (2301.302)4 = (10 110 001. 110 010)2 = (261.62)8 • Trick here is to first convert to a number in radix b, then to R • Cluster in groups of 3 (because 23 = 8) moving away from binary point 38 Signed Number Representations Representations of signed numbers Signed-magnitude Biased Complement Radix-complement Diminished-radix complement (Digit complement) r=2 r=2 Two’s complement One’s complement Signed- Biased Two’s One’s magnitude complement complement 7 0111 1111 0111 0111 6 0110 1110 0110 0110 5 0101 1101 0101 0101 4 0100 1100 0100 0100 3 0011 1011 0011 0011 2 0010 1010 0010 0010 1 0001 1001 0001 0001 0 0000 1000 0000 0000 -0 1000 1111 -1 1001 0111 1111 1110 -2 1010 0110 1110 1101 -3 1011 0101 1101 1100 -4 1100 0100 1100 1011 -5 1101 0011 1011 1010 -6 1110 0010 1010 1001 -7 1111 0001 1001 1000 -8 0000 1000 Signed-magnitude representation of signed numbers k-1 k-2 0 magnitude sign Advantages: • conceptual simplicity • symmetric range: -(2k-1-1) .
Recommended publications
  • Dynamical Directions in Numeration Tome 56, No 7 (2006), P
    R AN IE N R A U L E O S F D T E U L T I ’ I T N S ANNALES DE L’INSTITUT FOURIER Guy BARAT, Valérie BERTHÉ, Pierre LIARDET & Jörg THUSWALDNER Dynamical directions in numeration Tome 56, no 7 (2006), p. 1987-2092. <http://aif.cedram.org/item?id=AIF_2006__56_7_1987_0> © Association des Annales de l’institut Fourier, 2006, tous droits réservés. L’accès aux articles de la revue « Annales de l’institut Fourier » (http://aif.cedram.org/), implique l’accord avec les conditions générales d’utilisation (http://aif.cedram.org/legal/). Toute re- production en tout ou partie cet article sous quelque forme que ce soit pour tout usage autre que l’utilisation à fin strictement per- sonnelle du copiste est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright. cedram Article mis en ligne dans le cadre du Centre de diffusion des revues académiques de mathématiques http://www.cedram.org/ Ann. Inst. Fourier, Grenoble 56, 7 (2006) 1987-2092 DYNAMICAL DIRECTIONS IN NUMERATION by Guy BARAT, Valérie BERTHÉ, Pierre LIARDET & Jörg THUSWALDNER (*) Abstract. — This survey aims at giving a consistent presentation of numer- ation from a dynamical viewpoint: we focus on numeration systems, their asso- ciated compactification, and dynamical systems that can be naturally defined on them. The exposition is unified by the fibred numeration system concept. Many examples are discussed. Various numerations on rational integers, real or complex numbers are presented with special attention paid to β-numeration and its gener- alisations, abstract numeration systems and shift radix systems, as well as G-scales and odometers.
    [Show full text]
  • Zero Displacement Ternary Number System: the Most Economical Way of Representing Numbers
    Revista de Ciências da Computação, Volume III, Ano III, 2008, nº3 Zero Displacement Ternary Number System: the most economical way of representing numbers Fernando Guilherme Silvano Lobo Pimentel , Bank of Portugal, Email: [email protected] Abstract This paper concerns the efficiency of number systems. Following the identification of the most economical conventional integer number system, from a solid criteria, an improvement to such system’s representation economy is proposed which combines the representation efficiency of positional number systems without 0 with the possibility of representing the number 0. A modification to base 3 without 0 makes it possible to obtain a new number system which, according to the identified optimization criteria, becomes the most economic among all integer ones. Key Words: Positional Number Systems, Efficiency, Zero Resumo Este artigo aborda a questão da eficiência de sistemas de números. Partindo da identificação da mais económica base inteira de números de acordo com um critério preestabelecido, propõe-se um melhoramento à economia de representação nessa mesma base através da combinação da eficiência de representação de sistemas de números posicionais sem o zero com a possibilidade de representar o número zero. Uma modificação à base 3 sem zero permite a obtenção de um novo sistema de números que, de acordo com o critério de optimização identificado, é o sistema de representação mais económico entre os sistemas de números inteiros. Palavras-Chave: Sistemas de Números Posicionais, Eficiência, Zero 1 Introduction Counting systems are an indispensable tool in Computing Science. For reasons that are both technological and user friendliness, the performance of information processing depends heavily on the adopted numbering system.
    [Show full text]
  • Basic Computer Arithmetic
    BASIC COMPUTER ARITHMETIC TSOGTGEREL GANTUMUR Abstract. First, we consider how integers and fractional numbers are represented and manipulated internally on a computer. The focus is on the principles behind the algorithms, rather than on implementation details. Then we develop a basic theoretical framework for analyzing algorithms involving inexact arithmetic. Contents 1. Introduction 1 2. Integers 2 3. Simple division algorithms 6 4. Long division 11 5. The SRT division algorithm 16 6. Floating point numbers 18 7. Floating point arithmetic 21 8. Propagation of error 24 9. Summation and product 29 1. Introduction There is no way to encode all real numbers by using finite length words, even if we use an alphabet with countably many characters, because the set of finite sequences of integers is countable. Fortunately, the real numbers support many countable dense subsets, and hence the encoding problem of real numbers may be replaced by the question of choosing a suitable countable dense subset. Let us look at some practical examples of real number encodings. ● Decimal notation. Examples: 36000, 2:35(75), −0:000072. ● Scientific notation. Examples: 3:6⋅104, −72⋅10−6. The general form is m⋅10e. In order to have a unique (or near unique) representation of each number, one can impose a normalization, such as requiring 1 ≤ ∣m∣ < 10. 2 −1 ● System with base/radix β. Example: m2m1m0:m−1 = m2β +m1β +m0 +m−1β . The dot separating the integer and fractional parts is called the radix point. ● Binary (β = 2), octal (β = 8), and hexadecimal (β = 16) numbers. ● Babylonian hexagesimal (β = 60) numbers.
    [Show full text]
  • Introduction to Numerical Computing Number Systems in the Decimal System We Use the 10 Numeric Symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to Represent Numbers
    Statistics 580 Introduction to Numerical Computing Number Systems In the decimal system we use the 10 numeric symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to represent numbers. The relative position of each symbol determines the magnitude or the value of the number. Example: 6594 is expressible as 6594 = 6 103 + 5 102 + 9 101 + 4 100 Example: · · · · 436.578 is expressible as 436:578 = 4 102 + 3 101 + 6 100 + 5 10−1 + 7 10−2 + 8 10−3 · · · · · · We call the number 10 the base of the system. In general we can represent numbers in any system in the polynomial form: z = ( akak− a a : b b bm )B · · · 1 · · · 1 0 0 1 · · · · · · where B is the base of the system and the period in the middle is the radix point. In com- puters, numbers are represented in the binary system. In the binary system, the base is 2 and the only numeric symbols we need to represent numbers in binary are 0 and 1. Example: 0100110 is a binary number whose value in the decimal system is calculated as follows: 0 26 + 1 25 + 0 24 + 0 23 + 1 22 + 1 21 + 0 20 = 32 + 4 + 2 · · · · · · · = (38)10 The hexadecimal system is another useful number system in computer work. In this sys- tem, the base is 16 and the 16 numeric and arabic symbols used to represent numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Example: Let 26 be a hexadecimal number.
    [Show full text]
  • Abstract of Counting Systems of Papua New Guinea and Oceania
    Abstract of http://www.uog.ac.pg/glec/thesis/ch1web/ABSTRACT.htm Abstract of Counting Systems of Papua New Guinea and Oceania by Glendon A. Lean In modern technological societies we take the existence of numbers and the act of counting for granted: they occur in most everyday activities. They are regarded as being sufficiently important to warrant their occupying a substantial part of the primary school curriculum. Most of us, however, would find it difficult to answer with any authority several basic questions about number and counting. For example, how and when did numbers arise in human cultures: are they relatively recent inventions or are they an ancient feature of language? Is counting an important part of all cultures or only of some? Do all cultures count in essentially the same ways? In English, for example, we use what is known as a base 10 counting system and this is true of other European languages. Indeed our view of counting and number tends to be very much a Eurocentric one and yet the large majority the languages spoken in the world - about 4500 - are not European in nature but are the languages of the indigenous peoples of the Pacific, Africa, and the Americas. If we take these into account we obtain a quite different picture of counting systems from that of the Eurocentric view. This study, which attempts to answer these questions, is the culmination of more than twenty years on the counting systems of the indigenous and largely unwritten languages of the Pacific region and it involved extensive fieldwork as well as the consultation of published and rare unpublished sources.
    [Show full text]
  • Number Systems and Radix Conversion
    Number Systems and Radix Conversion Sanjay Rajopadhye, Colorado State University 1 Introduction These notes for CS 270 describe polynomial number systems. The material is not in the textbook, but will be required for PA1. We humans are comfortable with numbers in the decimal system where each po- sition has a weight which is a power of 10: units have a weight of 1 (100), ten’s have 10 (101), etc. Even the fractional apart after the decimal point have a weight that is a (negative) power of ten. So the number 143.25 has a value that is 1 ∗ 102 + 4 ∗ 101 + 3 ∗ 0 −1 −2 2 5 10 + 2 ∗ 10 + 5 ∗ 10 , i.e., 100 + 40 + 3 + 10 + 100 . You can think of this as a polyno- mial with coefficients 1, 4, 3, 2, and 5 (i.e., the polynomial 1x2 + 4x + 3 + 2x−1 + 5x−2+ evaluated at x = 10. There is nothing special about 10 (just that humans evolved with ten fingers). We can use any radix, r, and write a number system with digits that range from 0 to r − 1. If our radix is larger than 10, we will need to invent “new digits”. We will use the letters of the alphabet: the digit A represents 10, B is 11, K is 20, etc. 2 What is the value of a radix-r number? Mathematically, a sequence of digits (the dot to the right of d0 is called the radix point rather than the decimal point), : : : d2d1d0:d−1d−2 ::: represents a number x defined as follows X i x = dir i 2 1 0 −1 −2 = ::: + d2r + d1r + d0r + d−1r + d−2r + ::: 1 Example What is 3 in radix 3? Answer: 0.1.
    [Show full text]
  • 2 1 2 = 30 60 and 1
    Math 153 Spring 2010 R. Schultz SOLUTIONS TO EXERCISES FROM math153exercises01.pdf As usual, \Burton" refers to the Seventh Edition of the course text by Burton (the page numbers for the Sixth Edition may be off slightly). Problems from Burton, p. 28 3. The fraction 1=6 is equal to 10=60 and therefore the sexagesimal expression is 0;10. To find the expansion for 1=9 we need to solve 1=9 = x=60. By elementary algebra this means 2 9x = 60 or x = 6 3 . Thus 6 2 1 6 40 1 x = + = + 60 3 · 60 60 60 · 60 which yields the sexagsimal expression 0; 10; 40 for 1/9. Finding the expression for 1/5 just amounts to writing this as 12/60, so the form here is 0;12. 1 1 30 To find 1=24 we again write 1=24 = x=60 and solve for x to get x = 2 2 . Now 2 = 60 and therefore we can proceed as in the second example to conclude that the sexagesimal form for 1/24 is 0;2,30. 1 One proceeds similarly for 1/40, solving 1=40 = x=60 to get x = 1 2 . Much as in the preceding discussion this yields the form 0;1,30. Finally, the same method leads to the equation 5=12 = x=60, which implies that 5/12 has the sexagesimal form 0;25. 4. We shall only rewrite these in standard base 10 fractional notation. The answers are in the back of Burton. (a) The sexagesimal number 1,23,45 is equal to 1 3600 + 23 60 + 45.
    [Show full text]
  • Scalability of Algorithms for Arithmetic Operations in Radix Notation∗
    Scalability of Algorithms for Arithmetic Operations in Radix Notation∗ Anatoly V. Panyukov y Department of Computational Mathematics and Informatics, South Ural State University, Chelyabinsk, Russia [email protected] Abstract We consider precise rational-fractional calculations for distributed com- puting environments with an MPI interface for the algorithmic analysis of large-scale problems sensitive to rounding errors in their software imple- mentation. We can achieve additional software efficacy through applying heterogeneous computer systems that execute, in parallel, local arithmetic operations with large numbers on several threads. Also, we investigate scalability of the algorithms for basic arithmetic operations and methods for increasing their speed. We demonstrate that increased efficacy can be achieved of software for integer arithmetic operations by applying mass parallelism in het- erogeneous computational environments. We propose a redundant radix notation for the construction of well-scaled algorithms for executing ba- sic integer arithmetic operations. Scalability of the algorithms for integer arithmetic operations in the radix notation is easily extended to rational- fractional arithmetic. Keywords: integer computer arithmetic, heterogeneous computer system, radix notation, massive parallelism AMS subject classifications: 68W10 1 Introduction Verified computations have become indispensable tools for algorithmic analysis of large scale unstable problems (see e.g., [1, 4, 5, 7, 8, 9, 10]). Such computations require spe- cific software tools; in this connection, we mention that our library \Exact computa- tion" [11] provides appropriate instruments for implementation of such computations ∗Submitted: January 27, 2013; Revised: August 17, 2014; Accepted: November 7, 2014. yThe author was supported by the Federal special-purpose program "Scientific and scientific-pedagogical personnel of innovation Russia", project 14.B37.21.0395.
    [Show full text]
  • Data Representation in Computer Systems
    © Jones & Bartlett Learning, LLC © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION NOT FOR SALE OR DISTRIBUTION There are 10 kinds of people in the world—those who understand binary and those who don’t. © Jones & Bartlett Learning, LLC © Jones—Anonymous & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION NOT FOR SALE OR DISTRIBUTION © Jones & Bartlett Learning, LLC © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION NOT FOR SALE OR DISTRIBUTION CHAPTER Data Representation © Jones & Bartlett Learning, LLC © Jones & Bartlett Learning, LLC NOT FOR SALE 2OR DISTRIBUTIONin ComputerNOT FOR Systems SALE OR DISTRIBUTION © Jones & Bartlett Learning, LLC © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION NOT FOR SALE OR DISTRIBUTION 2.1 INTRODUCTION he organization of any computer depends considerably on how it represents T numbers, characters, and control information. The converse is also true: Stan- © Jones & Bartlettdards Learning, and conventions LLC established over the years© Jones have determined& Bartlett certain Learning, aspects LLC of computer organization. This chapter describes the various ways in which com- NOT FOR SALE putersOR DISTRIBUTION can store and manipulate numbers andNOT characters. FOR SALE The ideas OR presented DISTRIBUTION in the following sections form the basis for understanding the organization and func- tion of all types of digital systems. The most basic unit of information in a digital computer is called a bit, which is a contraction of binary digit. In the concrete sense, a bit is nothing more than © Jones & Bartlett Learning, aLLC state of “on” or “off ” (or “high”© Jones and “low”)& Bartlett within Learning, a computer LLCcircuit. In 1964, NOT FOR SALE OR DISTRIBUTIONthe designers of the IBM System/360NOT FOR mainframe SALE OR computer DISTRIBUTION established a conven- tion of using groups of 8 bits as the basic unit of addressable computer storage.
    [Show full text]
  • Number Systems Radix Number Systems Radix Number Systems
    Number Systems 4/26/2010 Number Systems Radix Number Systems binary, octal, and hexadecimal numbers basic idea of a radix number system ‐‐ why used how do we count: conversions, including to/from decimal didecimal : 10 dis tinc t symblbols, 0‐9 negative binary numbers when we reach 9, we repeat 0‐9 with 1 in front: 0,1,2,3,4,5,6,7,8,9, 10,11,12,13, …, 19 floating point numbers then with a 2 in front, etc: 20, 21, 22, 23, …, 29 character codes until we reach 99 then we repeat everything with a 1 in the next position: 100, 101, …, 109, 110, …, 119, …, 199, 200, … other number systems follow the same principle with a different base (radix) Lubomir Bic 1 Lubomir Bic 2 Radix Number Systems Radix Number Systems octal: we have only 8 distinct symbols: 0‐7 binary: we have only 2 distinct symbols: 0, 1 when we reach 7, we repeat 0‐7 with 1 in front why?: digital computer can only represent 0 and 1 012345670,1,2,3,4,5,6,7, 10,11,12,13, …, 17 when we reach 1, we repeat 0‐1 with 1 in front then with a 2 in front, etc: 20, 21, 22, 23, …, 27 0,1, 10,11 until we reach 77 then we repeat everything with a 1 in the next position: then we repeat everything with a 1 in the next position: 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, … 100, 101, …, 107, 110, …, 117, …, 177, 200, … decimal to binary correspondence: decimal to octal correspondence: D 01234 5 6 7 8 9 101112… D 0 1 … 7 8 9 10 11 … 15 16 17 … 23 24 … 63 64 … B 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 … O 0 1 … 7 10 11 12 13 … 17 20 21 … 27 30 … 77 100 …
    [Show full text]
  • United States Patent 15 3,700,872 May [45] Oct
    United States Patent 15 3,700,872 May [45] Oct. 24, 1972 54 RADX CONVERSON CRCUTS Primary Examiner - Maynard R. Wilbur Assistant Examiner- Leo H. Boudreau (72) Inventor: Frederick T. May, Austin,Tex. Attorney-Hanifin and Clark and D. Kendall Cooper (73) Assignee: International Business Corporation, Armonk, N.Y. 57) ABSTRACT 22 Filed: Aug. 22, 1969 Data conversion circuits with optimized common hardware convert numbers expressed in a first radix C (21) Appl. No.: 852,272 to other radices n1, m2, etc., with the mode of opera Related U.S. Application Data tion being controlled to establish a radix C to radix ml conversion in one mode, a radix C to radix n2 conver 63 Continuation-in-part of Ser. No. 517,764, Dec. sion in another mode, etc., on a selective basis, as 30, 1965, abandoned. desired. In a first embodiment, numbers represented in a binary (base 2) radix Care converted to a base 10 52 U.S. Ct.............. 235/155,340/347 DD, 235/165 (n1) or base 12(m2) representation. In a second em 51 int. Cl.............................................. HO3k 13/24 bodiment, numbers stored in a ternary (base 3) radix 58 Field of Search......... 340/347 DD; 235/155, 165 C representation are converted to a base 12 (n1) or base 10 (m2) representation. The circuits are 56 References Cited predicated upon recognition of the fact that a number UNITED STATES PATENTS represented in a first radix can be converted readily to a second radix using shared hardware if the following 2,620,974 12/1952 Waltat.................... 23.5/155 X equation is satisfied: 2,831,179 4/1958 Wright et al..........
    [Show full text]
  • Number Systems
    1 Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer. It is one of the most basic topics in digital electronics. In this chapter we will discuss different number systems commonly used to represent data. We will begin the discussion with the decimal number system. Although it is not important from the viewpoint of digital electronics, a brief outline of this will be given to explain some of the underlying concepts used in other number systems. This will then be followed by the more commonly used number systems such as the binary, octal and hexadecimal number systems. 1.1 Analogue Versus Digital There are two basic ways of representing the numerical values of the various physical quantities with which we constantly deal in our day-to-day lives. One of the ways, referred to as analogue,isto express the numerical value of the quantity as a continuous range of values between the two expected extreme values. For example, the temperature of an oven settable anywhere from 0 to 100 °C may be measured to be 65 °C or 64.96 °C or 64.958 °C or even 64.9579 °C and so on, depending upon the accuracy of the measuring instrument. Similarly, voltage across a certain component in an electronic circuit may be measured as 6.5 V or 6.49 V or 6.487 V or 6.4869 V. The underlying concept in this mode of representation is that variation in the numerical value of the quantity is continuous and could have any of the infinite theoretically possible values between the two extremes.
    [Show full text]