1 / 44

Digital System Design

Digital System Design. Number Systems and Conversion. 不同之進位系統與表示法. Egyptian Numbers. What is these means?. 3244. 21237. 12425 Birds. Example. Quiz. Quiz 1.1. Quiz 1.2. Egypt Symbol. Reference: http://hieroglyphs.net/000501/html/000-042.html. 古巴比倫楔形文字與十進位數字對應表.

kamal-wall
Télécharger la présentation

Digital System Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital System Design NTU DSD (Digital System Design) 2007

  2. Number Systems and Conversion 不同之進位系統與表示法 NTU DSD (Digital System Design) 2007

  3. Egyptian Numbers • What is these means? 3244 21237 12425 Birds Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  4. Example Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  5. Quiz Quiz 1.1 Quiz 1.2 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  6. Egypt Symbol Reference: http://hieroglyphs.net/000501/html/000-042.html Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  7. 古巴比倫楔形文字與十進位數字對應表 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  8. YBC 7289 (YBC 7289號石板) • 因為古巴比倫人使用60進位制 • 這塊泥板上的刻圖表示「正方形的邊長乘以根號2就等於對角線的長度。」 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  9. 巴比倫數字 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  10. Quiz • 請以巴比倫的記數符號完成下列Quiz • 25 • 234 • 618 • 2007 • 36010 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  11. Number Systems and Conversion in Digital World 十進位系統 NTU DSD (Digital System Design) 2007

  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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  14. Binary Addition 4 Possible Binary Addition Combinations: (1) 0 (2) 0 +0 +1 00 01 (3) 1 (4) 1 +0 +1 01 10 Note that leading zeroes are frequently dropped. Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 most significant digital least significant digital Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  16. 27 26 25 24 23 22 21 20 Positional Values 17310 Multiplication Algorithm (Binary to Decimal Conversion) • Convert (10101101)2 to its decimal equivalent: 1 0 1 0 1 1 0 1 Binary x x x x x x x x 128 + 0 + 32 + 0 + 8 + 4 + 0 + 1 Products Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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. Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 、 ... Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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... Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  21. Digital System / Analog System • Hybrid system (混合系統) • Both Analog and Digital system are combined together Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  24. 6 5 3 Octal Digits x x x 82 81 80 Positional Values 6 5 3 384 + 40 + 3 Products 110 101 011 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  25. 33E16 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  26. 3 B 4 F Hex Digits x x x x 163 162 161 160 Positional Values 12288 +2816 +64 +15 Products 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 56AE6A16 0101 0110 1010 1110 0110 1010 2 5 5 2 7 1 5 2 010 101 101 010 111 001 101 010 255271528 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  28. Binary Data NTU DSD (Digital System Design) 2007

  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 example4 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. Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  31. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 000 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF LF VT FF 001 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 010 SP ! “ # $ % & ‘ ( ) * + , - . / 011 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 100 @ A B C D E F G H I J K L M N O 101 P Q R S T U V W X Y Z [ \ ] ^ _ 110 ` a b c d e f g h i j k l m n o 111 p q r s t u v w x y z { | } ~ DEL 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) Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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. BCD CODE 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. 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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. Gray CODE 0 0000 1 0001 2 0011 3 0010 4 0110 5 1110 6 1010 7 1011 8 1001 9 1000 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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. Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  35. ISO-8859-1 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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) Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  37. ISO-8859 Code Pages http://czyborra.com/charsets/iso8859.html • 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) Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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) Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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-Z0x0061 ~ 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

  43. UTF-8 http://www.unicode.org/versions/Unicode5.0.0/ • 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字元 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) 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 Jackie Kan - 2007 (jackiekan@LinTon.1D24H.com/jackiekan@csie.ntu.edu.tw) http://linton.1d24h.com/~jackiekan/

More Related