慶應義塾大学
2008年度 秋学期
コンピューター・アーキテクチャ
Computer Architecture
第1回 9月30日 Lecture 1, September 30:
What's in a Computer?
Outline of This Lecture
- Review of Students' Programming Backgrounds
- Course Outline
- Grading Criteria and Requirements
- Contact Information, Office Hours and Class Notes
- What's a Computer?
- What's in a Computer?
- Fundamentals of Computer Design
- Introduction
- Technology Trends
- Quantitative Principles of Design
- Homework
Review of Students' Programming Backgrounds
Take a sheet of paper. On it, put your name and student ID number.
Then answer the following questions:
- Do you currently have a working C compiler on your system?
現在、C言語のコンパイラーを持っていますか。
- List the operating systems and versions you have used:
今までの使ったことがあるオペレーティングシステムをリストアップしてください。
Microsoft Windows, MacOS, Linux, FreeBSD, Solaris?
- How many years ago did you start programming?
何年前にプログラ
ミングを始まったでしょう。
- Have you administered a multi-user computer system before, such as
a web server or file server?
マルチユーザーのコンピューター(ウェブサーバー、ファイルサーバーなど)を管理したことありますか。
- List the languages you have programmed in:
今までの使ったことがある言語をリストアップしてください:
assembler, BASIC, C, C++, Fortran, Java, Lisp, Perl, Python, Ruby, sh, ...?
- Which tools have you used:
このリストの中にはどのツールを使ったことがある:
make, CVS, RCS, Microsoft VisualC etc.,
automake, grep, sed, awk, lex/flex, yacc/bison, Spirit, ...?
- What is the longest program you have written, measured in lines?
ひとつのプログラムは何行まで書きましたか。
- When you write code, do you write comments?
プログラムを書いているとき、コメントを書きますか。
- Have you worked in a team to write one program? What source code
control system did you use? How did you divide up the work, and how
did you define and test interfaces between members of the team?
一
人以上のグループでプログラムを書いたことありますか。ソースコードコント
ロールはどうやってしましたか。仕事がどうやって分割しましたか。インター
フェースの定義のしかたには何をしましたか。
The lectures for this class will be in Japanese, but
non-Japanese-speaking students are encouraged to join. Adequate
materials to learn the topic and complete the assignments will be
available in English.
ムーアの法則の後期に入ったということは、先端のマルチコア・マイクロプロセッサは新しい時代を迎えたということだ。これからのコンピューターデザインはその事実をふまえなければなりません。並列データ処理、データの転送、熱等は非常に重要なファクターです。現在のコンピュータ環境を支えるマイクロプロセッサの技術を中心に扱い、動作原理や高速化の原理について考えます。次のような課題を扱います。
- 計算機の構成と動作原理
- 高級言語と機械語
- コンパイラと最適化技術
- オペレーティングシステムとプロセッサの関係
- プロセッサの構成と設計
- インプット・アウトプットシステム、データストレージシステム
- マルチプロセッサネットワーク
以下の事項を注意してください。
内容を理解し、課題を行う上で基本的なC言語の知識が必要となる場合があります。しかし、大きなプログラムや複雑なプログラムを作成する能力は必要ありません。C言語の文法 (繰り返し、条件判断、関数呼出し、記憶クラスなど) の知識だけで十分です。したがって、Java 言語や Pascal 言語などの他の手続き型言語しか知らなくても、数時間の自習で理解できます。
--------
We have entered the late Moore's Law period of computer architecture, as shown by the latest multicore microprocessors. From this point forward, computer design must concentrate on parallel processing, data transfer, and heat management as especially important factors. Studying modern microprocessor design, we will see where performance is created in computer systems, including:
- Structure and development of processors
- High-level language and machine language
- Compiler optimization
- Relationship of architecture and operating systems
- Input/output systems, data storage systems
- Multiprocessor networks
Note:
Students will be expected to understand at least one high-level language as part of the course. Lectures will be in Japanese, but non-Japanese speaking students are encouraged to join the class. Sufficient materials will be available in English to learn the material and complete the assignments.
教材
Course Outline
教科書 Textbook
The textbooks are available in the Seikyo:
コンピュータの構成と設計~ハードウエアとソフトウエアのインタフェース 第3版 (上)
デイビッド・A. パターソン (著), ジョン・L. ヘネシー (著), David A. Patterson (原著), John L. Hennessy (原著), 成田 光彰 (翻訳)
日経BP社
ISBN-10: 482228266X
ISBN-13: 978-4822282660
and the second volume:
コンピュータの構成と設計~ハードウエアとソフトウエアのインタフェース 第
3版 (下)
デイビッド・A. パターソン (著), ジョン・L. ヘネシー (著), David A. Patterson (原著), John L. Hennessy (原著), 成田 光彰 (翻訳)
日経BP社
ISBN-10: 4822282678
ISBN-13: 978-4822282677
Computer Organization and Design: The Hardware-Software
Interface, third edition
David A. Patterson and John L. Hennessy
Morgan Kauffman, 2007
ISBN-10: 0123706068
ISBN-13: 978-0123706065
A recommended, but not required, more advanced text:
コンピュータアーキテクチャ 定量的アプローチ 第4版
John L. Hennessy (著), ジョン・L・ヘネシー (著), デイビッド・A・パター
ソン (著), David A. Patterson (著), 中條 拓伯 (監修, 翻訳), 吉瀬 謙二
(翻訳), 佐藤 寿倫 (翻訳), 天野 英晴 (翻訳)
翔泳社
ISBN-10: 4798114405
ISBN-13: 978-4798114408
Computer Architecture: A Quantitative Approach, fourth edition
John L. Hennessy and David A. Patterson
Morgan Kauffman, 2007
ISBN: 978-0-12-370490-0
Lecture by Lecture
- 第1回 9月30日
Lecture 1, September 30: What's in a Computer?
- 第2回 10月7日
Lecture 2, October 7: Fundamentals of Computer Design
- 第3回 10月14日 プロセッサー:数学
Lecture 3, October 14: Processors: Arithmetic
- 第4回 10月21日 プロセッサー:命令の基本
Lecture 4, October 21: Processors: Basics of Instruction Sets
- 第5回 10月28日 プロセッサー:命令とデータパス
Lecture 5, October 28: Processors: Instruction Sets and the Data Path
- 第6回 11月4日 プロセッサー:パイプラインの基本
Lecture 6, November 4: Processors: Basics of Pipelining
- 第7回 11月11日 メモリ:キャッシュ
Lecture 7, November 11: Memory: Caching and Memory Hierarchy
- 第8回 11月18日 メモリ:仮想記録
Lecture 8, November 18: Memory: Virtual Memory
- 第9回 12月2日
Lecture 9, December 2: Systems: Shared-Memory Multiprocessors
- 第10回 12月9日
Lecture 10, December 9: Systems: Distributed-Memory Multiprocessors
and Interconnection Networks
- 第11回 12月16日 入出力
Lecture 11, December 16: Basics of I/O and Storage Systems and
Designing for Networks
- 第12回 1月6日 RAID: ストレージの並列と安全性
Lecture 12, January 6: RAID: Parallelism and Protection in Storage Systems
- 第13回 1月20日
Lecture 13, January 20: The Future and the Past: Review
Requirements
The course consists of thirteen ninety-minute classes. Students are
expected to read a large amount of material from the textbook and
accompanying CD, contribute to classroom discussions, complete
weekly homework, and pass a final exam.
成績の仕方
Grading
Your grade will be determined as follows:
- 授業の討論/Class participation: 10%
- 宿題/Homework: 50%
- 期末テスト/Final exam: 40%
宿題
Homework
Twelve homework assignments will be handed out; you are
expected to complete ten. Each homework will typically
consist of:
- 3-5 problems from one of the textbooks
- A short programming assignment (typically a performance
measurement) or some use of the simulator that comes with the
textbook.
Homework is due at the start of class each week. Homework will be
submitted via the SFS system.
Contacting Me/Office Hours
連絡先/オフィスアワー
If you need to contact me, email is the preferred method. Please put
"COMP-ARCH:" in the Subject field of the email. If I do not respond to a
query within 24 hours, please resend. For more urgent matters, junsec
should know how to get ahold of me.
Office Hours, Fall 2008秋のオフィスアウアー:Wednesday (水曜日),
9-12, Delta N210. You may come to my office during this time without
an appointment. If you wish to see me otherwise, you can attempt to
find me directly, or send me email to arrange an appointment.
What's a Computer?
What's in a Computer?
(Here's the fun part...)
Fundamentals of Computer Design
Introduction
Processors have gotten 6,505 times faster in 27 years! Of that, about
seven times is due to architecture, the rest is due to improvements in
technology: smaller, faster transistors and shorter, faster wires.
1978:
Image
from NetBSD
VAX Gallery.
Image
from Carlo's
Hardware and Embedded Systems.
2004(?):
A 300mm wafer containing 117 AMD Opteron chips implemented in a 90nm process.
Technology Trends
The current (2007) transistor gate length in a microprocessor is about
25 nanometers. That's about fifty times the lattice constant of
crystalline silicon. We already effectively build transistors from
a countable number of atoms.
One important impact of the continuing increase in the number of
transistors in a chip is power consumption. The number of
transistors is increasing faster than the power per transistor is
dropping. A key innovation is using hafnium as the gate
dielectric, as Intel is doing; they claim 100x improvement in current
leakage when the transistor is off, which is a huge improvement in
total power consumption.
An engineer from Intel said at a recent conference that, by 2014, a
chip will contain 100 billion transistors, 20 billion of which
don't work, and another 10 billion of which will quit during the
lifetime of the chip.
定量てきなデザイン概念
Quantitative Principles of Design
Hennessy & Patterson's Five Principles:
- Take Advantage of Parallelism
- Principle of Locality
- Focus on the Common Case
- Amdahl's Law
- The Processor Performance Equation
I would add to this one imperative: Achieve Balance.
Take Advantage of Parallelism
Parallelism can be found by using multiple processors on different
parts of the problem, or multiple functional units (floating point
units, disk drives, etc.), or by pipelining, dividing an
individual computer instruction into several parts and executing the
parts of different instructions at the same time in different parts of
the CPU.
Principle of Locality
Programs and data tend to reuse data and instructions that have been
recently used. There are two forms of locality: spatial
and temporal. Locality is what allows a cache memory to
work.
Focus on the Common Case
The things that are done a lot should be fast; the things that are
rare may be slow.
Amdahl's Law
Amdahl's Law tells us how much improvement is possible by
making the common case fast, or by parallelizing part of the
algorithm. In the example below, 3/5 of the algorithm can be
parallelized, meaning that three times as much hardware applied to the
problem gains us only a reduction from five time units to three.
Some problems, most famously graphics, are known as "embarrassingly
parallel" problems, in which extracting parallelism is trivial, and
performance is primarily determined by input/output bandwidth and the
number of processing elements available. More generally, the
parallelism achievable is determined by the dependency graph.
Creating that graph and scheduling operations to maximize the
parallelism and enforce correctness is generally the shared
responsibility of the hardware architecture and the compiler.
プロセッサー・パフォマンス定式
The Processor Performance Equation
CPU time = |
(seconds
)/
program
|
= |
(Instructions
)/
program
|
× |
(Clock cycles
)/
Instruction
|
× |
(Seconds
)/
Clock cycle
|
宿題
Homework
This week's homework (submit via SFS):
- Demonstrate that you have a working compiler setup where you will
be able to write programs for class. Capture the output of the
compilation and execution of a simple program (such as "Hello, world")
and submit it
through the SFS
system. Include the amount of time it took you to complete this
exercise.
- Determine all of the information that you can about the hardware
of your own PC:
- CPU manufacturer, type, and clock speed.
- Type, amount, and speed of memory.
- Size of cache memories.
- Type, size, and speed of disk (and its I/O interface).
- Can you find out the chip set type?
- Determine the exact version of the operating system and compiler
you are using.
- If you have additional thoughts about the above discussion of
programming experience, please email me.
- Read the text for next week.
Next Lecture
Next lecture:
第2回 10月7日
Lecture 2, October 7: Fundamentals of Computer Design
以下で、P-Hはコンピュータの構成と設計~ハードウエアとソフトウエアの
インタフェース 第3版、
H-Pはコンピュータアーキテクチャ 定量的アプローチ 第4版.
Below, P-H is Computer Organization and Design: The
Hardware-Software Interface, and H-P is Computer Architecture:
A Quantitative Approach.
Readings for next time:
- Follow-up from this lecture:
- P-H: Chapter 1
- H-P: Chapter 1.1 - 1.12
- For next time:
Additional Information
その他