慶應義塾大学
2007年度 秋学期
コンピューター・アーキテクチャ
Computer Architecture
第1回 10月1日 Lecture 1, October 1:
Fundamentals of Computer Design
Outline of This Lecture
- Review of Students' Programming Backgrounds
- Course Outline
- Grading Criteria and Requirements
- Contact Information, Office Hours and Class Notes
- Fundamentals of Computer Design
- What's a Computer?
- Introduction
- Technology Trends
- Quantitative Principles of Design
- Design Goals: Measuring and Designing for Performance
- Design Goals: Dependability
- 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 言語などの他の手続き型言語しか知らなくても、数時間の自習で理解できます。
本格的な参考書として Hennessy & Patterson, "Computer Architecture, Fourth Edition: A Quantitative Approach" (ヘネシー・パターソン(ヘネパタと呼ばれている))最新刊はまだ翻訳されていません。
--------
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. The textbook will be Hennessy & Patterson, "Computer Architecture, Fourth Edition: A Quantitative Approach", which has not yet been translated into Japanese. 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
Computer Architecture: A Quantitative Approach, fourth edition
John L. Hennessy and David A. Patterson
Morgan Kauffman, 2007
ISBN: 978-0-12-370490-0
Note: The text is only available in English. My
apologies, but it is the most important book on computer
architecture available anywhere in the world. It is also a very
advanced text. My intention is to teach from the text
repeatedly, with more advanced classes going into each chapter more
deeply. So, the book is expensive but should help you for years.
Lecture by Lecture
- 第1回 10月1日
Lecture 1, October 1: Fundamentals of Computer Design
- 第2回 10月15日
Lecture 2, October 15: Processors: Basics of Instruction Sets
- 第3回 10月22日
Lecture 3, October 22: Processors: Arithmetic
- 第4回 10月29日
Lecture 4, October 29: Processors: Basics of Pipelining
- 第5回 11月5日
Lecture 5, November 5: Memory: Caching and Memory Hierarchy
- 第6回 11月12日
Lecture 6, November 12: Memory: Virtual Memory
- 第7回 11月19日
Lecture 7, November 19: Systems: Shared-Memory Multiprocessors
- 第8回 12月3日
Lecture 8, December 3: Systems: Distributed-Memory Multiprocessors
and Interconnection Networks
- 第9回 12月10日
Lecture 9, December 10 (DEC-10 Day): Systems: Multi-Core Chips
- 第10回 12月17日
Lecture 10, December 17: Processors: Instruction-Level Parallelism
- 第11回 1月7日 入出力
Lecture 11, January 7: Basics of I/O and Storage Systems and
Designing for Networks
- 第12回 1月18日 金曜日!
Lecture 12, January 18 (n.b.: Friday!): RAID: Parallelism and
Protection in Storage Systems
- 第13回 1月21日
Lecture 13, January 21: 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 the textbook
- A short programming assignment (typically a performance measurement)
Homework is due at the start of class each week.
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 2007秋のオフィスアウアー:Wednesday (水曜日),
9-12, Delta N205. 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.
Fundamentals of Computer Design
What's a Computer?
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
|
Design Goals: Measuring and Designing for Performance
To be discussed if time permits.
Design Goals: Dependability
To be discussed if time permits.
宿題
Homework
This week's homework (submit via email):
- 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 email it to me. 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月15日
Lecture 2, October 15: Processors: Basics of Instruction Sets
Readings for next time (two weeks):
- Follow-up from this lecture: Chapter 1.1 - 1.12
- For next time: Appendix B.1 - B.7
Additional Information
その他