Digital-electronics 简明教程
Digital Electronics - ASCII Codes
ASCII 代表 American Standard Code for Information Interchange 。ASCII 编码是一种在数字计算系统中用于字符编码的常用编码方案。
ASCII stands for American Standard Code for Information Interchange. The ASCII code is a popular coding scheme used in digital computing systems to encode characters.
在 ASCII 编码中,为每个字符(如数字、字母、符号等)分配了一个唯一的整数值。标准 ASCII 编码定义了一组 128 个字符,其中每个字符都可以用一个唯一的 7 位二进制代码表示。因此,ASCII 编码可以表示总共 27 = 128 个可能的字符。
In the ASCII code, a unique integer value is assigned to each character like number, letter, symbol, etc. The standard ASCII code defines a set of 128 characters, where each character can be represented by a unique 7-bit binary code. Therefore, ASCII code can represent total 27 = 128 possible characters.
在数字电子产品中,ASCII 编码中的字符通常用十进制或十六进制表示。总体而言,ASCII 编码是用于在数字计算机和通信系统中表示字符的标准编码方案。
In digital electronics, the characters in ASCII code are generally represented in decimal or hexadecimal notation. Overall, the ASCII code is a standard encoding scheme for representing characters in digital computers and communication systems.
Properties of ASCII Code
以下是 ASCII 编码的一些关键特征:
The following are some key characteristics of ASCII code −
-
ASCII code assigns a unique numeric value to each character.
-
ASCII code provides a way of representing letters, numbers, symbols, and control characters.
-
ASCII code is compatible with a wide range of programming languages and digital devices.
-
ASCII code supports various control characters for basic text formatting and device control.
-
ASCII code has decimal and hexadecimal representation. Hence, it is human-readable.
-
ASCII code assigns numeric values to characters in a sequential order, making it an efficient encoding standard in terms of sorting and searching.
-
ASCII code is highly space efficient and simple.
Types of ASCII Code
ASCII(美国信息交换标准代码)代码基本上是数字电子产品中使用的 7 位字符编码标准。但它随着计算技术的进步而发展。
ASCII (American Standard Code for Information Interchange) code is basically a 7-bit character encoding standard used in digital electronics. But it is evolved with the advancement in computing technologies.
以下是有两种主要类型的 ASCII 代码:
The following are two main types of ASCII codes −
-
Standard ASCII Code
-
Extended ASCII Code
让我们首先讨论标准 ASCII 代码。
Let’s discuss the Standard ASCII Codes first.
Standard ASCII Code
它是一个 7 位字符编码标准,范围从 0 到 127,即总共 128 个可能的字符。它为每个字符(包括数字、字母、符号和控制字符)分配一个 7 位唯一的二进制代码。
It is a 7-bit character encoding standard having a range from 0 to 127 i.e., total 128 possible characters. It assigns a 7-bit unique binary code to each character including numbers, letters, symbols, and control characters.
下表以十进制和二进制形式突出显示了从 0 到 127 范围内的名称、符号和 ASCII 代码。
The following table highlights the name, symbol and ASCII code in decimal and binary form for the range from 0 to 127.
Name |
Symbol |
Decimal |
7-Bit Binary |
Null char |
NUL |
0 |
00000000 |
Start of Heading |
SOH |
1 |
00000001 |
Start of Text |
STX |
2 |
00000010 |
End of Text |
ETX |
3 |
00000011 |
End of Transmission |
EOT |
4 |
00000100 |
Enquiry |
ENQ |
5 |
00000101 |
Acknowledgment |
ACK |
6 |
00000110 |
Bell |
BEL |
7 |
00000111 |
Back Space |
BS |
8 |
00001000 |
Horizontal Tab |
HT |
9 |
00001001 |
Line Feed |
LF |
10 |
00001010 |
Vertical Tab |
VT |
11 |
00001011 |
Form Feed |
FF |
12 |
00001100 |
Carriage Return |
CR |
13 |
00001101 |
Shift Out / X-On |
SO |
14 |
00001110 |
Shift In / X-Off |
SI |
15 |
00001111 |
Data Line Escape |
DLE |
16 |
00010000 |
Device Control 1 (oft. XON) |
DC1 |
17 |
00010001 |
Device Control 2 |
DC2 |
18 |
00010010 |
Device Control 3 (oft. XOFF) |
DC3 |
19 |
00010011 |
Device Control 4 |
DC4 |
20 |
00010100 |
Negative Acknowledgement |
NAK |
21 |
00010101 |
Synchronous Idle |
SYN |
22 |
00010110 |
End of Transmit Block |
ETB |
23 |
00010111 |
Cancel |
CAN |
24 |
00011000 |
End of Medium |
EM |
25 |
00011001 |
Substitute |
SUB |
26 |
00011010 |
Escape |
ESC |
27 |
00011011 |
File Separator |
FS |
28 |
00011100 |
Group Separator |
GS |
29 |
00011101 |
Record Separator |
RS |
30 |
00011110 |
Unit Separator |
US |
31 |
00011111 |
Space |
32 |
00100000 |
|
Exclamation mark |
! |
33 |
00100001 |
Double quotes |
" |
34 |
00100010 |
Hash |
# |
35 |
00100011 |
Dollar |
$ |
36 |
00100100 |
Percentage |
% |
37 |
00100101 |
Ampersand |
& |
38 |
00100110 |
Single quote |
' |
39 |
00100111 |
Open parenthesis |
( |
40 |
00101000 |
Close parenthesis |
) |
41 |
00101001 |
Asterisk |
* |
42 |
00101010 |
Plus |
+ |
43 |
00101011 |
Comma |
, |
44 |
00101100 |
Hyphen |
- |
45 |
00101101 |
Period, dot or full stop |
. |
46 |
00101110 |
Slash or divide |
/ |
47 |
00101111 |
Zero |
0 |
48 |
00110000 |
One |
1 |
49 |
00110001 |
Two |
2 |
50 |
00110010 |
Three |
3 |
51 |
00110011 |
Four |
4 |
52 |
00110100 |
Five |
5 |
53 |
00110101 |
Six |
6 |
54 |
00110110 |
Seven |
7 |
55 |
00110111 |
Eight |
8 |
56 |
00111000 |
Nine |
9 |
57 |
00111001 |
Colon |
: |
58 |
00111010 |
Semicolon |
; |
59 |
00111011 |
Less than |
< |
60 |
00111100 |
Equals |
= |
61 |
00111101 |
Greater than |
> |
62 |
00111110 |
Question mark |
? |
63 |
00111111 |
At symbol |
@ |
64 |
01000000 |
Uppercase A |
A |
65 |
01000001 |
Uppercase B |
B |
66 |
01000010 |
Uppercase C |
C |
67 |
01000011 |
Uppercase D |
D |
68 |
01000100 |
Uppercase E |
E |
69 |
01000101 |
Uppercase F |
F |
70 |
01000110 |
Uppercase G |
G |
71 |
01000111 |
Uppercase H |
H |
72 |
01001000 |
Uppercase I |
I |
73 |
01001001 |
Uppercase J |
J |
74 |
01001010 |
Uppercase K |
K |
75 |
01001011 |
Uppercase L |
L |
76 |
01001100 |
Uppercase M |
M |
77 |
01001101 |
Uppercase N |
N |
78 |
01001110 |
Uppercase O |
O |
79 |
01001111 |
Uppercase P |
P |
80 |
01010000 |
Uppercase Q |
Q |
81 |
01010001 |
Uppercase R |
R |
82 |
01010010 |
Uppercase S |
S |
83 |
01010011 |
Uppercase T |
T |
84 |
01010100 |
Uppercase U |
U |
85 |
01010101 |
Uppercase V |
V |
86 |
01010110 |
Uppercase W |
W |
87 |
01010111 |
Uppercase X |
X |
88 |
01011000 |
Uppercase Y |
Y |
89 |
01011001 |
Uppercase Z |
Z |
90 |
01011010 |
Opening bracket |
[ |
91 |
01011011 |
Backslash |
92 |
01011100 |
|
Closing bracket |
] |
93 |
01011101 |
Caret - circumflex |
^ |
94 |
01011110 |
Underscore |
_ |
95 |
01011111 |
Grave accent |
` |
96 |
01100000 |
Lowercase |
a |
97 |
01100001 |
Lowercase |
b |
98 |
01100010 |
Lowercase |
c |
99 |
01100011 |
Lowercase |
d |
100 |
01100100 |
Lowercase |
e |
101 |
01100101 |
Lowercase |
f |
102 |
01100110 |
Lowercase |
g |
103 |
01100111 |
Lowercase |
h |
104 |
01101000 |
Lowercase |
i |
105 |
01101001 |
Lowercase |
j |
106 |
01101010 |
Lowercase |
k |
107 |
01101011 |
Lowercase |
l |
108 |
01101100 |
Lowercase |
m |
109 |
01101101 |
Lowercase |
n |
110 |
01101110 |
Lowercase |
o |
111 |
01101111 |
Lowercase |
p |
112 |
01110000 |
Lowercase |
q |
113 |
01110001 |
Lowercase |
r |
114 |
01110010 |
Lowercase |
s |
115 |
01110011 |
Lowercase |
t |
116 |
01110100 |
Lowercase |
u |
117 |
01110101 |
Lowercase |
v |
118 |
01110110 |
Lowercase |
w |
119 |
01110111 |
Lowercase |
x |
120 |
01111000 |
Lowercase |
y |
121 |
01111001 |
Lowercase |
z |
122 |
01111010 |
Opening brace |
{ |
123 |
01111011 |
Vertical bar |
124 |
||
01111100 |
Closing brace |
} |
125 |
01111101 |
Equivalency sign (tilde) |
~ |
126 |
01111110 |
Delete |
127 |
Extended ASCII Code
它是一个 8 位字符编码标准,范围从 0 到 255,即总共 256 个可能的字符。扩展 ASCII 代码为标准 ASCII 代码添加了额外的 128 个字符。
It is an 8-bit character encoding standard having a range from 0 to 255 i.e., total 256 possible characters. The extended ASCII code adds extra 128 characters to the standard ASCII code.
下表以十进制和二进制形式显示了从 128 到 255 范围内的名称、符号和 ASCII 代码。
The following table shows the name, symbol and ASCII code in decimal and binary form for the range from 128 to 255.
Name |
Symbol |
DEC |
BIN |
Euro sign |
€ |
128 |
10000000 |
129 |
10000001 |
||
Single low-9 quotation mark |
‚ |
130 |
10000010 |
Latin small letter f with hook |
ƒ |
131 |
10000011 |
Double low-9 quotation mark |
„ |
132 |
10000100 |
Horizontal ellipsis |
… |
133 |
10000101 |
Dagger |
† |
134 |
10000110 |
Double dagger |
‡ |
135 |
10000111 |
Modifier letter circumflex accent |
ˆ |
136 |
10001000 |
Per mille sign |
‰ |
137 |
10001001 |
Latin capital letter S with caron |
Š |
138 |
10001010 |
Single left-pointing angle quotation |
‹ |
139 |
10001011 |
Latin capital ligature OE |
Œ |
140 |
10001100 |
141 |
10001101 |
||
Latin capital letter Z with caron |
Ž |
142 |
10001110 |
143 |
10001111 |
||
144 |
10010000 |
||
Left single quotation mark |
‘ |
145 |
10010001 |
Right single quotation mark |
’ |
146 |
10010010 |
Left double quotation mark |
“ |
147 |
10010011 |
Right double quotation mark |
” |
148 |
10010100 |
Bullet |
• |
149 |
10010101 |
En dash |
– |
150 |
10010110 |
Em dash |
— |
151 |
10010111 |
Small tilde |
˜ |
152 |
10011000 |
Trade mark sign |
™ |
153 |
10011001 |
Latin small letter S with caron |
š |
154 |
10011010 |
Single right-pointing angle quotation mark |
› |
155 |
10011011 |
Latin small ligature oe |
œ |
156 |
10011100 |
157 |
10011101 |
||
Latin small letter z with caron |
ž |
158 |
10011110 |
Latin capital letter Y with diaeresis |
Ÿ |
159 |
10011111 |
Non-breaking space |
160 |
10100000 |
|
Inverted exclamation mark |
¡ |
161 |
10100001 |
Cent sign |
¢ |
162 |
10100010 |
Pound sign |
£ |
163 |
10100011 |
Currency sign |
¤ |
164 |
10100100 |
Yen sign |
¥ |
165 |
10100101 |
Pipe, Broken vertical bar |
¦ |
166 |
10100110 |
Section sign |
§ |
167 |
10100111 |
Spacing diaeresis - umlaut |
¨ |
168 |
10101000 |
Copyright sign |
© |
169 |
10101001 |
Feminine ordinal indicator |
ª |
170 |
10101010 |
Left double angle quotes |
« |
171 |
10101011 |
Not sign |
¬ |
172 |
10101100 |
Soft hyphen |
173 |
10101101 |
|
Registered trade mark sign |
® |
174 |
10101110 |
Spacing macron - overline |
¯ |
175 |
10101111 |
Degree sign |
° |
176 |
10110000 |
Plus-or-minus sign |
± |
177 |
10110001 |
Superscript two - squared |
² |
178 |
10110010 |
Superscript three - cubed |
³ |
179 |
10110011 |
Acute accent - spacing acute |
´ |
180 |
10110100 |
Micro sign |
µ |
181 |
10110101 |
Pilcrow sign - paragraph sign |
¶ |
182 |
10110110 |
Middle dot - Georgian comma |
· |
183 |
10110111 |
Spacing cedilla |
¸ |
184 |
10111000 |
Superscript one |
¹ |
185 |
10111001 |
Masculine ordinal indicator |
º |
186 |
10111010 |
Right double angle quotes |
» |
187 |
10111011 |
Fraction one quarter |
¼ |
188 |
10111100 |
Fraction one half |
½ |
189 |
10111101 |
Fraction three quarters |
¾ |
190 |
10111110 |
Inverted question mark |
¿ |
191 |
10111111 |
Latin capital letter A with grave |
À |
192 |
11000000 |
Latin capital letter A with acute |
Á |
193 |
11000001 |
Latin capital letter A with circumflex |
 |
194 |
11000010 |
Latin capital letter A with tilde |
à |
195 |
11000011 |
Latin capital letter A with diaeresis |
Ä |
196 |
11000100 |
Latin capital letter A with ring above |
Å |
197 |
11000101 |
Latin capital letter AE |
Æ |
198 |
11000110 |
Latin capital letter C with cedilla |
Ç |
199 |
11000111 |
Latin capital letter E with grave |
È |
200 |
11001000 |
Latin capital letter E with acute |
É |
201 |
11001001 |
Latin capital letter E with circumflex |
Ê |
202 |
11001010 |
Latin capital letter E with diaeresis |
Ë |
203 |
11001011 |
Latin capital letter I with grave |
Ì |
204 |
11001100 |
Latin capital letter I with acute |
Í |
205 |
11001101 |
Latin capital letter I with circumflex |
Î |
206 |
11001110 |
Latin capital letter I with diaeresis |
Ï |
207 |
11001111 |
Latin capital letter ETH |
Ð |
208 |
11010000 |
Latin capital letter N with tilde |
Ñ |
209 |
11010001 |
Latin capital letter O with grave |
Ò |
210 |
11010010 |
Latin capital letter O with acute |
Ó |
211 |
11010011 |
Latin capital letter O with circumflex |
Ô |
212 |
11010100 |
Latin capital letter O with tilde |
Õ |
213 |
11010101 |
Latin capital letter O with diaeresis |
Ö |
214 |
11010110 |
Multiplication sign |
× |
215 |
11010111 |
Latin capital letter O with slash |
Ø |
216 |
11011000 |
Latin capital letter U with grave |
Ù |
217 |
11011001 |
Latin capital letter U with acute |
Ú |
218 |
11011010 |
Latin capital letter U with circumflex |
Û |
219 |
11011011 |
Latin capital letter U with diaeresis |
Ü |
220 |
11011100 |
Latin capital letter Y with acute |
Ý |
221 |
11011101 |
Latin capital letter THORN |
Þ |
222 |
11011110 |
Latin small letter sharp s - ess-zed |
ß |
223 |
11011111 |
Latin small letter a with grave |
à |
224 |
11100000 |
Latin small letter a with acute |
á |
225 |
11100001 |
Latin small letter a with circumflex |
â |
226 |
11100010 |
Latin small letter a with tilde |
ã |
227 |
11100011 |
Latin small letter a with diaeresis |
ä |
228 |
11100100 |
Latin small letter a with ring above |
å |
229 |
11100101 |
Latin small letter ae |
æ |
230 |
11100110 |
Latin small letter c with cedilla |
ç |
231 |
11100111 |
Latin small letter e with grave |
è |
232 |
11101000 |
Latin small letter e with acute |
é |
233 |
11101001 |
Latin small letter e with circumflex |
ê |
234 |
11101010 |
Latin small letter e with diaeresis |
ë |
235 |
11101011 |
Latin small letter i with grave |
ì |
236 |
11101100 |
Latin small letter i with acute |
í |
237 |
11101101 |
Latin small letter i with circumflex |
î |
238 |
11101110 |
Latin small letter i with diaeresis |
ï |
239 |
11101111 |
Latin small letter eth |
ð |
240 |
11110000 |
Latin small letter n with tilde |
ñ |
241 |
11110001 |
Latin small letter o with grave |
ò |
242 |
11110010 |
Latin small letter o with acute |
ó |
243 |
11110011 |
Latin small letter o with circumflex |
ô |
244 |
11110100 |
Latin small letter o with tilde |
õ |
245 |
11110101 |
Latin small letter o with diaeresis |
ö |
246 |
11110110 |
Division sign |
÷ |
247 |
11110111 |
Latin small letter o with slash |
ø |
248 |
11111000 |
Latin small letter u with grave |
ù |
249 |
11111001 |
Latin small letter u with acute |
ú |
250 |
11111010 |
Latin small letter u with circumflex |
û |
251 |
11111011 |
Latin small letter u with diaeresis |
ü |
252 |
11111100 |
Latin small letter y with acute |
ý |
253 |
11111101 |
Latin small letter thorn |
þ |
254 |
11111110 |
Latin small letter y with diaeresis |
ÿ |
255 |
11111111 |
Advantages of ASCII Code
以下是 ASCII(美国信息交换标准代码)代码的主要优点:
The following are the key benefits of the ASCII (American Standard Code for Information Interchange) code −
-
The ASCII code provides a simple and straightforward encoding scheme to represent letters, numbers, and symbols.
-
ASCII code is compatible with a wide range of programming languages and computing devices.
-
ASCII code provides a compact character representation, where each character can be represented using 7-bits or 8-bits. Hence, it is a space efficient encoding standard.
-
ASCII code is a universally adopted encoding standard in the field of digital electronics.
-
ASCII code has easy and simple implementation in hardware and software.
Limitations of ASCII Code
ASCII 码有上面描述的几个优点,但它也有一些下面给出的缺点:
ASCII code has several advantages as described above, but it also has some limitations which are given below −
-
The standard ASCII code has a limited set of 128 characters. This makes it unsuitable for representing characters of languages other than English.
-
The ASCII code can be extended to 8-bits but it is not standardized beyond 7-bits.
-
ASCII code is not suitable to use in systems that require a broad range of characters.
Applications of ASCII Code
ASCII 码是一种标准的字符编码方案,用于数字电子领域的广泛应用。
ASCII code is a standard character encoding scheme used in wide range of applications in the field of digital electronics.
ASCII 码的一些主要应用如下:
Some major applications of ASCII code are listed below −
-
ASCII code is used in digital systems for textual communication.
-
ASCII code is used in computer programming to represent alphanumeric data like letters, numbers, symbols, etc.
-
ASCII code is also used in various communication protocols utilized for data transmission among devices.
-
In the field web technology, ASCII code is used to represent different characters and symbols in a webpage.
-
ASCII code is also used in database systems to represent text data.
Conclusion
总之,ASCII(美国信息交换标准代码)是一种在数字系统中广泛使用的字符编码方案。它是一个 7 位标准代码,用于表示总共 128 个字符,包括数字、字母、符号和控制字符。
In conclusion, ASCII (American Standard Code for Information Interchange) is a character encoding scheme widely used in digital systems. It is a 7-bit standard code used to represent a total of 128 characters including numbers, letters, symbols, and control characters.