Computer Architecture - PowerPoint PPT Presentation

1 / 64
About This Presentation
Title:

Computer Architecture

Description:

Title: Computer Architecture Last modified by: Created Date: 1/24/2003 2:04:40 AM Document presentation format: (4:3) – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 65
Provided by: ackr
Category:

less

Transcript and Presenter's Notes

Title: Computer Architecture


1
?3?. ??? ??? ?? ??
  • Lecture 4

2
?? ??
  • 3.1 ALU? ?? ??
  • 3.2 ??? ??
  • 3.3 ?? ??
  • 3.4 ??? ??
  • 3.5 ??? ?? ??
  • 3.6 ????? ?? ??
  • 3.7 ????? ?? ??

3
3.1 ALU? ?? ??
  • ?? ???? ?? ???(, -, , )? ??
  • ?? ???? ?? ???(AND, OR, XOR, NOT ?)? ??
  • ??? ????(shift register) ???? ?? ?? ???? ?????
    ??? ?? ????
  • ???(complementer) 2? ???? 2? ??? ??(???)
  • ?? ????(status register) ?? ??? ??? ????
    ???(flag)?? ???? ????

4
ALU? ?? ?? ???
5
3.2 ??? ??
  • 2?? 0, 1, ?? ? ????? ??
  • -13.62510 -1101.1012
  • ??? ????? ?? ?? ????? ?(Fixed-point Number)
  • ??? ?? ???? ???? 2?? ??? ??
  • ??? ???? ???? ???
  • ? ??? ?? ??? ???? ??? ??
  • n-?? 2??? ?? ?? ? A? ???? ??
  • ??? ??? a0? ??? ???? ?? ??? 10?? ????
  • A an-1 2n-1 an-2 2n-2 ... a1 21
    a0 20
  • ??? ??? an-1? ??? ???? ?? ??? 10?? ????
  • A an-1 2-1 an-2 2-2 ... a1 2-(n-1)
    a0 2-n
  • ? 23 22 21 20 2-1 2-2 2-3
  • 1 1 0 1 . 1 0 1
  • 123 122 021 120 12-1 02-2
    12-3
  • 8 4 1 0.5 0.125 13.625

6
??? ??
  • ?? ?? ??
  • ???-?? ??(signed-magnitude representation)
  • 1? ?? ??(1's complement representation)
  • 2? ?? ??(2's complement representation)
  • ??? ??? ??? ??(leftmost bit)? ?? ??(sign bit)?
    ??
  • an-1 0 ?? ??
  • an-1 1 ?? ??

7
3.2.1 ???-?? ?? (1)
  • ? ?? ??? ?? ??, ??? n-1 ?? ???? ??
    ??(???magnitude)? ???? ?? ??
  • ? 9 0 0001001 35 0 0100011
  • - 9 1 0001001 - 35 1 0100011
  • ???-??? ??? 2??(an-1 an-2 ... a1 a0)? 10??? ??
  • A (-1)an-1 (an-2 2n-2 an-3 2n-3 ...
    a1 21 a0 20)
  • 0 0100011 (-1)0(0261250240230221211
    20)
  • (32 2 1) 35
  • 1 0001001 (-1)1(0260250241230220211
    20)
  • - (8 1) - 9

8
???-?? ?? (2)
  • ??
  • ??? ??? ???? ???? ????? ?? ??? ??? ??
  • ? ? ?? ??
  • (1) ? ?? ??? ????
  • (2) ??? ?? ???? ?? ??? ???, ?? ???? ??? ???
  • (3) ?? ??? ???? ? ? ?? ??? ???? ??? ??
  • 0 ??? ? ? ??
  • n-?? ??? ??? ? ?? ??? 2n ?? ??, (2n - 1)?? ??
  • 0 0000000 0
  • 1 0000000 - 0

9
3.2.2 ?? ??
  • 1? ??(1's complement) ??
  • ?? ???? ?? (0 ? 1, 1? 0)
  • 2? ??(2's complement) ??
  • ?? ???? ????(1? ??), ???? 1? ???
  • ?
  • 9 0 0001001 35 0
    0100011
  • - 9 1 1110110 (1? ??) - 35 1 1011100 (1?
    ??)
  • 9 1 1110111 (2? ??) - 35 1 1011101 (2?
    ??)
  • ??? ????? ?? ??? 2? ??? ??
  • ?? ??? ??? ? ??? ???? ?? ??
  • 1? ?? ??? 0? ?? ??? ? ?? ? ??? ? ?? ?? ??? ??

10
8-?? ??? ??? ???
  • 8-?? 2??? ??? ? ?? 10??? ??
  • 1? ?? - (27 - 1) (27 - 1)
  • 2? ?? - 27 (27 - 1)

11
2? ?? ? 10?? ??
  • 2? ??? ??? ??(an-1 0)? 10??? ???? ??
  • A an-2 2n-2 an-3 2n-3 ... a1 21 a0
    20
  • 2? ??? ??? ??(an-1 1)? 10??? ???? ??
  • A - 2n-1 (an-22n-2 an-32n-3 a121
    a020 )
  • ? 10101110 - 128 (1 25 1 23 1 22
    1 21)
  • - 128 (32 8 4 2)
    - 82
  • ?? ?? 10101110 ? 01010010 ?? ?? ??? ?,
  • 01010010 - (1 26 1 24 1 21)
  • - (64 16 2) - 82

12
3.2.3 ?? ?? (Bit Extension) (1)
  • ???? ??(?? ?)? ??? ??
  • ?? ???? ? ?? ??? ????? ????? ? ? ????? ?? ??
  • ? 8-?? ???? 16-?? ???? ??
  • ???-?? ??? ?? ?? ??? ??? ??? ?????, ? ?? ????
    0?? ???
  • 21 00010101 (???-??, 8 ??)
  • 21 0000000000010101 (???-??, 16 ??)
  • -21 10010101 (???-??, 8 ??)
  • -21 1000000000010101 (???-??, 16 ??)

13
?? ?? (Bit Extension) (2)
  • ? 8-?? ???? 16-?? ???? ??
  • 2? ?? ??? ?? ???? ?? ???? ?? ??? ?? ??? ??
    ?? ?? ??(sign-bit extension)
  • 21 00010101 (2? ??, 8 ??)
  • 21 0000000000010101 (2? ??, 16 ??)
  • -21 11101011 (2? ??, 8 ??)
  • -21 1111111111101011 (2? ??, 16 ??)

14
3.3 ?? ??
  • ???? ?? ???
  • ?? ???? ?? ?? ? ?? ??? ??? ??
  • ?? ??? ?? ??? ??

15
?? ??? ?? ???? ??
  • ????? ??
  • ?? ???? ?? ?? ????? ??
  • ?? ?? ???? ??? ?????? ? ??? ?? ??? ??

16
N-?? ?? ????
  • N-?? ????? ?? ?? ????
  • ?? ?? ???? ??? ??
  • 4-?? ?? ????

17
AND ?? / OR ??
  • AND ?? ? ??? ???? ???? ??? ?? AND ??? ??
  • A 1 0 1 1 0 1 0 1
  • B 0 0 1 1 1 0 1 1
  • -------------------
  • 0 0 1 1 0 0 0 1 (?? ??)
  • OR ?? ? ??? ???? ???? ??? ?? OR ??? ??
  • A 1 0 0 1 0 1 0 1
  • B 0 0 1 1 1 0 1 1
  • -------------------
  • 1 0 1 1 1 1 1 1 (?? ??)

18
XOR ?? / NOT ??
  • XOR ?? ? ??? ???? ???? ??? ?? exclusive-OR ???
    ??
  • A 1 0 0 1 0 1 0 1
  • B 0 0 1 1 1 0 1 1
  • -------------------
  • 1 0 1 0 1 1 1 0 (?? ??)
  • NOT ?? ??? ??? ?? ???? ??(invert)
  • A 1 0 0 1 0 1 0 1 (?? ?)
  • -------------------------------
  • 0 1 1 0 1 0 1 0 (?? ?)

19
???-?? ?? / ???-?? ??
  • ???-??(selective-set) ?? B ????? ??? ??? 1? ???
    ???? ?? ??? ?? A ????? ???? 1? ?? ltOR ?? ??gt
  • A 1 0 0 1 0 0 1 0 (?? ?)
  • B 0 0 0 0 1 1 1 1
  • -------------------
  • A 1 0 0 1 1 1 1 1 (?? ?)
  • ???-??(selective-complement) ?? B ????? ??? ???
    1? ??? ???? ???? A ????? ???? ??? ?? ltXOR ?? ??gt
  • A 1 0 0 1 0 1 0 1 (?? ?)
  • B 0 0 0 0 1 1 1 1
  • -------------------
  • A 1 0 0 1 1 0 1 0 (?? ?)

20
??? ??
  • ???(mask) ?? B ????? ??? ??? ?? 0? ???? ?? ???
    ?? A ????? ???? 0?? ???(clear??) ?? ltAND ?? ??gt
  • ?? ???? ??? ???? ????? clear?? ? ??
  • ?
  • A 1 1 0 1 0 1 0 1 (?? ?)
  • B 0 0 0 0 1 1 1 1
  • -------------------
  • A 0 0 0 0 0 1 0 1 (?? ?)

21
?? ??
  • ??(insert) ?? ??? ?? ??? ??? ???? ?? ??? ??
  • ?? ? ??? ?? ???? ??? ???(AND) ?? ??
    ? ??? ??? ???? OR ??? ??
  • A 1 0 0 1 0 1 0 1
  • B 0 0 0 0 1 1 1 1 ??? (AND ??)
  • -------------------
  • A 0 0 0 0 0 1 0 1 ? ?? ??
  • B 1 1 1 0 0 0 0 0 ?? (OR ??)
  • -------------------
  • A 1 1 1 0 0 1 0 1 ??(??) ??

22
?? ??
  • ??(compare) ??
  • A? B ????? ??? ?? ? exclusive-OR ??
  • ?? ???? ???? ?? ???, A ????? ?? ??? 0 ??
  • ?? ?? ???, A ????? ?? ??? 1 ??
  • ?? ???? ???, Z ???? 1 ??
  • A 1 1 0 1 0 1 0 1
  • B 1 0 0 1 0 1 1 0
  • -------------------
  • A 0 1 0 0 0 0 1 1 (?? ??)

23
3.4 ???(shift) ??
  • ??? ??? (logical shift)
  • ?????? ??? ???? ?? ?? ????? ? ?? ??
  • ?? ???(left shift)
  • ?? ???? ???? ? ?? ??
  • ??? ??(A1)?? 0 ? ????, ??? ??(A4)? ??
  • ?? ???(right shift)
  • ?? ???? ???? ? ?? ??
  • ??? ??(A4)? 0? ????, ??? ??(A0)? ??

24
??? ???? (shift register)
  • D-F/F? ??? ??? ????

25
?? ???(circular shift)
  • ?? ???(circular shift)
  • ??(rotate)???? ???, ??? ?? ???? ?? ??? ??? ?? ???
    ?? ?? ?? ??? ??
  • ?? ??-???(circular shift-left)
  • ??? ??? A4? ??? ?? ??? A1?? ??
  • ?? ??-???(circular shift-right)
  • A4 ? A3, A3 ? A2, A2 ? A1, A1 ? A4

26
??? ???? ?? (1)
  • ?? ??? ??(Serial Data Transfer)
  • ??? ??? ??? ?? ??? ????? ?????? ? ????? ??? ? ??
    ?? ??? ?? ???? ???? ??

27
??? ???? ?? (2)
  • 4-?? ????? ?? ?? ??? ?

28
??? ??? (arithmetic shift)
  • ?(number)? ???? ???? ?? ???
  • ?? ??? ???? ?? ??? ??? ?????, ?? ??? ???? ????
    ???
  • (1) ??? ??-???(arithmetic shift-left)
  • A4 (??), A3 ? A2, A2 ? A1, A1 ? 0
  • (2) ??? ??-???(arithmetic shift-right)
  • A4 (??), A4 ? A3, A3 ? A2, A2 ? A1
  • ? A 1 1 1 0 (-2) ?? ??
  • 1 1 0 0 (-4) ??? ??-??? ??
  • 1 1 1 0 (-2) ??? ??-??? ??
  • 1 1 1 1 (-1) ??? ??-??? ??

29
3.5 ??? ?? ??
  • ??? ?? ??? ?? ???? ???? ???
  • A ? A' 1 ???(2? ?? ??)
  • A ? A B ??
  • A ? A - B ??
  • A ? A x B ??
  • A ? A / B ???
  • A ? A 1 ??(increment)
  • A ? A - 1 ??(decrement)

30
3.5.1 ??
  • 2? ??? ??? ??? ?? ??
  • ? ?? ???, ?? ???? ???? ??

31
?? ???(Parallel Adder) (1)
  • ??? ???? ???? ??
  • ?? ???? ????(full-adder)?? ??
  • ?? ?? ??? ?? ?? ?? ????(condition flags)? ??
  • C ??? ???(carry)
  • S ??? ??(sign)
  • Z ??? 0(zero)
  • V ??? ?????(overflow)

32
?? ???(Parallel Adder) (2)
  • 4-?? ?? ???? ?? ?? ????

33
?? ?????
  • ?? ??? ? ??? ???? ???? ??? ?? ??
  • ?? ??
  • ? ???(carry)? ?? exclusive-OR? ??
  • V C4 ? C5
  • ???? ?????? ???? ?

34
3.5.2 ??
  • ??? ???? ??
  • A - (B) A (-B)
  • A - (-B) A (B)
  • ?, A ???(minuend), B ??(subtrahend)

35
??? ?? ?? ????? ?? ???
36
?? ?????
  • ?? ??? ? ??? ???? ???? ??? ?? ??
  • ?? ?? ??? ?? (V C4 ? C5 )

37
3.5.3 ??
  • ?? ?? ??? ??
  • ? ??? ??? ?? ?(partial product) ??
  • ????? ?? ??? ?? ??? ??
  • ? ?? n-?? 2? ??? ??? ???? ?? 2n ??? ??

38
?? ?? ?? ??? (1)
  • ?? ???? ???? ??
  • M ???? ???(multiplicand) ??
  • Q ???? ??(multiplier) ??
  • ? ? ??? ???? A ????? Q ????? ??

39
?? ?? ?? ??? (2)
  • ??? ???? ????? ???? ???

40
2? ??? ?? ??
  • Booth ????(Booth's algorithm) ??
  • ???? ??
  • ?? ?? ?? ???? ????? ?? ??? ??
  • M ????? ?? ??? ??? ???(complementer) ??
  • Q ????? ??? Q-1 ??? ??? 1-?? ????? ????, ??? Q0?
    ?? ?? ??? ??

41
Booth ????? ???
42
Booth ????? ??? ??? ? (-7x3)
43
3.5.4 ???
  • ???? ?? ??
  • D V Q --- R
  • ?, D ???(dividend), V ??(divisor), Q
    ?(quotient)
  • V ??(divisor), R ??? ?(remainder)
  • ?? ?? 2? ???

44
?? ?? 2? ??? ????? ???
45
2? ?? ??? ??
  • ?? ?? ??? M ?????, ???? A? Q ????? ??
    ? ????? n ??? ?, ???? 2n ?? ??? 2? ??? ??
  • ??? 1 A? Q ????? ???? ? ??? ???
  • ??? 2 ?? M? A? ??? ??? A ? A - M,
    ??? A ? A M? ????.
  • ??? 3 ?? ?? ?? A? ??? ??? ?? ??? ??
  • ??? ????? A 0 ??, Q0 ? 1? ??
  • ??? ???? A ? 0 ??, Q0 ? 0?? ?? A? ??? ??? ??
  • ??? 4 Q? ?? ?? ?? ?????, ?? 2?? 4??? ??
  • ??? 5 ??? ?? A. ?? ??? ???? ??? ??? ?? Q? ???,
    ??? ??? Q? 2? ??? ?

46
2? ?? ???? ? (7 (-3))
47
3.6 ????? ?? ??
  • ????? ??(floating-point representation) ????
    ??? ???? ? ?? ?? ??
  • ????? ?(floating-point number)? ???? ??
  • N (-1)S M BE
  • ?, S ??(sign), M ??(mantissa), B ??(base),
    E ??(exponent)
  • 2? ????? ?(binary floating-point number)
  • ?? B 2
  • ??-???(single-precision) ????? ? 32 ??
  • ??-???(double-precision) ????? ? 64 ??

48
??-??? ????? ? ??? ?
  • S 1 ??, E 8 ??, M 23 ??
  • ??(E) ??? ?? ?? ????, ?? ??? ?? ?? ??
  • ??(M) ??? ?? ?? ????, ???(precision) ??

49
?? ?? ?? ????? ??
  • ?? ?? ?? ????? ??? ?? ??? ??
  • 0.1101 25
  • 110.1 22
  • 0.01101 26
  • ???? ??(normalized representation)
  • ?? ?? ??? ? ??? ???? ?? ??
  • 0.1bbb...b 2E
  • ?? ??? ???? ??? 0.1101 25

50
?? ??? ? (0.1101 25)
  • ??(S) ?? 0
  • ??(E) 00000101
  • ??(M) 1101 0000 0000 0000 0000 000
  • ??? ?? ? ?? ??? ?? 1???, ??? ??? ??? ?? 23???
    ???? ??? ?? 24 ?? ??? ?? ??

51
????? ?? (biased exponent)
  • ??? ????? ?(biased number)? ??
  • ?? ??
  • 0? ?? ???? ?? ???? 0? ?? ??, 0-??(zero-test)?
    ???? ?? ??? 0-??? ????? ?? ???? ??

52
8-?? ????? ????
53
????? ??? ??? ????? ??? ?
  • ????? 128? ?, N - 13.625? ?? ????? ??
  • 13.62510 1101.1012 0.1101101 24
  • ??(S) ?? 1 (-)
  • ??(E) 00000100 10000000 10000100
  • (???? 128? ???)
  • ??(M) 10110100000000000000000
  • (??? ??? ? ?? 1? ??)

54
????? ?? ?? ??
  • ????? ?? ?? ??
  • 0.5 2-128?? (1 - 2-24) 2127 ??? ???(?? 1.47
    x 10-39 1.7 x 1038)
  • -(1 - 2-24) 2127 ?? -0.5 2-128 ??? ???
  • ???? ??
  • (1 - 2-24) 2127?? ?? ?? ? ?? ?????(negative
    overflow)
  • 0.5 2-128 ?? ? ?? ? ?? ?????(negative
    underflow)
  • 0
  • 0.5 2-128 ?? ?? ?? ? ?? ?????(positive
    underflow)
  • (1 - 2-24) 2127 ?? ? ??? ?? ?????(positive
    overflow)

55
32-?? ??? ??? ?? ??? ?? ??
56
IEEE 754 ?? ????? ?? ??
  • ????? ?? ?? ??? ??? ??? ?????????(IEEE)?? ??? ??
  • ?? ??
  • N (-1)S 2E-127 (1.M)
  • ?? ???-?? ?? ??
  • ?? ?? ???? 127 ??
  • 1.M 2E? ??? ???, ??? ??? M ??? ?? ??? ??(???
    ??? ???? ?? 1? hidden bit?? ??)
  • 64-?? ??-??? ????? ??? ???? ??
  • N (-1)S 2E-1023 (1.M)

57
IEEE 754 ?? ????? ?? ??
58
IEEE 754 ?? ? (N - 13.625 )
  • 13.62510 1101.1012 1.101101 23
  • ??(S) ?? 1 (-)
  • ?? E 00000011 01111111 10000010
  • (???? 127? ???)
  • ?? M 10110100000000000000000
  • (??? ??? 1? ????)

59
?? ??? ??? IEEE 754 ??
  • ?? ??? ??? ?? (32-?? ??)
  • ?? E 255?? M ? 0??, N NaN
  • ?? E 255?? M 0??, N (-1)S 8
  • ?? 0 lt E lt 255 ??, N (-1)S 2E-127 (1.M)
  • ?? E 0?? M ? 0??, N (-1)S 2-126 (0.M)
  • ?? E 0?? M 0??, N (-1)S 0
  • ?? ??? ??? ?? (64-?? ??)
  • ?? E 2047?? M ? 0??, N NaN
  • ?? E 2047?? M 0??, N (-1)S 8
  • ?? 0 lt E lt 2047 ??, N (-1)S 2E-1023 (1.M)
  • ?? E 0?? M ? 0??, N (-1)S 2-1022 (0.M)
  • ?? E 0?? M 0??, N (-1)S 0

60
????? ?? / ??
  • ??? ??
  • ???? ????? ?? (alignment)
  • ??? ?? ??(??? ?? ??) ??
  • ??? ??? (normalization)

61
????? ??? ??????
  • ?? ???? ?? ??
  • ???? ????? ??? ???? ?? ?? ???????? ??

62
????? ?? / ???
  • 2?? ????? ?? ??
  • ???? ???
  • ???? ???
  • ???? ???
  • 2?? ????? ??? ??
  • ???? ???
  • ???? ???? ??? ??? ??
  • ???? ???

????? ??? ? (0.1011 23) (0.1001 25) lt??
???gt 1011 1001 01100011 lt?? ???gt 3
5 8 lt???gt 0.01100011 28 0.1100011
27 (???)
63
????? ?? ???? ?? ??? ???
  • ?? ?????(exponent overflow)
  • ?? ???? ?? ???? ??
  • ?? ?? ?? ??? ? ?? ?????, 8 ?? -8? ??
  • ?? ?????(exponent underflow)
  • ?? ???? ?? ???? ??
  • ?? ?? ??? ??? ? ?? ?????, 0?? ??

64
????? ?? ???? ?? ??? ???
  • ?? ?????(mantissa underflow)
  • ??? ??? ?? ?? ???? ???? ??? ?? ??? ??? ??
  • ? ???(rounding) ??
  • ?? ?????(mantissa overflow)
  • ?? ??? ?? ? ???? ????? ? ???? ???? ??
  • ? ???(realignment) ??? ??? ???
Write a Comment
User Comments (0)
About PowerShow.com