Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter II 軟硬之間 — 電腦的程式與硬體 范志鵬 Chih-Peng Fan. 2 電腦基礎元件 真空管 電晶體 積體電路 超大型積 體電路.

Similar presentations


Presentation on theme: "1 Chapter II 軟硬之間 — 電腦的程式與硬體 范志鵬 Chih-Peng Fan. 2 電腦基礎元件 真空管 電晶體 積體電路 超大型積 體電路."— Presentation transcript:

1 1 Chapter II 軟硬之間 — 電腦的程式與硬體 范志鵬 Chih-Peng Fan

2 2 電腦基礎元件 真空管 電晶體 積體電路 超大型積 體電路

3 范志鵬 Chih-Peng Fan 3 三大電腦展 德國漢諾威電腦展 ( CeBIT ;每年三月 舉行) 台北國際電腦展 ( COMPUTEX TAIPEI ;每年六月舉 行) 美國拉斯維加斯秋季 電腦展( COMDEX FALL ;每年九月舉 行)

4 范志鵬 Chih-Peng Fan 4 各類型電腦 桌上型電腦 (Desktop) 筆記型電腦 (Laptop; Notebook) 平板電腦 (Tablet PC)

5 范志鵬 Chih-Peng Fan 5 3C 整合 Computer (電腦) Communication (通訊) Consumer electronics (消費性電子產品)

6 范志鵬 Chih-Peng Fan 6 中央處理器

7 范志鵬 Chih-Peng Fan 7 Intel Pentium 4

8 范志鵬 Chih-Peng Fan 8 邏輯運算

9 范志鵬 Chih-Peng Fan 9 微處理器發展簡史 (I)

10 范志鵬 Chih-Peng Fan 10 微處理器發展簡史 (II) 64 位元雙核心、四核心、多核心 Intel® Core™ 2 Duo, Quad 處理器 http://www.intel.com/

11 范志鵬 Chih-Peng Fan 11 主記憶體

12 范志鵬 Chih-Peng Fan 12 位址和值

13 范志鵬 Chih-Peng Fan 13 主記憶體類別 RAM ( Random Access Memory ;隨機存取 記憶體) –SRAM ( Static RAM ;靜態隨機存取記憶體) –DRAM ( Dynamic RAM ;動態隨機存取記憶體) ROM ( Read-Only Memory ;唯讀記憶體) –PROM ( Programmable ROM ;可程式的唯讀記 憶體) –EPROM ( Erasable Programmable ROM ;可擦拭 及程式的唯讀記憶體) –EEPROM ( Electronically Erasable Programmable ROM ;可電子擦拭及程式的唯讀記憶體)

14 范志鵬 Chih-Peng Fan 14 執行程式

15 范志鵬 Chih-Peng Fan 15 生產線技術 (pipelining)

16 范志鵬 Chih-Peng Fan 16 匯流排及介面 系統匯流排 – 負責 CPU 與記憶體間 的資料傳送 擴充匯流排 – 保留一些連接給使用 者彈性使用

17 范志鵬 Chih-Peng Fan 17 ISA 、 PCI 、 AGP 及 PCI Express 在 80 年代,最當紅的高速匯流 排是 ISA ( Industry Standard Architecture ),它的傳輸速率 每秒只有 8.33MB 90 年代, PCI ( Peripheral Component Interconnect )的每 秒 133MB 繪圖卡等須高速運作的多採用 AGP ,它每秒可傳輸 2.1GB 現在走紅的是 PCI Express ,它 也稱為 3GIO 。 PCI Express 的傳 輸速率為每秒 2.5GB ,還有潛力 再增加好幾倍。 (PCI-E 16X 8GB)

18 范志鵬 Chih-Peng Fan 18 USB USB ( Universal Serial Bus ;通用序列匯流排) – 是 USB Implementers Forum 所開發的連線規格 – 針對電腦的外接週邊設備(鍵盤、滑鼠、遊戲控制 器、攝影機、儲存裝置、掃描器和其他周邊)所設 計,讓使用者安裝特定裝置時,能夠省去開啟電腦 機箱及重開機的麻煩,隨插即用 – 為一般使用者提供了操作簡便、擴充性和快速等優 點 –USB 2.0 傳輸速度最高每秒可達 480Mb –USB 能在同一埠上支援多台設備,技術上而言,安 裝 USB Hub (集線器)這類的輔助裝置後,一個 USB 埠能夠支援最多 127 台設備同時連線。

19 范志鵬 Chih-Peng Fan 19 輸出入周邊設備

20 范志鵬 Chih-Peng Fan 20 鍵盤 輔助我們將訊息輸入 電腦的重要輸入設備, 它的字符位置和打字 機類似,它與主機板 連接的界面規格主要 為 PS2 及 USB

21 范志鵬 Chih-Peng Fan 21 滑鼠 輔助我們將訊息輸入 電腦的重要輸入設備, 它與主機板連接的界 面規格主要為 PS2 、 USB 、無線連接 種類非常的多:二鍵、 三鍵、二鍵加小滾輪 (可方便瀏覽超過顯 示範圍的頁面)、軌 跡球式的滑鼠 、光 學滑鼠

22 范志鵬 Chih-Peng Fan 22 掃描器 掃描的文件以數位影 像格式儲存 儲存的檔案格式有 TIFF 、 BMP 、 GIF 與 PCX 等格式 掃描器的解析度以掃 描時每英吋的取樣點 數( dpi ; dot per inch ) 表示

23 范志鵬 Chih-Peng Fan 23 螢幕 又稱顯示器 ( monitor ),是電腦 最主要的輸出設備 傳統的螢幕為陰極射 線映像管顯示器 ( CRT ; Cathode Ray Tube ),既粗大又笨 重,已快速地被既輕 且薄的液晶螢幕 ( LCD ; Liquid Crystal Display )所 取代

24 范志鵬 Chih-Peng Fan 24 印表機 重要的輸出週邊設備, 它的解析度以印出時 每英吋的列印點數 ( dpi ; dot per inch ) 表示

25 范志鵬 Chih-Peng Fan 25 儲存裝置 硬碟 磁帶 軟式磁碟片 Zip MO 光碟片 記憶卡 隨身碟 可攜式硬碟

26 范志鵬 Chih-Peng Fan 26 硬碟 硬碟( Hard Disk )是電腦儲存資料最重 要的地方,它的內部有圓形碟片及讀寫 頭 程式及資料平時通常放在硬碟,執行時 才從硬碟載入主記憶體,因此它是極為 重要的儲存設備,平時最好就做備份

27 范志鵬 Chih-Peng Fan 27 磁帶、軟式磁碟片、 Zip 及 MO 磁帶通常用來做備份,主要是因為磁帶通常比 硬碟的容量要大許多。現在的磁帶備份的資料 動輒以 TB ( Tera Byte ;兆位元組)計 備份的另一種選擇是使用 RAID ( Redundant Arrays of Inexpensive Disks )磁碟陣列 軟式磁碟片曾是九十年代最主要的可攜式儲存 媒介 Zip ( IOMEGA 於 1995 年推出)及 MO ( Magnet Optical Disk ; SONY 於 1988 年推出)是九十年 代頗受歡迎的大量資料之可攜式儲存媒介

28 范志鵬 Chih-Peng Fan 28 光碟片 新力( Sony )和飛利浦( Philips )在八十年代 初期推出了 CD-ROM CD 光碟片的儲存容量 為 650MB DVD ( Digital Versatile Disk )單面單層可儲存 4.7GB ,最高可儲存雙面雙層,達 17GB 之多 CD 系列( CD-ROM 、 CR-R 、 CR-RW 或 VCD ) 的存取速度時,單倍速為每秒 150KB DVD 系列( DVD-ROM 、 DVD-R 、 DVD-RW 或 DVD-Video )的存取速度時,單倍速為每秒約 1350KB

29 范志鵬 Chih-Peng Fan 29 記憶卡 數位相機、 PDA 、 … 等都利用這種輕薄的 記憶裝置儲存資料, 它的種類繁多 –CF ( Compact Flash ) –SM ( Smart Media ) –SD ( Secure Digital ) –MMC ( Multi Media Card ) –MS ( Memory Stick ) –xD –micro SD

30 范志鵬 Chih-Peng Fan 30 微型硬碟 (MD) 縮小版的硬碟 一般家用電腦使用的是 3.5 吋硬碟,筆記 型通常用比較小的 2.5 吋硬碟,而 MD 小 到連 1 吋都不到 容量通常較記憶卡高一個等級

31 范志鵬 Chih-Peng Fan 31 多合一的讀卡機 可同時讀取多種不同 的記憶卡及 MD

32 范志鵬 Chih-Peng Fan 32 隨身碟 隨身碟( Flash Disk ) 又稱大拇哥,意即和 大拇指大小差不多 透過 USB 埠可以連到 電腦上,進行存取動 作,相當方便 容量已可達 GB 造型花樣百出

33 范志鵬 Chih-Peng Fan 33 可攜式硬碟 USB 外接硬碟,它是一 種體積小且重量輕的攜 帶式儲存裝置 大約只有手掌般的大小, 而且具有 USB 連接線即 插即用的功能,可輕易 地與個人電腦相連接, 安裝極為便捷 雖然較隨身碟大一些, 但容量可達上百 GB ,是 須攜帶大量資料人士的 最愛

34 范志鵬 Chih-Peng Fan 34 資料的二進位表示法 資訊在電腦外部及內部表示法上的不同

35 范志鵬 Chih-Peng Fan 35 資料的二進位表示法 二進位與十進位轉換表

36 范志鵬 Chih-Peng Fan 36 資料的二進位表示法 10350000010000001011 -1035 1000010000001011 1 ’ s 補數 1111101111110100 2 ’ s 補數 1111101111110101 負整數表示法 直接符號

37 范志鵬 Chih-Peng Fan 37 資料的二進位表示法 浮點數表示法

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

39 范志鵬 Chih-Peng Fan 39 Keyboard: C ASCII Code: 67 Binary: 01000011 ASCII 碼轉換表

40 范志鵬 Chih-Peng Fan 40 資料的二進位表示法 http://www.unicode.org/ http://www.unicode.org/standard/translations/t-chinese.html 萬國碼轉換表 ( 部份 )

41 范志鵬 Chih-Peng Fan 41 資料的二進位表示法 Digitization of an Analog Signal Sampling the Original Signal Recreating the Signal from the Sampled Values 000000 00 0000001 1 00000111 00000111 0000010 1 000000 00 10000011 10000110 10000110

42 范志鵬 Chih-Peng Fan 42 資料的二進位表示法 (a) 一個簡單的圖形, (b) 及此圖形的二進位數位化表示法

43 范志鵬 Chih-Peng Fan 43 由下而上的硬體設計 電晶體、晶片及電路板間的關係

44 范志鵬 Chih-Peng Fan 44 由下而上的硬體設計 基本邏輯閘 NOT 閘 AND 閘 OR 閘 電晶體作為開關的簡化模型 Gate 閘極 Drain 汲極 Source 源極

45 范志鵬 Chih-Peng Fan 45 由下而上的硬體設計 NOT 閘 NOT 邏輯閘的硬體實現: (a) 、 (b) 開關動作, (c) CMOS 反相閘

46 范志鵬 Chih-Peng Fan 46 由下而上的硬體設計 (a) 二輸入 CMOS NAND 閘, (b) 二輸入 CMOS NOR 閘

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

48 范志鵬 Chih-Peng Fan 48 由下而上的硬體設計 1 位元比較器之真值表、電路 xyOutput 001 010 100 111

49 范志鵬 Chih-Peng Fan 49 由下而上的硬體設計 The 1-ADD Circuit and Truth Table 1 位元加法器

50 范志鵬 Chih-Peng Fan 50 由下而上的硬體設計 N 位元加法器

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

52 范志鵬 Chih-Peng Fan 52 電腦硬體架構 馮紐曼架構之主要子系統

53 范志鵬 Chih-Peng Fan 53 電腦硬體架構 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

54 范志鵬 Chih-Peng Fan 54 電腦硬體架構 隨機存取記憶體的電路架構 記憶體位址暫存器 記憶體位址解碼器 記憶體資料暫存器

55 范志鵬 Chih-Peng Fan 55 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 電腦硬體架構

56 范志鵬 Chih-Peng Fan 56 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 電腦硬體架構

57 范志鵬 Chih-Peng Fan 57 Figure 5.7 Overall RAM Organization

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

59 范志鵬 Chih-Peng Fan 59 電腦硬體架構 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

60 范志鵬 Chih-Peng Fan 60 電腦硬體架構 算術 / 邏輯單元 1. 算術運算 2. 比較 ( 大小、相等 ) 3. 布林邏輯運算

61 范志鵬 Chih-Peng Fan 61 電腦硬體架構 控制單元 Task  自記憶體讀取下一個指令  解碼以決定要執行什麼  執行 :送訊號、資料到 ALU 、 I/O 等

62 范志鵬 Chih-Peng Fan 62 機器語言 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

63 范志鵬 Chih-Peng Fan 63 機器語言 Figure 5.14 Typical Machine Language Instruction Format 00001001 0000000001100011 0000000001100100 op code address 1 address 2 → ADD X, Y

64 范志鵬 Chih-Peng Fan 64 Machine Language: … 0000 001000001 0011 001000010 0001 001000000 0111 001000000 001000001 1001 000101100 1110 001000001 001000010 1000 000101101 1110 001000000 001000010

65 范志鵬 Chih-Peng Fan 65 機器語言 Operations of machine language  Data transfer Move values to and from memory and registers  Arithmetic/logic Perform ALU operations that produce numeric values

66 范志鵬 Chih-Peng Fan 66 機器語言 Operations of machine language (continued)  Compares Set bits of compare register to hold result  Branches Jump to a new memory address to continue processing

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

68 范志鵬 Chih-Peng Fan 68 組合語言.BEGIN LOAD X STORE Y INCR Y X:.DATA3 Y:.DATA1.END 指令段 資料段

69 范志鵬 Chih-Peng Fan 69 高階語言

70 范志鵬 Chih-Peng Fan 70 高階語言 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

71 范志鵬 Chih-Peng Fan 71 高階語言 C 語言 #include 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*/ }

72 范志鵬 Chih-Peng Fan 72 高階語言 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];

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

74 范志鵬 Chih-Peng Fan 74 作業系統 (1) 中央處理器的管理 (2) 記憶體的管理 (3) 檔案的管理 (4) 週邊設備的管理 (5) 程序的管理

75 范志鵬 Chih-Peng Fan 75 附註 本投影片部分內容取材自: –G. M. Schneider and J. L. Gersting, Invitation to Computer Science, 3rd Edition: C++ Version, Thomson Course Technology, 2004. – 趙坤茂, 張雅惠教授, 黃寶萱, 計算機概論, 全華科 技圖書公司出版 (2008) 。 –Web site: http://www.csie.ntu.edu.tw/~kmchao/bcc09spr09spr 趙坤茂 ( 台大資訊工程系暨研究所 )


Download ppt "1 Chapter II 軟硬之間 — 電腦的程式與硬體 范志鵬 Chih-Peng Fan. 2 電腦基礎元件 真空管 電晶體 積體電路 超大型積 體電路."

Similar presentations


Ads by Google