44
111/07/04 Jackie Kan - 2007 ([email protected]/[email protected]) http://linton.1d24h.com/~jackiekan/ 1 111/07/04 NTU DSD (Digital System Design) 2007 1 Digital System Design

2015/12/1 Jackie Kan - 2007 ([email protected]/[email protected]) jackiekan/ 12015/12/1NTU DSD (Digital System

Embed Size (px)

Citation preview

Page 1: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 1112/04/21 NTU DSD (Digital System Design)

20071

Digital System Design

Page 2: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 2112/04/21 NTU DSD (Digital System Design)

20072

Number Systems and Conversion

不同之進位系統與表示法

Page 3: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 3

Egyptian Numbers

What is these means?

3244

21237

12425 Birds

Page 4: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 4

Example

Page 5: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 5

Quiz

Quiz 1.1

Quiz 1.2

Page 6: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 6

Egypt SymbolReference: http://hieroglyphs.net/000501/html/000-042.html

Page 7: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 7

古巴比倫楔形文字與十進位數字對應表

Page 8: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 8

YBC 7289 (YBC 7289 號石板 )

因為古巴比倫人使用 60 進位制

2...4142129.160

10

60

51

60

241

321

230...4263888.4260

35

60

2542

21

..42.426387.30...4142129.1

這塊泥板上的刻圖表示「正方形的邊長乘以根號 2 就等於對角線的長度。」

Page 9: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 9

巴比倫數字

Page 10: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 10

Quiz

請以巴比倫的記數符號完成下列 Quiz 25 234 618 2007 36010

Page 11: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 11112/04/21 NTU DSD (Digital System Design)

200711

Number Systems and Conversion in Digital World

十進位系統

Page 12: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 12

Decimal Number Systems ( 十進位系統 )

What we are use to Based off of 10 numbers (0-9) Called base 10

Ones place: 100 = 1 Tens place: 101 = 10 Hundreds place: 102 = 100 Thousands place: 103 = 1000

Calculation simply becomes the addition of numbers in whichever place times the base to the position

Example 3 = 3 * 100 = 310 30 = 3*101 + 0*100 = 3010 300 = 3*102 + 0*101 + 0*100 = 30010

Page 13: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 13

Binary Number System

Also called the “Base 2 system” The binary number system is used to model the series of

electrical signals computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on state What computers use Based off of 2 numbers (0-1) Called base 2

first position: 20 = 1 second position: 21 = 2 third position: 22 = 4 fourth position: 23 = 8

Page 14: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 14

Binary Addition

4 Possible Binary Addition Combinations:

(1) 0 (2) 0+0 +100 01

(3) 1 (4) 1+0 +101 10

Note that leadingzeroes are

frequently dropped.

Page 15: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 15

Division Algorithm (Decimal to Binary Conversion)

Convert 67 to its binary equivalent: 6710 = x2

Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next

row Step 3: 16 / 2 = 8 R 0 Repeat again Step 4: 8 / 2 = 4 R 0 Repeat again Step 5: 4 / 2 = 2 R 0 Repeat again Step 6: 2 / 2 = 1 R 0 Repeat again Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0

1000011

least significant digitalmost significant digital

Page 16: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 16

Multiplication Algorithm (Binary to Decimal Conversion)

Convert (10101101)2 to its decimal equivalent:

x x x x x x x x

128 + 0 + 32 + 0 + 8 + 4 + 0 + 1

Products

17310

Binary 1 0 1 0 1 1 0 1

27 26 25 24 23 22 21 20Positional Values

Page 17: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 17

Analog Signal / Digital Signal

Analog Signal – Both time and amplitude are continuous. Air temperature vs. time

Digital Signal – Both time and amplitude are discrete. Sampled-value representation

Page 18: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 18

Digital Signal / Analog Signal

Digital data can be processed and transmitted more efficiently and reliably than analog data.

Digital signal has a great advantage when storage is necessary. Noise does not affect digital data nearly as much as it does

analog signals.

Page 19: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 19

Digital System / Analog System

Analog System ( 類比系統 ) Both inputs and outputs are analog signals. Analog components or devices.

Diodes 、 Transistors 、 Resistors 、 Capacitors 、 ...

Page 20: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 20

Digital System / Analog System

Digital System ( 數位系統 ) Both inputs and outputs are digital signals. Digital components or devices.

Logic gates 、 Flip-Flops...

Page 21: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 21

Digital System / Analog System

Hybrid system ( 混合系統 ) Both Analog and Digital system are combined together

Page 22: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 22

Binary Digitals and Logic Levels

Binary Digit (Bit 位元 ) 0 or 1

Logic Levels – The voltages used to represent 0 and 1 Positive Logic ( 正邏輯 )

Higher Voltage = 1 Lower Voltage = 0

Negative Logic ( 負邏輯 ) Higher Voltage = 0 Lower Voltage = 1

General range of Logic Levels VH(max) = The maximum High Voltage Value

VH(min) = The minimum High Voltage Value

VL(max) = The maximum Low Voltage Value

VL(min) = The minimum Low Voltage Value

Page 23: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 23

Octal Number System

Also known as the Base 8 System Uses digits 0 - 7 Readily converts to binary ( 立即轉換至二進位 ) Groups of three (binary) digits can be used to represent each

octal digit Also uses multiplication and division algorithms for conversion to

and from base 10

Convert 42710 to its octal equivalent:

427 / 8 = 53 R3 Divide by 8; R is LSD 53 / 8 = 6 R5 Divide Q by 8; R is next digit 6 / 8 = 0 R6 Repeat until Q = 0

6538

Page 24: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 24

Octal to Decimal Conversion / Octal to Binary Conversion

Convert 6538 to its decimal equivalent:

Each octal number converts to 3 binary digits To convert 6538 to binary, just substitute code:

42710

82 81 80Positional Values

6 5 3Octal Digitsxxx

384 + 40 + 3

Products

6 5 3

110 101 011

Page 25: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 25

Hexadecimal Number System

Base 16 system Uses digits 0-9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit

Decimal to Hexadecimal Conversion Convert 83010 to its hexadecimal equivalent:

830 / 16 = 51 R 14 51 / 16 = 3 R 3 3 / 16 = 0 R 3

33E16

Page 26: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 26

Hexadecimal to Decimal Conversion

Convert 3B4F16 to its decimal equivalent

Binary to Hexadecimal Conversion The easiest method for converting binary to hexadecimal is to

use a substitution code ( 替換碼 ) Each hex number converts to 4 binary digits

1518310

163 162 161 160Positional Values

Hex Digits 3 B 4 Fxxx

12288 +2816 + 64 +15Products

x

Page 27: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 27

Substitution Code

Convert 0101011010101110011010102 to hex using the 4-bit substitution code

Substitution code can also be used to convert binary to octal by using 3-bit groupings

Convert 0101011010101110011010102 to hex using the 4-bit substitution code

5 6 A E 6 A 56AE6A1

6

0101 0110 1010 1110 0110 1010

2 5 5 2 7 1 5 2

255271528

010 101 101 010 111 001 101 010

Page 28: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 28112/04/21 NTU DSD (Digital System Design)

200728

Binary Data

Page 29: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 29

Binary Codes

One Binary Digit (one bit) can take on values 0, 1.We can represent TWO values

0 = hot, 1 = cold 1 = True, 0 = False 1 = on, 0 = off

Two Binary digits (two bits) can take on values of 00, 01, 10, 11.We can represent FOUR values

00 = hot, 01 = warm, 10 = cool, 11 = cold Three Binary digits (three bits) can take on values of 000, 001,

010, 011, 100, 101, 110, 111.We can represent 8 values

000 = Black, 001 = Red, 010 = Pink, 011 = Yellow,100 = Brown, 101 = Blue, 110 = Green , 111 = White

N bits (or N binary Digits) can represent 2N different values. for example

4 bits can represent 24 or 16 different values N bits can take on unsigned decimal values from 0 to 2N-1. Codes usually given in tabular form.

Page 30: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 30

Binary Data

The computer screen on your Win 2000 PC can be configured for different resolutions. One resolution is 600 x 800 x 8, which means that you have 600 dots vertically x 800 dots horizontally, with each dot using 8 bits to take on 256 different colors. (actually, a dot is called a pixel).

Need 8 bits to represent 256 colors ( 28 = 256). Total number of bits needed to represent the screen is then:

600 x 800 x 8 = 3,840,000 bits (or just under 4 Mbits) Your video card must have at least this much memory on it.

1 Mbits = 1024 x 1024 = 210 x 210 = 220

1 Kbits = 1024 = 210

Page 31: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 31

Codes for Characters (1/2)

Also need to represent Characters as digital data. The ASCII code (American Standard Code for Information Interchange) is a 7-bit code for Character data.

Typically 8 bits are actually used with the 8th bit being zero or used for error detection (parity checking).

8 bits = 1 Byte. ‘A’ = 010000012 = 4116 (0x41)

‘&’ = 001001102 = 2616 (0x26)

NULSOH STX EOTETX ENQACKBEL BS LFHT VT FF LF VT FF

DLE DC1 DC2 DC4DC3 NAKSYN ETBCAN SUBEM ESC FS GS RS US

SP ! “ $# % & ‘ ( *) + , - . /

0 1 2 43 5 6 7 8 :9 ; < = > ?

@ A B DC E F G H JI K L M N O

P Q R TS U V W X ZY [ \ ] ^ _

` a b dc e f g h ji k l m n o

p q r ts u v w x zy { | } ~ DEL

000

001

010

011

100

101

110

111

000000010010 01000011 0101011001111000 10101001 10111100110111101111

Page 32: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 32

Codes for Decimal Digits

There are even codes for representing decimal digits. These codes use 4-bits for EACH decimal digits; it is NOT the same as converting from decimal to binary.

012

BCD CODE0000000100100011010001010110

3456

011171000810019

In BCD code, each decimal digit simply represented by its binary equivalent. 9610 = 1001 01102 = 96BCD (BCD code)

Advantage: easy to convertDisadvantage: takes more bits to store a number:

25510 = 1111 11112 = FF16 (binary code) 25510 = 0010 0101 01012-BCD = 255BCD (BCD code)

Takes only 8 bits in binary, takes 12 bits in BCD.

Page 33: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 33

Gray Code for Decimal Digits

A Gray code changes by only 1 bit for adjacent values. This is also called a ‘thumbwheel’ code because a thumbwheel for choosing a decimal digit can only change to an adjacent value (4 to 5 to 6, etc) with each click of the thumbwheel. This allows the binary output of the thumbwheel to only change one bit at a time; this can help reduce circuit complexity and also reduce signal noise.

012

Gray CODE0000000100110010011011101010

3456

101171001810009

Page 34: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 34

The ISO 8859 Alphabet

ISO-8859-1 (Latin1) West European languages French 法語 (fr), Spanish 西班牙語 (es), Catalan 嘉泰羅尼亞語 (ca),

Basque 巴斯克語 (eu), Portuguese 葡萄牙語 (pt), Italian 義大利語 (it), Albanian 阿爾巴尼亞語 (sq), Rhaeto-Romanic 瑞士南部、義大利北部的里托羅曼斯方言 (rm), Dutch 荷蘭語 (nl), German 德語 (de), Danish丹麥語 (da), Swedish 瑞典語 (sv), Norwegian 挪威語 (no), Finnish 芬蘭語 (fi), Faroese 法羅語 (fo), Icelandic 冰島語 (is), Irish 愛爾蘭語 (ga), Scottish 蘇格蘭語 (gd), and English 英語 (en), Afrikaans 南非荷蘭語 (af), Swahili 斯華西里語 (sw), thus in effect also the entire American continent, Australia and much of Africa.

Page 35: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 35

ISO-8859-1

Page 36: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 36

ISO-8859 Code Pages

ISO-8859-2 (Latin2) Central and Eastern Europe Czech 捷克語 (cs), Hungarian 匈牙利語 (hu), Polish 波蘭語 (pl),

Romanian 羅馬尼亞語 (ro), Croatian 克羅埃西亞語 (hr), Slovak 斯洛伐克語 (sk), Slovenian 斯洛維尼亞語 (sl)

ISO-8859-3 (Latin3) Esperanto 世界語 (eo) and Maltese 馬爾他語 (mt)

ISO-8859-4 (Latin4) Estonian 愛沙尼亞語 (et), the Baltic languages Latvian 波羅的海的拉脫

維亞語 (lv, Lettish) and Lithuanian 立陶宛語 (lt), Greenlandic 格陵蘭語 (kl) and Lappish 拉普語

ISO-8859-5 (Cyrillic 古代斯拉夫語 ) Bulgarian 保加利亞語 (bg), Byelorussian 白俄羅斯語 (be), Macedonian

馬其頓人語 (mk), Russian 俄語 (ru), Serbian 塞爾維亞人語 (sr)

Page 37: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 37

ISO-8859 Code Pages

ISO-8859-6 (Arabic) ISO-8859-7 (Greek) ISO-8859-8 (Hebrew) ISO-8859-9 (Latin5) ISO-8859-10 (Latin6) ISO-8859-11 (Thai) ISO-8859-12 (Reserved for ISCII Indian) ISO-8859-13 (Latin7) ISO-8859-14 (Latin8) ISO-8859-15 (Latin9)

http://czyborra.com/charsets/iso8859.html

Page 38: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 38

Chinese Code Pages ( 中文內碼 )

英文字符( character ) 「字母與標點符號」少於 128 種 ASCII 碼 (1 Byte) 。

中文字符( character ) 多達數萬字 2 Bytes code 「中文內碼系統」

BIG5 ( Big-5 :大五碼) 資策會在 1984 年制定的 Big-5 碼 一共約制訂一萬三千多個中文字內碼 五千多個常用字,七千多個次常用字, 499 個特殊符號 完整的 Big-5 碼: http://input.cpatch.org/code/big5.zip

CCCII 碼( Chinese Character Code for Information Interchange )

Page 39: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 39

Big-5 Data

BIG-5 double bytes coding First byte: 0xA1 ~ 0xF9

symbols: 0xA1 - 0xA3 ( 3 sectors) common hanzi ( 一般漢字 ): 0xA4 - 0xC6 (35 sectors) undefined: 0xC7 - 0xC8 ( 2 sectors) rare hanzi ( 稀有漢字 ): 0xC9 - 0xF9 (49 sectors) total defined: 3+35+49 (87 sectors)

Second byte: 0x40 ~ 0xFE part one: 0x40 - 0x7E (63 codes) undefined: 0x7F - 0xA0 (34 codes) part two: 0xA1 - 0xFE (94 codes) total defined: 63+94 (157 codes)

coding space 87 x 157 = 13659 codes

Page 40: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 40

Selected Big-5 Code Page Data (Page A1xx)http://www.microsoft.com/globaldev/reference/dbcs/950/950_A1.mspx

Page 41: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 41

Selected Big-5 Code Page Data (Page A4xx)http://www.microsoft.com/globaldev/reference/dbcs/950/950_A4.mspx

Page 42: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 42

UNICODE

UNICODE is a 16-bit code for representing alphanumeric data. With 16 bits, can represent 216 or 65536 different symbols

16 bits = 2 Bytes per character 0x0041 ~ 0x005A A-Z

0x0061 ~ 0x007A a-z Some other alphabet/symbol ranges

0x3400 ~ 0x3D2D Korean Hangul Symbols 0x3040 ~ 0x318F Hiranga, Katakana, Bopomofo, Hangul 0x4E00 ~ 0x9FFF Han (Chinese, Japenese, Korean)

UNICODE used by Web browsers, Java, most software these days

Page 43: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 43

UTF-8

UTF-8, 是 UNICODE 的一種變長度的編碼表達方式 U-00000000 – U-0000007F

0xxxxxxx U-00000080~U-000007FF

110xxxxx 10xxxxxx U-00000800~U-0000FFFF

1110xxxx 10xxxxxx 10xxxxxx U-00010000~U-001FFFFF

11110xxx 10xxxxxx 10xxxxxx 10xxxxxx U-00200000~U-03FFFFFF

111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx U-04000000~U-7FFFFFFF

1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx

Lager than ASCII: 由第一位元組的前幾位表示該 unicode 字元的長度 比如 110xxxxxx 前三位的二進位表示告訴我們這是個 2BYTE 的 UNICODE

字元; 1110xxxx 是個三位的 UNICODE 字元

http://www.unicode.org/versions/Unicode5.0.0/

Page 44: 2015/12/1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) jackiekan/ 12015/12/1NTU DSD (Digital System

112/04/21 Jackie Kan - 2007 ([email protected]/[email protected])http://linton.1d24h.com/~jackiekan/ 44

ISO-10646 (Current UTF-8)

0000 0000-0000 007F 0xxxxxxx

0000 0080-0000 07FF 110xxxxx 10xxxxxx

0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx