Microsoft PowerPoint - 3C¬ì§Þ»P¥Í¬¡-chapter2

Similar documents
CC213

1 CPU

CC213

Microsoft PowerPoint - chap2.ppt

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

CH01.indd

C++ 程式設計

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

投影片 1

Microsoft Word htm

高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 计 算 机 应 用 基 础 刘 升 贵 年 8 月

科学计算的语言-FORTRAN95

PowerPoint Presentation

untitled

FY.DOC

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

Microsoft Word _2 課本1225_OK_0222修.doc

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

Microsoft PowerPoint - STU_EC_Ch04.ppt

投影片 1

mvc

els0xu_zh_nf_v8.book Page Wednesday, June, 009 9:5 AM ELS-0/0C.8

《计算机应用基础》学习材料(讲义)

r_09hr_practical_guide_kor.pdf

Process Data flow Data store External entity 6-10 Context diagram Level 0 diagram Level 1 diagram Level 2 diagram

untitled

<4D F736F F D20C9CFBAA3BFC6BCBCB4F3D1A7D0C5CFA2D1A7D4BA C4EAC7EFBCBEC8EBD1A7B2A9CABFD7CAB8F1BFBCCAD4CAB5CAA9CFB8D4F22D C8B7B6A8B8E5>

92 (When) (Where) (What) (Productivity) (Efficiency) () (2) (3) (4) (5) (6) (7) em-plant( SiMPLE++) Scheduling When Where Productivity Efficiency [5]

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

OSI OSI 15% 20% OSI OSI ISO International Standard Organization 1984 OSI Open-data System Interface Reference Model OSI OSI OSI OSI ISO Prototype Prot

摘 要 在 這 忙 碌 的 社 會 中, 普 遍 人 們 運 動 時 間 其 實 並 不 充 裕, 體 力 越 來 越 差 的 情 況 下 還 隨 意 飲 食 導 致 身 體 健 康 越 來 越 差, 因 此 本 專 題 打 算 利 用 健 康 飲 食 的 方 式 改 善 這 些 人 的 體 質,

User’s Manual

51 C 51 isp 10 C PCB C C C C KEIL

Microsoft PowerPoint - CH 04 Techniques of Circuit Analysis

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

untitled

Outline Speech Signals Processing Dual-Tone Multifrequency Signal Detection 云南大学滇池学院课程 : 数字信号处理 Applications of Digital Signal Processing 2

場效電晶體簡介.doc

Contents 1 深 圳 大 学 经 济 学 院 学 生 代 表 大 会 章 程 2 2 优 秀 毕 业 生 评 选 细 则 7 3 议 事 规 则 8 i

CDWA Mapping. 22 Dublin Core Mapping

52C

Edge-Triggered Rising Edge-Triggered ( Falling Edge-Triggered ( Unit 11 Latches and Flip-Flops 3 Timing for D Flip-Flop (Falling-Edge Trigger) Unit 11

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

多層次傳銷與獎金系統

<4D F736F F F696E74202D20C8EDBCFEBCDCB9B9CAA6D1D0D0DEBDB2D7F92E707074>

Guide to Install SATA Hard Disks

穨文件1

<4D F736F F D20CEDECEFDD0C5BDDDB5E7C6F8B9C9B7DDD3D0CFDEB9ABCBBECAD7B4CEB9ABBFAAB7A2D0D0B9C9C6B1D5D0B9C9CBB5C3F7CAE9A3A8C9EAB1A8B8E C4EA36D4C238C8D5B1A8CBCDA3A92E646F63>

c_cpp

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

PowerPoint 簡報

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Microsoft PowerPoint - Lecture7II.ppt

软件测试(TA07)第一学期考试

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

PowerPoint Presentation

SuperMap 系列产品介绍

HCD0174_2008

untitled

HC50246_2009

Microsoft Word - HC20138_2010.doc

穨control.PDF

Bus Hound 5

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E

Microsoft Word - template.doc

HC20131_2010

T stg -40 to 125 C V cc 3.8V V dc RH 0 to 100 %RH T a -40 to +125 C -0.3 to 3.6V V -0.3 to VDD+0.3 V -10 to +10 ma = 25 = 3V) VDD

Turing Machine [1] n n n findmin (a 1, a 2,, a n ) 1. result a 1 2. index 2 3. result min (result, aindex) 4. index index go to step 3 till (in


01CP-WX3030WNetc_CO_ENG.indd

Logitech Wireless Combo MK45 English

四川省普通高等学校

/ / (FC 3)...

untitled

Microsoft Word - (web)_F.1_Notes_&_Application_Form(Chi)(non-SPCCPS)_16-17.doc

EK-STM32F

國立中山大學學位論文典藏.PDF

<4D F736F F D D3620B3AFB24DA8712DB747AFE0AC46A9B2BB50A4BDB0C8ADDBB27AA4A7B1B4B0512E646F63>

東莞工商總會劉百樂中學

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

9 什 么 是 竞 争 与 冒 险 现 象? 怎 样 判 断? 如 何 消 除?( 汉 王 笔 试 ) 在 组 合 逻 辑 中, 由 于 门 的 输 入 信 号 通 路 中 经 过 了 不 同 的 延 时, 导 致 到 达 该 门 的 时 间 不 一 致 叫 竞 争 产 生 毛 刺 叫 冒 险 如

ap15_chinese_interpersoanal_writing_ _response

Microsoft Word - A doc

南華大學數位論文

國家圖書館典藏電子全文

VB程序设计教程

從詩歌的鑒賞談生命價值的建構

Microsoft PowerPoint - chap5.ppt

s3ao.book

第3章.doc

3.1 num = 3 ch = 'C' 2

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

Microsoft Word - CPE考生使用手冊 docx

IP TCP/IP PC OS µclinux MPEG4 Blackfin DSP MPEG4 IP UDP Winsock I/O DirectShow Filter DirectShow MPEG4 µclinux TCP/IP IP COM, DirectShow I

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

Microsoft PowerPoint - OPVB1基本VB.ppt

ROP_bamboofox.key

Chn 116 Neh.d.01.nis

Transcription:

Chapter II 軟硬之間 電腦的程式與硬體 1

資料的二進位表示法 資訊在電腦外部及內部表示法上的不同 2

資料的二進位表示法 二進位與十進位轉換表 3

資料的二進位表示法 1035 0000010000001011-1035 直接符號 1000010000001011 1 s 補數 1111101111110100 2 s 補數 1111101111110101 負整數表示法 4

資料的二進位表示法 浮點數表示法 5

資料的二進位表示法 字元 ( 文字 ) 對應到二進位數編碼 ASCII code ( 美國國家資訊交換標準碼 )set 8 bits per character; 256 character codes UNICODE code ( 萬國碼 )set 16 bits per character; 65,536 character codes 字串是由字元以某種編碼方式所組成的 6

Keyboard: C ASCII Code: 67 Binary: 01000011 ASCII 碼轉換表 7

資料的二進位表示法 http://www.unicode.org/ http://www.unicode.org/standard/translations/t-chinese.html 萬國碼轉換表 ( 部份 ) 8

資料的二進位表示法 Sampling the Original Signal Recreating the Signal from the Sampled Values Digitization of an Analog Signal 00000000 00000011 00000111 00000111 00000101 00000000 10000011 10000110 10000110 M 9

資料的二進位表示法 (a) 一個簡單的圖形,(b) 及此圖形的二進位數位化表示法 10

由下而上的硬體設計 電晶體 晶片及電路板間的關係 11

由下而上的硬體設計 x NOT 閘 x Gate 閘極 Drain 汲極 x y AND 閘 x y Source 源極 x y OR 閘 x + y 電晶體作為開關的簡化模型 基本邏輯閘 12

由下而上的硬體設計 x NOT 閘 x NOT 邏輯閘的硬體實現 :(a) (b) 開關動作,(c) CMOS 反相閘 13

由下而上的硬體設計 (a) 二輸入 CMOS NAND 閘,(b) 二輸入 CMOS NOR 閘 14

由下而上的硬體設計 積項之和 (SOP; sum-of-products) 方法 步驟一 建立真值表 步驟二 使用 AND 和 NOT 建立積項 步驟三 將各積項以 OR 閘組合起來 步驟四 建構最終電路 15

由下而上的硬體設計 1 位元比較器之真值表 電路 x 0 y 0 Output 1 x y 0 1 1 1 0 1 0 0 1 x y ( x y) + ( x y) 16

由下而上的硬體設計 1 位元加法器 The 1-ADD Circuit and Truth Table 17

由下而上的硬體設計 N 位元加法器 + s N a b s N 1 N 1 N 1 a b s N 2 N 2 N 2 L L L a b s 1 1 1 a b s 0 0 0 18

電腦硬體架構 馮紐曼 (Von Neumann) 架構之主要子系統 : Memory ( 記憶體 ) Input/Output ( 輸入 / 輸出 ) Arithmetic/Logic unit ( 算術 / 邏輯單元 ) Control unit ( 控制單元 ) 儲存程式概念 指令的循序執行 19

電腦硬體架構 馮紐曼架構之主要子系統 20

電腦硬體架構 RAM (Random Access Memory 隨機存取記憶體 ) Memory made of addressable cells Current standard cell size is 8 bits All memory cells accessed in equal time Memory address Unsigned binary number N long Address space is then 2 N cells 21

電腦硬體架構 記憶體位址暫存器 記憶體位址解碼器 記憶體資料暫存器 隨機存取記憶體的電路架構 22

電腦硬體架構 Fetch operation ( 讀取資料 ) The address of the desired memory cell is moved into the MAR Fetch/store controller signals a fetch, accessing the memory cell The value at the MAR s location flows into the MDR 23

電腦硬體架構 Store operation ( 儲存資料 ) The address of the cell where the value should go is placed in the MAR The new value is placed in the MDR Fetch/store controller signals a store, copying the MDR s value into the desired cell 24

Figure 5.7 Overall RAM Organization 25

電腦硬體架構 輸入 / 輸出單元 : 內存資料與電腦外部的溝通介面 Human interfaces: monitor, keyboard, mouse Archival storage: not dependent on constant power External devices vary tremendously from each other 26

電腦硬體架構 Volatile storage ( 揮發性儲存 ) Information disappears when the power is turned off Example: RAM Nonvolatile storage ( 非揮發性儲存 ) Information does not disappear when the power is turned off Example: mass storage devices such as disks and tapes 27

電腦硬體架構 算術 / 邏輯單元 1. 算術運算 2. 比較 ( 大小 相等 ) 3. 布林邏輯運算 28

電腦硬體架構 控制單元 Task 自記憶體讀取下一個指令 解碼以決定要執行什麼 執行 : 送訊號 資料到 ALU I/O 等 29

機器語言 Can be decoded and executed by control unit Parts of instructions Operation code (op code) Unique unsigned-integer code assigned to each machine language operation Address field(s) Memory addresses of the values on which operation will work 30

機器語言 Figure 5.14 Typical Machine Language Instruction Format 00001001 0000000001100011 0000000001100100 op code address 1 address 2 ADD X, Y 31

Machine Language: 0000 001000001 0011 001000010 0001 001000000 0111 001000000 001000001 1001 000101100 1110 001000001 001000010 1000 000101101 1110 001000000 001000010 32

機器語言 Operations of machine language Data transfer Move values to and from memory and registers Arithmetic/logic Perform ALU operations that produce numeric values 33

機器語言 Operations of machine language (continued) Compares Set bits of compare register to hold result Branches Jump to a new memory address to continue processing 34

組合語言 機器語言與組合語言對應表 機器語言運算碼 0000 0001 0010 0011 0100 0101 0110 M 1111 組合語言指令 LOAD X STORE X CLEAR X ADD X SUB X INCR X JUMP X 略 HALT 意義 CON(X) R R CON(X) 0 CON(X) R + CON(X) R R CON(X) R CON(X) + 1 CON(X) 下個指令由位址 X 取得 --- 停止程式執行 35

組合語言.BEGIN LOAD X STORE Y INCR Y M X:.DATA 3 Y:.DATA 1.END 指令段 資料段 36

高階語言 37

高階語言 FORTRAN VISUAL BASIC Do 6, LOOP = 1, 10 READ *, A, B OUT = (A - B) / 4.0 PRINT *, A, B, OUT 6 CONTINUE END Dim j, out out = 0 For j = 1 To 5 out = out + 2 * j Next j 38

高階語言 C 語言 #include <stdio.h> void main(void) { int x, sum, i; /* 宣告 x, sum, i 為整數變數 */ for (sum = 0, i = 1; i <= 5; i = i + 1) { printf( Enter x: ); /* 在螢幕上顯示字串 */ scanf( %d, &x); /* 由鍵盤讀入數值到 x*/ sum = sum + x;} printf( sum = %d\n, sum); /* 列印 sum*/ } 39

高階語言 JAVA public class ArrayExample{ /** Provide an example of declaring an Array using different methodologies **/ public static void declareexample(){ System.out.println(); System.out.println( +===============+ ); System.out.println( ); System.out.println( Array Declare ); System.out.println( );; System.out.println( +===============+ ); System.out.println(); // Example 1 // First declare a reference, then construct it int[ ] ExampleArray1; ExampleArray1 = new int[24]; M 40

高階語言 高階程式語言的分類 種類 命令式 (Imperative) 物件導向 (Object- Oriented) 函數式 (Functional) 邏輯式 (Logical) ADA BASIC C COBOL FORTRAN PASCAL ASP.NET C++ JAVA LISP PROLOG 程式語言 41

作業系統 (1) 中央處理器的管理 (2) 記憶體的管理 (3) 檔案的管理 (4) 週邊設備的管理 (5) 程序的管理 42

附註 本投影片部分內容取材自 : G. M. Schneider and J. L. Gersting, Invitation to Computer Science, 3rd Edition: C++ Version, Thomson Course Technology, 2004. 趙坤茂, 張雅惠教授, 黃寶萱, 計算機概論, 全華科技圖書公司出版 (2008) 43