Professional Documents
Culture Documents
Computer Organization (Jin, Hatfield)
Computer Organization (Jin, Hatfield)
Computer Organization (Jin, Hatfield)
PRINCIPLESANALYSISAND DESIGN
LAN J IN
BO HATFIELD
CIP
. . JIN B .
. TP
CIP
http/ / www. tup. com. cn
- -
ISBN --- / TP
Dr . Lan J in
Dr . Bo Hatfield
?
?
?
?
?
?
?
?
?
?
The Scope of the Book
!""#$%& &()*+(*# &#,#&
-.),#)/0.)(& $(120)# .3 3#*0"/#3 /3()"4#3 &#,#&
5013.63.*3($$0)* &#,#&
70*0/(& &.*01 &#,#&
!8,()1#8 1.$6+/#3 .3*()09(/0.)
A.
B.
C.
D.
Acknowledgments
CHAPTER 1 INTRODUCTION
!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!
!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!
!!!!!!!!!!!
!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!
!!!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!!
!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!
!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!
!!!!
!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
CHAPTER 12 PIPELINING
!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!
!!!!!!!!
!!!!!!!!!!!
!!!!!!!
!!!!!!!!!!
!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!
!!!!!!!!!
!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTRODUCTION
!"# $%&(
!&)*%&+ $%&(
,-.&%/ $%&(
?
?
?
?
?
Example 1. 1
1
Table 1. 1 The fr equency of usage and CPI for four types of instr uctions
Example 1. 2
?
?
?
?
?
1. 5. 3 Embedded Systems
1
Specialization
Customization
Automation
1. 6 Summar y
THE REPRESENTATION OF
INFORMATION IN A COMPUTER
1. The Decimal System
2. The Binar y System
3. The Octal System
2
4. The Hexadecimal System
Example 2. 1
Example 2. 2
2
Example 2. 3
2. Conver sion of an integer fr om decimal to binar y using decimal ar ithmetic
while &&
if
else
if
else
for
Example 2. 4
2
3. Conver sion of a fr actional number fr om decimal to binar y using decimal ar ithmetic
while &&
if
else
for
Example 2. 5
Example 2. 6
Example 2. 7
Table 2. 3 Number s r epr esented in one' s complement notation in descending or der
Example 2. 8
Example 2. 9
Table 2. 4 The cases of the sign and car r y bits in two' s complement addition / subtr action
Example 2. 10
Example 2. 11
Example 2. 12
2. 5. 1 Gr ay Codes
Table 2. 5 Gr ay code
2. 5. 2 Decimal Codes
if
then
else
if
then
else
2. 6 Summar y
Exer cises
Pr oblem 2. 1
2
Note
Pr oblem 2. 2
Table 2. 9 Table of answer s to Pr oblem 2. 2
Pr oblem 2. 3
Table 2. 10 Table of answer s to Pr oblem 2. 3
Pr oblem 2. 4
Pr oblem 2. 5
Pr oblem 2. 6
Pr oblem 2. 7
Pr oblem 2. 8
2
Pr oblem 2. 9
Pr oblem 2. 10
Pr oblem 2. 11
Pr oblem 2. 12
Pr oblem 2. 13
Pr oblem 2. 14
Note
LOGIC DESIGN OF
COMBINATIONAL CIRCUITS
Table 3. 1 The tr uth tables of 16 two-var iable and one-var iablelogic functions
Table 3. 2 Tr uth tables for defining 16 pr imitive logic functions and basic logic oper ations
AND
OR
XOR
NOT
XNOR
NAND
NOR
AND NAND
OR NOR
XOR XNOR
Example 3. 1
Table 3. 3 Der iving the canonical SOP expr ession for the Exclusive-OR function
2. Pr oduct-of-sums POSfor m wr itten fr om the output values ' 0' of the function
Example 3. 2
Table 3. 4 Der iving the canonical POS expr ession for the Exclusive-OR function
2n - 1
F = fi mi
i =0
2n - 1
F = fi + Mi
i =0
1. Cor r espondence with the Tr uth Table or the Canonical SOP Expr ession
2. Labeling Rule
3. Simplification Rule
4. Wr iting the Maximally Simplified Expr ession
Example 3. 3
Example 3. 4
Example 3. 5
3
Example 3. 6
Table 3. 5 Mapping a physical table to a logic table using positive logic
Example 3. 7
Example 3. 8
3
Table 3. 8 The function table of a par allel adder / subtr actor
Step 1
Step 2
Step 3
Step 4
Step 5
Example 3. 9
Table 3. 10 Deter mining the oper ation on the magnitude par ts of A and B
Example 3. 10
Table 3. 11 The output changes and delays for the input tr ansitions in a binar y sequence
Example 3. 11
Example 3. 12
3
3. 6. 1 Multiplexer
Example 3. 13
m
3. 6. 2 Decoder / Demultiplexer
3. 6. 3 Encoder
Example 3. 14
Example 3. 15
Example 3. 16
Table 3. 17 The function table of the macr ocell in Figur e 3. 32
Example 3. 17
3. 8 Summar y
Exer cises
Pr oblem 3. 1
Pr oblem 3. 2
Pr oblem 3. 3
3
Pr oblem 3. 4
Pr oblem 3. 5
Pr oblem 3. 6
Pr oblem 3. 7
Pr oblem 3. 8
Pr oblem 3. 9
Pr oblem 3. 10
Pr oblem 3. 11
Pr oblem 3. 12
3
Pr oblem 3. 13
Pr oblem 3. 14
Pr oblem 3. 15
Note
Pr oblem 3. 16
Pr oblem 3. 17
Pr oblem 3. 18
Pr oblem 3. 19
Pr oblem 3. 20
Pr oblem 3. 21
Pr oblem 3. 22
3
Pr oblem 3. 23
Pr oblem 3. 24
Pr oblem 3. 25
LOGIC DESIGN OF
SEQUENTIAL CIRCUITS
A
4
4. 2 Flip ?
Flops
?
?
?
?
?
?
?
Table 4. 2 The r educed state tr ansition table of an SR latch
? ?
?
? ? ?
4. 2. 2 SR Flip ?
Flop
?
?
?
?
?
?
?
?
4
Table 4. 3 The excitation table of an SR flip?
flop
?
?
4. 2. 3 J K Flip ?
Flop
?
?
?
?
?
?
?
?
?
?
Table 4. 4 The state tr ansition table of a J K flip?
flop
?
4
4. 2. 4 T Flip ?
Flop
?
?
?
?
?
?
Table 4. 7 The state tr ansition table of a T flip?
flop
4. 2. 5 D Flip ?
Flop
?
?
?
?
?
?
?
Table 4. 10 The state tr ansition table of a D flip?
flop
?
4
4. 2. 6 Pr actical Flip ?
Flop Cir cuits
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
? ?
?
?
?
?
?
?
?
?
?
?
?
? ?
?
?
?
?
?
?
?
?
?
?
?
?
?
4
?
?
?
?
?
?
?
? ?
?
?
?
S e tup time
Hold time
P ropa ga tion de la y time
?
?
?
?
?
?
?
?
?
?
?
?
? ?
? ?
?
?
?
?
?
?
4
?
?
Example 4. 1
?
?
Table 4. 13 The state tr ansition table for Example 4. 1
?
?
?
?
4. 3. 2 Fr om State ?
Tr ansition Diagr am to Finite State Machine
?
?
?
Table 4. 14 The state tr ansition table after state assignment
?
?
?
?
?
?
?
4
?
?
?
?
?
?
Example 4. 2 ?
?
?
?
Table 4. 15 The state tr ansition table of Example 4. 2
?
?
?
4
4. 5. 1 Register
?
?
?
?
?
?
?
?
?
?
4
4. 5. 2 Shift Register
?
?
? ?
?
4. 5. 3 Counter
?
?
4
?
Table 4. 17 The state tr ansition tables of the up?
counter and the down?
counter
?
?
?
?
?
? ?
?
? ? ?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
? ?
?
?
? ?
?
? ?
?
4
4. 6 Design of a Finite?
State Machine
?
?
?
?
?
?
? ?
?
?
?
?
?
?
?
Example 4. 3 ?
?
?
Step 1
4
?
?
Step 2
Step 3
?
?
?
?
?
Step 4
?
Step 5
4
4. 7 Summar y
?
?
?
?
Exer cises
Pr oblem 4. 1
?
?
?
?
?
?
Pr oblem 4. 2
?
?
?
?
Pr oblem 4. 3
?
?
?
?
?
?
?
?
?
Pr oblem 4. 4
? ?
?
Pr oblem 4. 5
?
4
Pr oblem 4. 6
?
Pr oblem 4. 7
?
Pr oblem 4. 8
?
?
?
?
?
?
Pr oblem 4. 9
?
Table 4. 21 The function table for Pr oblem 4. 9
?
?
Pr oblem 4. 10
?
?
Table 4. 22 The function table for Pr oblem 4. 10
4
Pr oblem 4. 11
?
?
?
?
?
Pr oblem 4. 12
?
?
?
Pr oblem 4. 13
?
?
Note ?
Pr oblem 4. 14
?
?
?
?
Table 4. 24 The function table for Pr oblem 4. 14
Pr oblem 4. 15
?
?
Table 4. 25 The function table for Pr oblem 4. 15
?
?
Pr oblem 4. 16
?
?
?
Pr oblem 4. 17
?
?
?
4
Pr oblem 4. 18
?
THE ARITHMETIC LOGIC UNIT
T
5
Table 5. 1 Tr uth table for the logic oper ations per for med by an SN74181 ALU when M = 1
Table 5. 2 Reduced tr uth table for X
i Ai Bi Table 5. 3 Reduced tr uth table for Y
i Ai Bi
as functions of s1 and s0 as functions of s3 and s2
Table 5. 4 Tr uth table for the ar ithmetic oper ations per for med by SN74181 ALU chip when M = 0
111
111
5. 4. 1 Designing the ALU Using Exter nal Gates for Logic Oper ations
Example 5. 1
Example 5. 2
Table 5. 6 The subtable cr eated for the ar ithmetic oper ations in Example 5. 2
Example 5. 3
5
Example 5. 4
Table 5. 8 Tr uth table of Example 5. 4 for r edesigning the input cir cuit
Example 5. 5
5
Table 5. 9 The tr uth table for the synthesis of the ALU in Example 5. 5
Table 5. 10 Function table of the ALU with the output contr olled by abcand M
Example 5. 6
Table 5. 11 The tr uth table for the ALU with a modified output cir cuit of an adder
Table 5. 12 Compar ison of the six methods of designing ALUs
!"#$ %& &()$ *)#$+
5
Example 5. 7
Table 5. 13 The function table of a simple ALU with a built-in shifter
Table 5. 14 Tr uth table of the simple ALU with a built-in shifter
5
Example 5. 8
5
Table 5. 16 The tr uth table for the design of the input par ameter s of the adder
Example 5. 9
Table 5. 17 The function table of a multifunction shifter for Example 5. 9
Table 5. 18 Inter connections of multiplexer s in a bar r el shifter for a left r otate oper ation
5. 6 Summar y
Exer cises
Pr oblem 5. 1
Note
Pr oblem 5. 2
Pr oblem 5. 3
Note
Pr oblem 5. 4
Pr oblem 5. 5
5
Pr oblem 5. 6
Pr oblem 5. 7
Table 5. 21 The function table of the ALU for Pr oblem 5. 7
Pr oblem 5. 8
5
Table 5. 22 The function table of the ALU for Pr oblem 5. 8
Pr oblem 5. 9
Pr oblem 5. 10
Pr oblem 5. 11
5
Pr oblem 5. 12
Pr oblem 5. 13
Table 5. 27 The function table of the ALU for Pr oblem 5. 13
Pr oblem 5. 14
5
Table 5. 28 The function table for Pr oblem 5. 14
Pr oblem 5. 15
Table 5. 29 The function table of the ALU for Pr oblem 5. 15
Pr oblem 5. 16
5
Step 1
Step 2
Step 3
Step 4
Step 5
Example 6. 1
6
6. 1. 2 Fast Multiplication
Step 1
Step 2
Step 3
Example 6. 2
6
Example 6. 3
Step 1
6
Step 2
Step 3
Example 6. 4
Step 1
Step 2
Step 2'
Step 3
Step 4
Step 1
Step 2
Step 3
Step 4
Example 6. 5
Step 1
Step 2
Step 3
Step 4
Example 6. 6
Step 1
Step 2
Step 3
Step 4
6
Step 1
Step 2
Step 3
Step 1
Step 2
Step 3
Example 6. 7
6
Example 6. 8
Example 6. 9
6
Example 6. 10
(
) (
)
6
(
)
(
) (
)
Example 6. 11
?
?
Table 6. 3 2 3 code vs. 4?bit two' s complement code
Excess?
Example 6. 12
Floating-point addition / subtr action
A B ma ea mb eb ma mb eb ea ea if ea eb
A B ma ea mb eb ma mb ea or ma mb eb if ea eb
A B ma ea mb eb ma ea eb mb eb if ea eb
6
Floating-point multiplication
A B ma ea mb eb ma mb ea eb .
Floating-point division
A B ma ea mb eb ma mb ea eb .
From the above expressionssome common principles can be summarized
The exponent and mantissa are treated separately. The exponents need only addition /
subtraction. The mantissa need fixed-point addition / subtractionmultiplicationand
division. The results of the two parts are combined together as the floating-point result.
The operations are usually defined as normalized operations. The initial operands are al-
ways normalizedand the result should also be normalized by shifting the mantissa and
adjusting the exponent correspondingly. Left normalization is needed for removing the
leading zeros from the mantissaand right normalization is needed if the operation on
the mantissa has caused overflow. The final result has an overflow only when the expo-
nent part has an overflow after right normalization.
Floating-point addition / subtraction is more complicated than its fixed-point counterpart.
It requires exponent equalization before the two mantissa can perform addition / subtrac-
tion. A compare operation is needed by the exponentsand a right shift operation is
needed by the mantissa. Detailed implementation of the floating-point addition / subtrac-
tion will be described next.
Step 4
Step 5
Step 6
Example 6. 13
Example 6. 14
Example 6. 15
6
6. 6 Summar y
Exer cises
Pr oblem 6. 1
6
Pr oblem 6. 2
Pr oblem 6. 3
Pr oblem 6. 4
Pr oblem 6. 5
Pr oblem 6. 6
Pr oblem 6. 7
Pr oblem 6. 8
Pr oblem 6. 9
6
Pr oblem 6. 10
Pr oblem 6. 11
Note
Pr oblem 6. 12
Pr oblem 6. 13
Pr oblem 6. 14
Note
Pr oblem 6. 15
6
Note
Pr oblem 6. 16
INSTRUCTION SET ARCHITECTURE
Example 7. 1
7
1. Memor y Dir ect Addr essing Mode
?
?
Example 7. 2
Table 7. 1 Selecting the Intel 80x86 / Pentium CPU r egister s using the REG and W fields
Table 7. 2 The Pentium-II addr essing modes for an oper and in either memor y or a r egister
!"# $%&%())#% %#*+,%#)#-./
!"# ,)$0#)#-.(.,&- .#1"-&0&2
!"# &3#%(00 $#%4&%)(-1# &4 ."# 1&)$+.#%
5(167(%8 1&)$(.,9,0,.2 ,- ."# 1&)$+.#% 4(),02
Example 7. 3
7
?
7
Example 7. 4
:(.( ;&3#)#-.
<%,.")#.,1
5&&0#(-
=",4.
!#/.>?&)$(%#
Note
!%(-/4#% &4 1&-.%&0
5,-(%21&8#8 8#1,)(0
=.%,-/
?&-8,.,&- 1&8#/ ,- ."# @AB<C= %#,/.#%
7
?
7
Example 7. 5
B&(8>=.&%#
=",4.
5&&0#(-
<%,.")#.,1
D+)$>5%(-1"
Example 7. 6
B&(8>=.&%#
7
<BE ,))#8,(.#
<BE 4+-1.,&-/
=",4.
;+0.,$02>:,3,8#
D+)$>5%(-1"
=$#1,(0
7. 5 Summar y
Exer cises
Pr oblem 7. 1
7
Pr oblem 7. 2
Note
Pr oblem 7. 3
Pr oblem 7. 4
Note
7
Pr oblem 7. 5
Pr oblem 7. 6
Note
Pr oblem 7. 7
Table 7. 3 The instr uctions available for use in Pr oblem 7. 7
Pr oblem 7. 8
<11+)+0(.&%
;#)&%2)#)&%2
=.(16
B&(8 /.&%#
7
Pr oblem 7. 9
THE CENTRAL PROCESSING UNIT
!"#"$% &()%"&
*+"&,-)#" &()%"&
!"#./ 01)+"& &()%"&
*+-2 &()%"&
3#% &()%"&
4&1(&#, .1$+"&
*+%"&$.")1+ &()%"&
8
5,1&6 -)&." #--&%%)+( ,1-
*+-2- #--&%%)+( ,1-
49 &:#"); #--&%%)+( ,1-
8
1. Update the Pr ogr am Counter
2. Calculate the Effective Addr ess
3. Per for m Special Contr ol Functions
Table 8. 1 The tr uth table for designing the datapaths of a simple CPU
2. Car r y look-ahead ALU
3. ALU function decode cir cuit
4. Q r egister
5. ALU sour ce oper and decode cir cuit
7. ALU destination decode cir cuit
8
Table 8. 2 The function table for the ALU destination selection of the Am2901
8. 6 Summar y
Exer cises
Pr oblem 8. 1
Pr oblem 8. 2
Note
Pr oblem 8. 3
Note
Pr oblem 8. 4
Note
Pr oblem 8. 5
Note
Pr oblem 8. 6
Pr oblem 8. 7
Pr oblem 8. 8
8
THE CONTROL UNIT
T
9
Example 9. 1
!"#$"%!"& (&)*
!+,-.* !"* (&)*
/&,"+,0&01 (&)*
!+,-.* 1*20*,3* (&)*
40."+ 1*20*,3* (&)*
/&,"+,0&01 (&)*
Example 9. 2
9
Example 9. 3
!"#"* 5
!"#"* 6
!"#"* 7
!"#"* 8
9330(0.#"&$ 9
:*-+1"*$ ;
:*-+1"*$ 4
Table 9. 2 The contr ol pr ocess of an 8-bit multiplication
</
=:
49:
4>:
9
Table 9. 3 The instr uction set of a simple MIPS-like RISC computer
=,1"$03"+&, ?*"3@
=,1"$03"+&, )*3&)+,-
:*-+1"*$ $*#)
A*$#"+&, *B*30"+&,
4*(&$C $*#)%D$+"*
:*10." 1"&$#-*
9. 4. 3 Design of the Oper ation Char t for the Instr uction Set
9
?
9
?
?
?
9
Table 9. 4 State-tr ansition table for designing the timing signals
Step 1
Step 2
Step 3
?
9. 5. 1. 2 Hor izontal Micr opr ogr amming vs. Ver tical Micr opr ogr amming
1. Hor izontal Micr opr ogr amming
56 ?&$ +,1"$03"+&, ?*"3@
65 ?&$ )#"# D$+"*
66 ?&$ )#"# $*#)
55 ?&$ ,& (*(&$C &*$#"+&,
Table 9. 5 The micr opr ogr am list for a simple RISC computer
9. 6 Summar y
Exer cises
Pr oblem 9. 1
Table 9. 6 The given two-addr ess instr uction set for Pr oblems 9. 1-9. 2
?
?
Notes
Pr oblem 9. 2
Pr oblem 9. 3
9
Table 9. 7 The given one-addr ess instr uction set for Pr oblems 9. 3-9. 4
?
?
?
Pr oblem 9. 4
Pr oblem 9. 5
9
Note
9
Pr oblem 9. 6
Note
Pr oblem 9. 7
Table 9. 9 The instr uction set for Pr oblems 9. 7-9. 9
9
Pr oblem 9. 8
Pr oblem 9. 9
PRIMARY MEMORY
10
!" !##$%&&"( )%*+,"&)
?
-%).$/ *%00 ,$$,/ ,"# &%"&%12$3% ,)405%$&
6,3, "1.73 0,3*+%& ,"# *."3$.0 0.(*
80.*9 (%"%$,3.$&
10
10
10
Example 10. 1
10
Example 10. 2
Example 10. 3
10
Example 10. 4
10
10
10
(
)
(
)
Example 10. 5
(
)
(
)
(
)
(
)
( )
Table 10. 1 The speedups for thr ee par allel pr imar y memor y or ganizations
? ?
? ?
?
?
10
10. 6 Summar y
Exer cises
Pr oblem 10. 1
Pr oblem 10. 2
Pr oblem 10. 3
Pr oblem 10. 4
Pr oblem 10. 5
10
Pr oblem 10. 6
Pr oblem 10. 7
Pr oblem 10. 8
Pr oblem 10. 9
INPUT / OUTPUT
11
!"# $%&& &()*&$
+&),- $%&& &()*&$
.)/0 $%&& &()*&$
123 &()*&$
4&()*& *"567"88&7$
123 )56&79:*&$
11
11
;<14 !&(&8 =
;<14 !&(&8 >
;<14 !&(&8 ?
11
;<14 !&(&8 @
;<14 !&(&8 A
;<14 !&(&8 B
;<14 !&(&8 C
;<14 !&(&8 >=
;<14 !&(&8 >B
Example 11. 1
?
11
?
?
? ?
?
?
?
?
?
?
?
4:6: D,99&7 7&/)$6&7 E4F;G
4+< :7&$$ 7&/)$6&7 E4<;G
H"7 *",56&7 EHIG
I"567"82$6:6,$ 7&/)$6&7 EIJ;G
?
?
?
?
?
? ?
11
?
?
?
?
?
?
?
?
?
?
?
?
?
?
156&77,%6 7&K,&$6)5/ *)7*,)6
2. Vector ed Inter r upt by a Pr ior ity Encoder
Example 11. 2
11. 4. 3 Inter r upt Ser vicing and Inter r upt Retur ning
M"5 %7&&-%6)(& )56&77,%6
N7&&-%6)(& )56&77,%6
11
11
Example 11. 3
11
1 1
0
1
11
11
Table 11. 1 Deter mining the Hamming code length r elative to the length of data bits
Example 11. 4
11
11
11
?
?
?
?
?
? ? ?
?
?
11
11
11
11
11
11. 7. 2 SCSI Small Computer System Inter facePar allel Inter face
11
11
F,$ O7&&
<7D)67:6)"5
J&8&*6)"5
;&$&8&*6)"5
159"7-:6)"5 67:5$9&7
I"--:5
4:6:
J6:6,$
+&$$:/&
1. Ar bitr ation
11
2. Selection
3. Infor mation Tr ansfer
4. Reselection
11
I"567"8
1$"*07"5",$
F,8P
156&77,%6
11. 7. 3. 3 Plug-and-Play
11
11
O:)7 :7D)67:6)"5
Q7/&56 :7D)67:6)"5
<$L5*07"5",$ 67:5$-)$$)"5
11
1$"*07"5",$ 67:5$-)$$)"5
11
11. 8 Summar y
Exer cises
Pr oblem 11. 1
Pr oblem 11. 2
11
Pr oblem 11. 3
Pr oblem 11. 4
Pr oblem 11. 5
Pr oblem 11. 6
Table 11. 2 The list of I / O addr ess mapping for Pr oblem 11. 6
11
Pr oblem 11. 7
Pr oblem 11. 8
Pr oblem 11. 9
Table 11. 4 The instr uction usage for Pr oblem 11. 9
PIPELINING
I ?
?
?
?
?
?
?
Example 12. 1
12
Example 12. 2
?
?
?
?
?
?
?
?
?
Example 12. 3 ?
?
?
12
?
?
?
?
?
?
Example 12. 4 ?
?
?
?
?
?
?
?
?
12
?
?
12
?
?
?
?
?
Br anch Gr oup
Table 12. 1 Mapping the execution steps of the instr uctions in Table 9. 3 to a pipeline
J ump Gr oup
?
?
?
12
12. 4. 3. 1 Data Hazar d Resolved by For war ding fr om ALU Output to ALU Input
12
12. 4. 3. 2 Data Hazar d Resolved by For war ding fr om ALU Output to Br anch Input
12
12. 4. 3. 3 Data Hazar d Resolved by For war ding fr om ALU Output to Memor y Input
?
?
1. Pipeline Stall
?
2. Br anch Pr ediction
3. Delayed Br anch
4. Multiple Str eams
5. Loop Buffer
12
?
?
Example 12. 5 ?
12
?
?
?
?
?
?
?
??
? ??
12
4. Instr uction Execution
5. Instr uction Completion and Instr uction Retir ing
? ? ? ?
? ?
? ??
12. 5. 3. 3 Out ?of?or der Issue with Out ?of?or der Completion
??
?
12
?? ??
12. 6 Summar y
?
?
?
?
?
?
?
?
Exer cises
Pr oblem 12. 1
12
Pr oblem 12. 2
?
?
?
?
?
Pr oblem 12. 3
?
?
?
Pr oblem 12. 4
12
?
?
?
?
Pr oblem 12. 5
Table 12. 2 The instr uction set for Pr oblem 12. 5
?
12
Pr oblem 12. 6
?
REFERENCES
4
68000
?
?
?
?
68000