of 35 /35
[email protected] 2008-200 9 1 ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΥΠΟΛΟΓΙΣΤΩΝ - ΑΡΙΘΜΗΤΙΚΕΣ ΠΡΑΞΕΙΣ ΣΗΜΜΥ, 5 Ο ΕΞΑΜΗΝΟ http://www.cslab.ece.ntua.gr/courses/ comparch

ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΥΠΟΛΟΓΙΣΤΩΝ - ΑΡΙΘΜΗΤΙΚΕΣ ΠΡΑΞΕΙΣ

  • Author
    iman

  • View
    47

  • Download
    0

Embed Size (px)

DESCRIPTION

ΣΗΜΜΥ, 5 Ο ΕΞΑΜΗΝΟ http://www.cslab.ece.ntua.gr/courses/comparch. ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΥΠΟΛΟΓΙΣΤΩΝ - ΑΡΙΘΜΗΤΙΚΕΣ ΠΡΑΞΕΙΣ. ΑΡΙΘΜΟΙ. Decimal Eύκολο για τον άνθρωπο Ιδιαίτερα για την εκτέλεση αριθμητικών πράξεων Hex Χρήσιμο για την απεικόνιση δυαδικών αριθμών (4 bits / symbol) - PowerPoint PPT Presentation

Text of ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΥΠΟΛΟΓΙΣΤΩΝ - ΑΡΙΘΜΗΤΙΚΕΣ ΠΡΑΞΕΙΣ

  • - , 5

    http://www.cslab.ece.ntua.gr/courses/comparch

    [email protected] 2008-2009

  • Decimal E

    Hex (4 bits / symbol)

    Binary +,-,*,/ ????

    [email protected] 2008-2009

  • (radix) r

    : m-1m-20, -1-2-n : 0,, -1

    ..1821,352(10) = 1103 + 8102 + 2101 + 1100 + 310-1 + 510-2 + 210-31256,124(8) = 183 + 282 + 581 + 680 + 18-1 + 28-2 + 48-3

    [email protected] 2008-2009

  • [email protected] 2008-2009

  • COMPUTER ARITHMETIC , pointers .

    bits (Overflow)1101 + 0101 = 1 0010

    [email protected] 2008-2009

  • n bits 2n MSB (Most Significant Bit), LSB (Less Significant Bit)3 : , 1, 2

    [email protected] 2008-2009

  • - To MSB (0 +, 1 -) bits .. 12 bits +1764(10) : 011011100100 -1764(10) : 111011100100 -2n-1+1 2n-1-1To 0 2 (0000 1000)

    [email protected] 2008-2009

  • -

    , Cn

    , Cn

    [email protected] 2008-2009

  • -

    = =

    [email protected] 2008-2009

  • - : : , .. : 0

    [email protected] 2008-2009

  • 1 To MSB (0+, 1-) n bits.. 12 bits +1764(10) : 011011100100 -1764(10) : 100100011011 -2n-1+1 2n-1-1To 0 2 (0000 1111)

    0

    [email protected] 2008-2009

  • 2To MSB (0+, 1-) n bits .. 12 bits +1764(10) :011011100100 -1764(10) :100100011011 +000000000001 -------------------- 100100011100A 2 z, n bits : z + = 2n -2n-1 2n-1-1To 0 1 (0000)

    [email protected] 2008-2009

  • 2

    bit-bit

    001100 001100 110100 110100 101110+010001+101111+010001+101111+101110-------------------------------------------------- ------------ 011101 1110111000101 1100011 1011100

    [email protected] 2008-2009

  • 2 /

    -

    :

    [email protected] 2008-2009

  • 2

    :

    [email protected] 2008-2009

  • 2 (interrupt / exception) (. C) (. Fortran, Ada)

    [email protected] 2008-2009

  • n m, n+m

    ;

    [email protected] 2008-2009

  • [email protected] 2008-2009

  • 64 bits

    [email protected] 2008-2009

  • [email protected] 2008-2009

  • BOOTH Andrew Booth 1951 2 2 : bits m k 1. 2k+1 2m

    : * Multiplier = M * 2k+1 - M * 2m

    [email protected] 2008-2009

  • BOOTH :ultiplier = 14 = 001110 k = 3, m = 1 24 - 21 = 16 - 2 = 14 M * Multiplier = M * 24 - M * 21 4 1

    [email protected] 2008-2009

  • BOOTH (multiplicand) * Q * (multiplier)

    bit :01 : 1 10 : 1 00, 11 :

    1 bit ( )

    [email protected] 2008-2009

  • BOOTH

    [email protected] 2008-2009

  • n bits ( ) ()

    2 :

    [email protected] 2008-2009

  • n bits : n=1+ n1 + n2MSB n1 bits ( )n2 bits ( )

    [email protected] 2008-2009

  • .. 8 bits, 14 bits 0 1111 , 111 = 15,875(10) 1 0000 , 000 = -15,875(10) 256 [-15,875 15,875] 2-3 = 0,001(2) = 0,125(10) : 2-4

    [email protected] 2008-2009

  • : = (-1)sign 2e = (mantissa / significant)e = (exponent)

    : 101,011 = 101,011 20 =1,01011 22 = 0,101011 23 = 101011 2-3

    (normal form):1,xxxxxxxx 2e

    [email protected] 2008-2009

  • : 2-n1-1 2e : 2-n1-1

    [email protected] 2008-2009

  • bits bits (floating point overflow) (floating point underflow) 754 floating point standard :Single precision: 8 bits , 23 bits Double precision : 11 bits , 52 bits bit 1 ( ) 1 bit

    [email protected] 2008-2009

  • Min = 00000Max = 111..11 754 = 127 single precision = 1023 double precisionN = (-1)sign (1 + ) 2e-biase = = 0 = 0e = 0, 0 e = 255/2047, = 0 = e = 255/2047, 0 = aN ( )

    [email protected] 2008-2009

  • Decimal : - 0.75 = - ( + ) Binary: - 0.11 = - 1.1 x 2-1Floating point:= 126 = 01111110 = 1

    [email protected] 2008-2009

  • (integer arithmetic unit) ???

    [email protected] 2008-2009

  • [email protected] 2008-2009

  • [email protected] 2008-2009