SlideShare a Scribd company logo
1 of 50
第5章 コンピュータアーキテクチャ
目次
 Hackコンピュータ
・ノイマン型コンピュータ
・ノイマン型コンピュータの構成
・Hackコンピュータ
メモリ
CPU
I/Oデバイス
 実装
・データメモリ
・CPU
・コンピュータ
ノイマン型コンピュータ
 プログラム内蔵方式を採用したコンピュータ
 プログラム内蔵方式
記憶装置(メモリ)に記憶されたプログラムの内容に従ってコンピュータを制御
例
・万能チューリングマシン
・ノイマン型コンピュータ
→ Hackコンピュータはノイマン型
ノイマン型コンピュータの構造
 ノイマン型コンピュータは
・メモリ
・CPU
・入出力装置(I/Oデバイス)
で構成される
CPUメモリ
(命令、データ)
入力
出力
Hackコンピュータ
 Hackコンピュータを構成している
・メモリ
・CPU
・入出力装置(I/Oデバイス)
の機能
 Hackコンピュータの動作の流れを見る
Hackコンピュータの各装置の機能
メモリ
 多くの情報を記憶できる記憶装置
 メモリは、扱う情報の種類によって
・命令メモリ
・データメモリ
に分かれる
命令メモリ
 CPU が実行する内容(命令)を保持
機械語
1+1 を実行
~~~
命令メモリ
CPU
(命令の集まり)
データメモリ
 ALU(算術演算と論理演算を処理する装置)の計算で用いるデータが格納されている
レジスタ
データメモリ
アクセス
ALU
CPU
 レジスタ、ALU、制御ユニットで構成される装置
制御
ユニット
ALU
複数の
レジスタ
CPU
ALU
 算術演算と論理演算を計算する装置
→ 計算の内容は制御ビットによって決まる
→ 詳しくは2章を参照
レジスタ
 メモリと同じ記憶装置
長所
メモリよりもデータを素早く取り出せる
→ アドレスアクセスなし & CPUに近い
短所
メモリよりも容量が少ない
→ レジスタ : 1ワード
メモリ : 数十Kワード 以上
レジスタ
 レジスタの種類
役割に応じて
・データレジスタ
・アドレスレジスタ
・プログラムカウンタ(PC)
に分かれる
レジスタ
データレジスタ
ALUの計算で用いる値を一時的に格納しておく
→ 計算ですぐに用いる値を格納
(例) (a-b)*c の場合
(a-b)の結果を一時的に覚えておく必要あり
(a-b)
ALU
データレジスタ
a
b
c
①
①
③ ③
②
レジスタ
アドレスレジスタ
データメモリにアクセスするアドレスを格納
(例) アドレス値1にアクセス
アドレスレジスタ
データメモリ
アクセス
アドレス値 1
レジスタ
プログラムカウンタ(PC)
CPUが次に行うべき命令を命令メモリから選択
1+1 を実行
~~~
命令メモリ
PC
アドレス値 2
CPUで実行
制御ユニット(デコーダー)
 命令の内容を解読し、適切なハードウェア装置に情報送信
(例) 命令が 1110110000010000 の場合
1110110000010000 → Aレジスタの値をDレジスタに格納する
制御
ユニット
命令
Aレジスタ
Dレジスタ
読み込み
書き込み
送信
解読
入出力デバイス
 I/Oデバイスはメモリを介して、Hackコンピュータと情報をやり取り
 メモリにはI/Oデバイス専用の領域(メモリマップ)が設けられている
I/O
データ
メモリ
メモリ
マップ
Hackコンピュータの動作の流れ
メモリとCPU
 メモリとCPUの全体図
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
CPU
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
① PCから命令メモリ
次に実行する命令があるアドレスにアクセス
→ 次の命令 = ROM[PC]
PC
命令メモリ
(ROM)
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
② 命令のフェッチ
命令メモリから
制御ユニット(デコーダー) と アドレスレジスタ
に命令が送られる
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット
 基本的な動作の流れ
② 命令のフェッチ
命令 = C命令(計算内容) + A命令(アドレス)
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット
制御ユニット
に格納
アドレスレジスタ
に格納
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
③ 制御ビットの送信
制御ユニットの計算内容(制御ビット)が
ALUに送られる
制御
ユニット ALU
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
④ データアクセス&データ送信
データメモリにアクセス
→ データをALUに送る
アドレス
レジスタ
ALU
データメモリ
(RAM)
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
⑤ 計算の実行&結果の格納
ALUで計算を実行
→ 計算結果をデータレジスタに一時的に保管
ALU
データ
レジスタ
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
 基本的な動作の流れ
⑤ 計算結果の使用
計算結果の使用命令をデータレジスタに送信
→保管した計算結果をALUに送信
ALU
データ
レジスタ
制御
ユニット
 基本的な動作の流れ
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット
ALU
データメモリ
(RAM)
データ
レジスタ
アクセス
計算
内容
アドレス
アクセス
制御ビット
データ送信
計算結果の
一時保管
計算結果を
使うか否か
計算結果の
使用
1.各レジスタに選択ビットを送る
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
CPU
その他の流れ
1.各レジスタに選択ビットを送る
PC アドレス
レジスタ
制御
ユニット 書き込み
読み込み
次の命令
ジャンプ
リセット
2. イミディエイトアドレッシングに関する動作
PC
命令メモリ
(ROM)
アドレス
レジスタ
制御
ユニット ALU
データメモリ
(RAM)
データ
レジスタ
CPU
その他の流れ
2. イミディエイトアドレッシングに関する動作
メモリアクセス
・直接アドレッシング
データメモリにアクセスして、データを取り出す
→ アドレスレジスタには、アドレスが格納
・イミディエイトアドレッシング
アドレスレジスタにデータを格納
アドレス
レジスタ
データメモリ
(RAM)
データ
アドレス
レジスタ
データ
2. イミディエイトアドレッシングに関する動作
・イミディエイトアドレッシング
アドレスレジスタ内のデータを直接ALUに送る
アドレス
レジスタ データ
ALU
実装
 データメモリ(Memory)、CPU、コンピュータ(Computer)を実装
 命令メモリはビルトイン回路を使用
データメモリ(Memory)
 RAM16K と Screen と Keyboardから構成される
回路名 アドレス範囲(10進数)
RAM16K 0 ~ 16383
Screen 16384 ~ 24575
Keyboard 24576
RAM16K
Screen
Keyboard
In[16]
Address[15]
load
out[16]
データメモリ(Memory)
 ヒント1 : 2進数アドレスの上位2桁に注目
回路名 アドレス範囲(10進数) アドレス範囲(2進数)
RAM16K 0 ~ 16383 (000・・・0) ~ (011・・・1)
Screen 16384 ~ 24575 (100・・・0) ~ (101・・・1)
Keyboard 24576 (111・・・1)
RAM16K
Screen
Keyboard
In[16]
Address[15]
load
out[16]
データメモリ(Memory)
 ヒント2 :上位2ビットの値に応じて、loadをどこに送るか決める
(例) 上位2ビット = 01
回路名 アドレス範囲(2進数)
RAM16K (000・・・0) ~ (011・・・1)
Screen (100・・・0) ~ (101・・・1)
Keyboard (111・・・1)
???load
01
RAM16K
Screen
Keyboard
load
0
0
CPU
 制御ユニット(デコーダー)、レジスタ、ALUで構成
 デコーダーでは
・ALUの選択ビット
・各レジスタの選択ビット
を生成する
CPU
参考手順
1. 命令内容の分割 (p.70参照)
2. 最上位ビットからA命令かC命令かの区別
3. 各レジスタの選択ビットを作成
A命令の場合はAレジスタのみに書き込み
C命令の場合はdest区間に対応するレジスタに書き込み
デコーダー
1
2
3
PC
 選択ビットはreset、load、inc の3つ
ソフトウェア側の動作
・reset : 初めの命令に戻る
・load : ループ、分岐
・inc : 上から1つずつ読み込む
0を出力
過去の特定の
データを出力
(ジャンプ)
前のデータに+1した
ものを出力
~~~~~~~
~~~~~~~
~~~~~~~
~~~~~~~
~~~~~~~
inc
inc
inc
inc
load reset
PC
 1つの命令が終わると基本的にPCは+1されていくので、 inc = true
 resetはCPU入力のreset
 loadは ALUの計算結果(zrとng)とC命令のjump区間によって決定
load作成に関して
zr : out = 0
Ng : out < 0
と
p.73のjump区間に関する表を参照
PC
jump 効果 zrとngによる表現
0 0 0 No jump false
0 0 1 If out > 0 jump not (zr or ng)
0 1 0 If out = 0 jump zr
0 1 1 If out ≥ 0 jump not ng
1 0 0 If out < 0 jump ng
1 0 1 If out ≠ 0 jump not zr
1 1 0 If out ≤ 0 jump zr or ng
1 1 1 Jump true
zr : out = 0
ng : out < 0
Computer
 CPUと2種メモリによって構成される
p.105参照

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Computer system5