慶應義塾大学
2010年度 秋学期
コンピューター・アーキテクチャ
Computer Architecture
第5回 10月26日
Lecture 5, October 26: Instruction Sets and the Data Path
Outline of This Lecture
- Using the MIPS Simulator
- Homework
- n.b.: Lecture 7, two weeks from now, will be rescheduled!
Using the MIPS Simulator
Note: on MacOS, you will need spim 7.2 (or possibly later),
available on the
web. (Actually, it might not be a bad idea for everyone to use
the latest, although I installed 7.0 from the CD in the book.)
You will need vecadd.s, a short MIPS
assembly program.
Here are screen shots from spim (Linux), xspim (Linux),
PCspim (Windows) and spim (Mac) versions of the tool.
Things to note in the images above, as well as your own execution runs:
- Watch the advance of the PC (program counter) as you step
through the program.
- By convention, most of the registers have two names, Rxx and a
more mnemonic one indicating the use.
- The floating point registers are either single-precision, or a
pair of them (e.g., F0 and F1) are used as one double-precision FP
register.
- Notice especially the precision
and accuracy of the FP numbers in the output, compared to the
values we intended! This is an important fact!
宿題
Homework
This week's homework (submit via email):
- Modify vecadd.s to multiply two four-by-four matrices and
print the results (行列の掛け算). Call it arraymult.s.
vecadd.sを改変して、4次の正方行列をかけ算するプログラムarraymult.sを
作りなさい. Include a printout of the output. Use these arrays:
array1: .float 3.14159265, 2.71828183, 1.0, -0.10
1.0, 0.0, 1.0, 0.0
0.0, 1.0, 0.0, 1.0
-1.0, 1.0, -1.0, 1.0
array2: .float 2.71828183, 1.0, 3.14159265, 1.0
1.0, 0.0, 1.0, 0.0
-1.0, 1.0, -1.0, 1.0
3.0, 2.0, 1.0, 0.0
Next Lecture
Next week, we will continue with the discussion of processor
architecture, getting into the fun stuff: pipelining!
Next lecture:
第6回 11月3日 プロセッサー:パイプラインの基本
Lecture 6, November 3: Processors: Basics of Pipelining
Readings for next time:
- P-H:
- H-P: Appendix A.1 and A.2
Additional Information
その他