Principles of Computer Organization and structure diagrams of formula (Chapter II)

Principles of Computer Organization and structure diagrams of formula (Chapter II)

1, numerical data representing


 

1) binary notation

(1) decimal -> two

  • Integer unit: modulo addition yl
  • Decimal part: rounding the product

(2) Binary -> weight by adding

2) Number of symbols indicate: unsigned, signed number (true value, the number of machines)

3) fixed-point notation: fixed decimal position itself does not occupy memory bit

(1) an integer of: 1 to a fixed precision

  • Unsigned
  • Signed: the original code, complement

(2) decimal places: the accuracy of a fixed 2 ^ -7-x.xxxxxx

  • Original code
  • Complement

4) floating point representation exponent (Ef of the first order symbol) | mantissa (the first number of symbols Mf)

  • True value N = ± R ^ E × M
  • Exponent E, fixed-point integer, complement / shift said range represents the number of
  • Mantissa M, decimal point, the original code / complement representation, the accuracy of the number of representatives
    • I.e., the sign bit integer bits Mf  
    • Normalized mantissa  
      • Original code: 1 / 2≤ | M | <1    
      • Complement: 1 / 2≤M <1, -1≤M≤-1/2    
      • Negative complement representation only 1.1000 or 1.0xxx ...... ......    
  • Accuracy and range
  • Shift (by code): | x | shift = 2 ^ n + x (n is an integer number of bits, x is the true value)
    • Meaning: the true value x number of weeks in forward translational 2 ^ n  
    • Greater than 0 frameshift  
    • Frameshift and complement comparison: most significant bit (sign bit) opposite  
  • IEEE754 standard floating-point format
    • Different 1) the offset value defined by subtracting 1  
    • 2) The first rms value is not saved, eg: 0.1011-> 1.011 -> 011.  
    • eg:1010010.01->(1).01001001×2^6  
    • The sign bit (a) + order code shift (due to a frameshift unsigned) + mantissa original code (sign bit is forward)  
    • Short real: shift offset value 2 ^ 7-1 = 127,1 + 8 + 23 = 32

2, character data showing: ASCⅡ code is a hexadecimal


 

128 commonly used characters, 7

Space -32,0-48, A-65, a-97

3, an operation method: subtraction point


 

PS: Encoding operation: involved in computing the sign bit, complement carry-round, the inverted bit add

1) complement:

  • (X-+ Y) = X up + Y fill up, (XY) = X complement complement (-Y) complement
  • Complement Y -> (- Y) Complement: a sign bit plus a negated

2) Overflow determination - logic, SA, SB represents the number of symbols, Cf represents a symbol bits generates a carry, C represents the value of the most significant bit carry generation

(1) SA, SB, Sf

Overflow = SA SB Sf + SA SB Sf

(2)Cf,C

Positive overflow: Cf = 0, C = 1

Negative overflow: Cf = 1, C = 0

Does not overflow: Cf = C

(3) double sign bit: double extended sign bit, 1-> 11,0-> 00

Positive overflow: 01

Negative overflow: 10

Does not overflow: 00/11

(3) Shift (after removal) of that mantissa (the original code / complement)

Complement positive number: the number of the same symbol, gap fill 0

Negative complement: the same number of symbols, fill vacancies left 0, right 1 fill vacancies

A dual symbol bits of the symbol bit constant, the second sign bit and the number of symbols as a whole

(4) rounding method

0 and rounding up 1

Constant last bit is set to 1

4, operation method 2: Multiplication point: adding to transform the multiplication - accumulation portion plus shift


 

Displacement

  • Arithmetic logical shift left = left = × 2 (including the carry bit)
  • ≠ arithmetic logical shift right (highest copy complement bit) = ÷ 2

Original code a multiplication

  • Multiplying step: each speaking a multiplier corresponding to the accumulated partial products and adding the partial products of the original, and right (right arithmetic)
  • Participate in operations alone sign bit, data bit absolute value calculation participation
  • Example: the known X = 0.110, Y = -0.101
    • [X] original = 0.110, [Y] = 1.101 original  
    • Partial product multiplier] [/ determined bit  
    • 00.000 Y0.101  
    • + 00.110  
    • = 00.110  
    • ->00.011 0Y0.10  
    • + 00.000  
    • = 00.011  
    • ->00.001 10Y0.1  
    • + 00.110  
    • ->00.011 110Y0  
    • X × Y = (0 XOR 1) = .011110 1.011110  

Complement a multiplication

  • [X] Complement = X0X1 ...... Xn, [Y] = Y0Y1 ...... Yn complement
  • [X · Y] 补 = [X] 补 × Σ (Yi + 1 - yi) 2 ^ (- i)
  • Operation rules:
    • (1) if Yn + 1 = Yn, +0 partial product, a partial-product arithmetic shift right  
    • (2) If YnYn + 1 = 01, the partial product + [X] complement, a partial product Arithmetic shift right  
    • (3) If YnYn + 1 = 10, the partial product + [- X] complement, a partial product Arithmetic shift right  
    • Repeating steps n + 1, last step, but does not shift  
    • Including a sign bit, the resulting product 2n + 1 care, n bits are data bits  
  • Design Problems
    • (1) i = n 时, In + 1 = 0  
    • After (2) Yn + 1 is located in the multiplier register registers an increase in Y  
    • (3) the object arithmetic right shift: a partial product multiplier and the registers are shifted to the right  
  • Example: the known X = + 1101, Y = + 1011
    • [X] fill = 01101, [Y] fill = 01011, [- X] Complement = 10011  
    • (Double sign bit) multiplier partial product  
    • 000000 [010 110] (In 和 In + 1)  
    • + 110011  
    • = 110011    
    • ->111001 1[01011]  
    • + 000000  
    • = 111001 11[0101]  
    • + 001101  
    • = 001001  
    • ->000100 111[010]  
    • + 110011  
    • = 110111  
    • ->111011 1111[01]  
    • + 001101  
    • = 001000  
    • [The XY] = 010001111 Complement  

5, the calculation method 3: fixed point division

Different manual shift multiplication and division, and multiplication and division computer objects and a direction

Original code multiplication and division, the absolute value of the mantissa, the sign bit arithmetic operations separately

1. The original code-restoring division

  • 1) determines whether enough Save (Sample List)
    • After minus sign of the remainder fear off  
  • 2) The remainder is positive, reduced enough, the provider 1, left a residue
  • 3) the remainder is negative, not reduce, the quotient 0
    • Plus divisor restored to its original value, the remainder left one  
  • Operation of a business to get first place in a commercial spaces on the left side of the business, then left with the mantissa
  • Inadequate: a few steps uncertain

2. The original code plus / minus alternating starting operation method (non-restoring method)

  • 3) the remainder is negative, not reduce, the quotient 0      
    • The remainder left one bit, plus the divisor (now complete test providers)  

6, operation method 4: floating-point addition and subtraction

(1) detecting whether the simplified operation

(2) of the order (order code made large) order to align the small of the Order

(3) mantissa addition and subtraction

(4) Results normalized

  • Only two normalized form: 00.1 or 11.0 ...... ......
  • 00.0 or 11.1 normalized ...... ......: left mantissa, exponent minus one, until the desired
  • 0.1 or 1.0 ...... ...... normalization: a right, order code plus a

7, operation method 5: floating point multiplication

8, operation method 6: floating-point division

Guess you like

Origin www.cnblogs.com/ggotransfromation/p/11610457.html