ASCII Table ตาราง ASCII

Characters encoded as numeric codes 0–127 ตัวอักษรที่เข้ารหัสเป็นรหัสตัวเลข 0–127

Text is stored as character codes. Classic ASCII uses 7 bits, so codes run from 0 to 127 (128 characters). Codes 0–31 are mostly control characters; printable symbols start at 32 (space).

ข้อความถูกเก็บเป็นรหัสตัวอักษร มาตรฐานASCII ใช้ 7 บิต จึงมีรหัส 0 ถึง 127 (128 ตัว) รหัส 0–31 ส่วนใหญ่เป็นตัวอักษรควบคุม; อักขระที่พิมพ์ได้เริ่มที่ 32 (ช่องว่าง)

Useful ASCII facts ข้อควรจำของ ASCII

  • ord(ch): character → denary code (e.g. ord("A") is 65). ord(ch): ตัวอักษร → รหัสฐานสิบ (เช่น ord("A") ได้ 65)
  • chr(n): denary code → character (e.g. chr(32) is space). chr(n): รหัสฐานสิบ → ตัวอักษร (เช่น chr(32) คือช่องว่าง)
  • Same code, many bases: show denary, bin(), and hex() for one value. รหัสเดียวกันหลายฐาน: แสดงฐานสิบ, bin() และ hex() ของค่าเดียวกัน

How ASCII is used การใช้งาน ASCII

Because every machine agrees on the same code for each character, a program can compare and sort text by its codes, store or send text as bytes, and work out one character from another by arithmetic on the code. A few everyday uses:

เพราะทุกเครื่องใช้รหัสเดียวกันสำหรับแต่ละตัวอักษร โปรแกรมจึงเทียบและเรียงข้อความจากรหัสได้ เก็บหรือส่งข้อความเป็นไบต์ได้ และคำนวณหาตัวอักษรหนึ่งจากอีกตัวได้ด้วยการบวกลบรหัส ตัวอย่างการใช้งานที่พบบ่อย:

Useการใช้งาน Exampleตัวอย่าง
Store / send text as bytesเก็บ / ส่งข้อความเป็นไบต์ A text file or a serial link sends "Hi" as codes 72, 105.ไฟล์ข้อความหรือพอร์ต serial ส่ง "Hi" เป็นรหัส 72, 105
Sort / compare wordsเรียง / เทียบคำ "Apple" < "banana" is True because ord("A") 65 < ord("b") 98."Apple" < "banana" เป็น True เพราะ ord("A") 65 < ord("b") 98
Check a character rangeตรวจช่วงของอักขระ A character is a digit when its code is 48–57.อักขระเป็นตัวเลขเมื่อรหัสอยู่ในช่วง 48–57
Convert letter caseเปลี่ยนพิมพ์เล็ก / พิมพ์ใหญ่ Lower and upper of the same letter differ by 32 (ord("a") - ord("A")).พิมพ์เล็กกับพิมพ์ใหญ่ของตัวอักษรเดียวกันต่างกัน 32 (ord("a") - ord("A"))

1 Convert letter case with the 32 gap 1 เปลี่ยนพิมพ์เล็ก↔พิมพ์ใหญ่ด้วยผลต่าง 32

For every letter, ord("a") - ord("A") is 32. So chr(ord("a") - 32) gives the uppercase letter, and chr(ord("A") + 32) gives the lowercase one.

สำหรับทุกตัวอักษร ord("a") - ord("A") เท่ากับ 32 เสมอ ดังนั้น chr(ord("a") - 32) ได้ตัวพิมพ์ใหญ่ และ chr(ord("A") + 32) ได้ตัวพิมพ์เล็ก

[1]
[output]
32
A
a

2 Tell a character type from its code range 2 ตรวจชนิดอักขระด้วยช่วงรหัส

Digits are codes 48–57, uppercase letters 65–90, lowercase letters 97–122. for ch in "A7?" visits each character; if / elif / else picks the matching range.

ตัวเลขคือรหัส 48–57, ตัวพิมพ์ใหญ่ 65–90, ตัวพิมพ์เล็ก 97–122 คำสั่ง for ch in "A7?" วนอ่านอักขระทีละตัว แล้ว if / elif / else เลือกช่วงที่ตรง

[2]
[output]
A upper
7 digit
? other

ASCII table (codes 0–127) ตาราง ASCII (รหัส 0–127)

Codes 0–31 and 127 are control characters, shown here by their abbreviation (NUL, LF, CR, ESC, DEL, …); 32 is space (SP). Codes 32–126 are printable.

รหัส 0–31 และ 127 เป็นตัวอักษรควบคุม แสดงด้วยตัวย่อ (NUL, LF, CR, ESC, DEL …) รหัส 32 คือช่องว่าง (SP) ส่วนรหัส 32–126 พิมพ์ได้

Table 1 — ASCII codes 0–127 (Dec = denary, Hex, Chr = character). ตารางที่ 1 — รหัส ASCII 0–127 (Dec = ฐานสิบ, Hex = ฐานสิบหก, Chr = ตัวอักษร)
DecHexChr DecHexChr DecHexChr DecHexChr
000NUL3220SP6440@9660`
101SOH3321!6541A9761a
202STX3422"6642B9862b
303ETX3523#6743C9963c
404EOT3624$6844D10064d
505ENQ3725%6945E10165e
606ACK3826&7046F10266f
707BEL3927'7147G10367g
808BS4028(7248H10468h
909HT4129)7349I10569i
100ALF422A*744AJ1066Aj
110BVT432B+754BK1076Bk
120CFF442C,764CL1086Cl
130DCR452D-774DM1096Dm
140ESO462E.784EN1106En
150FSI472F/794FO1116Fo
1610DLE483008050P11270p
1711DC1493118151Q11371q
1812DC2503228252R11472r
1913DC3513338353S11573s
2014DC4523448454T11674t
2115NAK533558555U11775u
2216SYN543668656V11876v
2317ETB553778757W11977w
2418CAN563888858X12078x
2519EM573998959Y12179y
261ASUB583A:905AZ1227Az
271BESC593B;915B[1237B{
281CFS603C<925C\1247C|
291DGS613D=935D]1257D}
301ERS623E>945E^1267E~
311FUS633F?955F_1277FDEL

Control characters (codes 0–32, and 127) อักขระควบคุม (รหัส 0–32 และ 127)

Control codes do not print a shape — they tell a device to do something. The two form columns write the same code two ways (explained under the table):

รหัสควบคุมไม่ได้พิมพ์รูปอักขระ แต่เป็นคำสั่งให้อุปกรณ์ทำงานบางอย่าง คอลัมน์ รูปแบบ สองช่องเขียนรหัสเดียวกันสองวิธี (อธิบายไว้ใต้ตาราง):

Table 2 — ASCII control characters: abbreviation, name, and meaning. ตารางที่ 2 — อักขระควบคุม ASCII: ตัวย่อ ชื่อเต็ม และความหมาย
Abbr.ตัวย่อ Nameชื่อเต็ม Dec Form Aแบบ A Form Bแบบ B Meaningความหมาย
NUL Nullนัล 0 ^@ \0 End-of-string marker in C; "no character".ตัวปิดท้ายสตริงในภาษา C; "ไม่มีอักขระ"
SOH Start of Headingเริ่มส่วนหัว 1 ^A — Marks the start of a message header (old comms protocols).เริ่มต้นส่วนหัวของข้อความ (โปรโตคอลสื่อสารรุ่นเก่า)
STX Start of Textเริ่มเนื้อความ 2 ^B — Marks where the message body begins.จุดเริ่มต้นของเนื้อความ
ETX End of Textจบเนื้อความ 3 ^C — Marks the end of the message body. Ctrl+C sends this.จุดสิ้นสุดเนื้อความ; Ctrl+C ส่งรหัสนี้
EOT End of Transmissionจบการส่ง 4 ^D — No more data. Ctrl+D sends this (end of input).ไม่มีข้อมูลต่อ; Ctrl+D ส่งรหัสนี้ (จบอินพุต)
ENQ Enquiryสอบถาม 5 ^E — "Are you there?" request for a response.สัญญาณถามปลายทางว่า "พร้อมไหม"
ACK Acknowledgeตอบรับ 6 ^F — "Yes, received / OK" reply.ตอบว่า "รับข้อมูลแล้ว / ตกลง"
BEL Bell / Alertกระดิ่ง 7 ^G \a Makes the terminal beep.สั่งให้เทอร์มินัลส่งเสียงบี๊บ
BS Backspaceถอยหลัง 8 ^H \b Move the cursor back one position.เลื่อนเคอร์เซอร์กลับหนึ่งตำแหน่ง
HT Horizontal Tabแท็บแนวนอน 9 ^I \t Jump to the next tab stop.เลื่อนไปยังตำแหน่งแท็บถัดไป
LF Line Feedป้อนบรรทัด 10 ^J \n Newline; end of a line on Linux and macOS.ขึ้นบรรทัดใหม่; ตัวจบบรรทัดบน Linux และ macOS
VT Vertical Tabแท็บแนวตั้ง 11 ^K \v Move down to the next vertical tab stop.เลื่อนลงไปยังตำแหน่งแท็บแนวตั้งถัดไป
FF Form Feedป้อนหน้า 12 ^L \f Tell a printer to move to a new page.สั่งให้เครื่องพิมพ์เลื่อนไปหน้าถัดไป
CR Carriage Returnปัดแคร่ 13 ^M \r Move the cursor to the start of the line. Windows ends a line with CR + LF.เลื่อนเคอร์เซอร์ไปต้นบรรทัด; Windows จบบรรทัดด้วย CR + LF
SO Shift Outสลับออก 14 ^N — Switch to an alternate character set.สลับไปใช้ชุดอักขระสำรอง
SI Shift Inสลับเข้า 15 ^O — Switch back to the standard character set.สลับกลับมาใช้ชุดอักขระมาตรฐาน
DLE Data Link Escapeหลีกลิงก์ข้อมูล 16 ^P — Changes the meaning of the bytes that follow.เปลี่ยนความหมายของไบต์ที่ตามมา
DC1 Device Control 1 (XON)ควบคุมอุปกรณ์ 1 17 ^Q — Resume transmission (XON) in software flow control.สั่งให้ส่งข้อมูลต่อ (XON) ในการควบคุมการไหลแบบซอฟต์แวร์
DC2 Device Control 2ควบคุมอุปกรณ์ 2 18 ^R — General device-control signal.สัญญาณควบคุมอุปกรณ์ทั่วไป
DC3 Device Control 3 (XOFF)ควบคุมอุปกรณ์ 3 19 ^S — Pause transmission (XOFF).สั่งให้หยุดส่งข้อมูลชั่วคราว (XOFF)
DC4 Device Control 4ควบคุมอุปกรณ์ 4 20 ^T — General device-control signal, often "stop".สัญญาณควบคุมอุปกรณ์ มักหมายถึง "หยุด"
NAK Negative Acknowledgeตอบปฏิเสธ 21 ^U — "Not received / error" reply.ตอบว่า "ไม่ได้รับ / ผิดพลาด"
SYN Synchronous Idleซิงก์ว่าง 22 ^V — Filler sent to keep two devices in sync.ไบต์เติมเพื่อรักษาการซิงก์ระหว่างอุปกรณ์
ETB End of Transmission Blockจบบล็อกการส่ง 23 ^W — Marks the end of a block of data.จุดสิ้นสุดของบล็อกข้อมูลหนึ่งบล็อก
CAN Cancelยกเลิก 24 ^X — The data that came before was wrong — ignore it.ข้อมูลก่อนหน้าผิด ให้ยกเลิก
EM End of Mediumจบสื่อ 25 ^Y — End of the usable part of a tape or disk.จุดสิ้นสุดของส่วนที่ใช้ได้บนเทปหรือดิสก์
SUB Substituteแทนที่ 26 ^Z — Replaces a character that was damaged or invalid. Ctrl+Z on Windows.ใช้แทนอักขระที่เสียหรือไม่ถูกต้อง; Ctrl+Z บน Windows
ESC Escapeหลีก 27 ^[ \x1b Starts a control sequence, e.g. terminal colours and cursor moves.เริ่มลำดับควบคุม เช่น รหัสสีและการย้ายเคอร์เซอร์ในเทอร์มินัล
FS File Separatorคั่นไฟล์ 28 ^\ — Separates files in a data stream (largest unit).คั่นระหว่างไฟล์ในสายข้อมูล (หน่วยใหญ่สุด)
GS Group Separatorคั่นกลุ่ม 29 ^] — Separates groups of records.คั่นระหว่างกลุ่มของระเบียน
RS Record Separatorคั่นระเบียน 30 ^^ — Separates records within a group.คั่นระหว่างระเบียนในกลุ่มเดียวกัน
US Unit Separatorคั่นหน่วย 31 ^_ — Separates fields within a record (smallest unit).คั่นระหว่างฟิลด์ในระเบียน (หน่วยเล็กสุด)
SP Spaceช่องว่าง 32 — — Not a control code — the first printable character, shown here to mark the end of the control range.ไม่ใช่รหัสควบคุม แต่เป็นอักขระพิมพ์ได้ตัวแรก ใส่ไว้เพื่อให้เห็นจุดสิ้นสุดของช่วงควบคุม
DEL Deleteลบ 127 ^? — Originally punched out every hole on paper tape to erase a character; today the Delete key.เดิมใช้เจาะรูทุกช่องบนเทปกระดาษเพื่อลบอักขระ ปัจจุบันคือปุ่ม Delete

Form A is caret notation: ^ followed by chr(code + 64), so code 10 becomes ^J. Text editors and terminals use it to show control characters. Form B is the escape sequence used inside C and Python string literals — a backslash plus a letter, e.g. "\n". Only the common codes have a short escape; for the rest, write \xHH (ESC is \x1b) or an octal \NNN. A dash (—) means that form is not defined for the code.

แบบ A คือ caret notation (สัญกรณ์แคเรต): ^ ตามด้วย chr(รหัส + 64) ดังนั้นรหัส 10 กลายเป็น ^J โปรแกรมแก้ไขข้อความและเทอร์มินัลใช้รูปแบบนี้แสดงอักขระควบคุม แบบ B คือ escape sequence (ลำดับอักขระหลีก) ที่ใช้ในสตริงของภาษา C และ Python — เครื่องหมาย backslash ตามด้วยตัวอักษร เช่น "\n" มีเฉพาะรหัสที่ใช้บ่อยเท่านั้น รหัสอื่นเขียนด้วย \xHH (ESC คือ \x1b) หรือเลขฐานแปด \NNN เครื่องหมายขีด (—) หมายถึงไม่มีรูปแบบนั้นสำหรับรหัสนั้น

Source of Tables 1–2: RFC 20 — ASCII Format for Network Interchange; Wikipedia — ASCII (printable chart, plus control-code names and meanings). ที่มาของตารางที่ 1–2: RFC 20 — ASCII Format for Network Interchange; Wikipedia — ASCII (ตารางอักขระพิมพ์ได้และอักขระควบคุม รวมถึงความหมายของรหัสควบคุม)

3 Codes with ord() 3 ดูรหัสด้วย ord()

ord("A"), ord("a"), and ord("0") return the denary ASCII codes for uppercase A, lowercase a, and digit zero.

ord("A"), ord("a") และ ord("0") คืนรหัส ASCII ฐานสิบ ของ A ตัวใหญ่, a ตัวเล็ก และเลขศูนย์

[3]
[output]
65
97
48

4 Characters with chr() 4 แปลงรหัสเป็นตัวอักษรด้วย chr()

chr(65) is A. chr(32) is a space. chr(10) is LF (line feed), a control character — not a printable symbol, so it prints as an empty line.

chr(65) ได้ A ส่วน chr(32) คือช่องว่าง chr(10) คือ LF (ขึ้นบรรทัดใหม่) ซึ่งเป็นตัวอักษรควบคุม ไม่ใช่สัญลักษณ์ที่พิมพ์ได้ จึงแสดงเป็นบรรทัดว่าง

[4]
[output]
A
 

5 One code in denary, binary, and hex 5 รหัสเดียวในฐานสิบ ฐานสอง และฐานสิบหก

Start from denary code 65, then show bin(code), hex(code), and chr(code). The same character appears in every useful base.

เริ่มจากรหัสฐานสิบ 65 แล้วแสดง bin(code), hex(code) และ chr(code) ตัวอักษรเดียวกันปรากฏได้ในทุกฐานที่ใช้บ่อย

[5]
[output]
65
0b1000001
0x41
A

Note: Run uses a JavaScript simulator, not real Python. For real Python, try Google Colab. หมายเหตุ: ปุ่ม Run จำลองด้วย JavaScript ไม่ใช่ Python จริง หากต้องการ Python จริง ลองใช้ Google Colab

References References / แหล่งอ้างอิง

Sources used for ASCII encoding:

แหล่งที่ใช้ประกอบเนื้อหาการเข้ารหัส ASCII:

  1. ASCII — Wikipedia — ASCII (7-bit range, control vs printable) (ช่วง 7 บิต ตัวควบคุมกับที่พิมพ์ได้)
  2. ASCII table (0–127) — RFC 20 — ASCII Format for Network Interchange (source of Table 1 in this lesson) (ที่มาของตารางที่ 1 ในบท)
  3. Python ord / chr — Built-in Functions — ord / chr (used in the demos) (ใช้ในตัวอย่าง Run)

End-of-lesson quizแบบฝึกหัดท้ายบท

ตอบแล้ว 0 / 10

ข้อ 1

1 / 10

How many bits does the original ASCII standard use to store one character code?มาตรฐาน ASCII ดั้งเดิมใช้กี่บิตในการเก็บรหัสหนึ่งตัวอักษร?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) 7 bits7 บิต

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 8 bits8 บิต
    Wrong: 8-bit is an extended encoding (e.g. Latin-1), not classic ASCII.ผิด: 8 บิตเป็นรหัสแบบขยาย (เช่น Latin-1) ไม่ใช่ ASCII ดั้งเดิม
  • (B) 6 bits6 บิต
    Wrong: 6 bits hold only 64 values, too few for ASCII.ผิด: 6 บิตเก็บได้แค่ 64 ค่า ไม่พอสำหรับ ASCII
  • (C) 7 bits7 บิต
    Correct! 7-bit codes give values 0–127.ถูกต้อง! รหัส 7 บิตจึงมีค่าได้ 0–127
  • (D) 16 bits16 บิต
    Wrong: 16-bit is Unicode/UTF-16, not ASCII.ผิด: 16 บิตเป็นแนวของ Unicode/UTF-16 ไม่ใช่ ASCII

ข้อ 2

2 / 10

How many characters does standard ASCII cover in total?รหัส ASCII มาตรฐานครอบคลุมตัวอักษรทั้งหมดกี่ตัว?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (A) 128 characters (codes 0–127)128 ตัว (รหัส 0–127)

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 128 characters (codes 0–127)128 ตัว (รหัส 0–127)
    Correct! 7 bits give 2 to the power 7 = 128 values.ถูกต้อง! 7 บิตให้ 2 ยกกำลัง 7 = 128 ค่า
  • (B) 127 characters127 ตัว
    Wrong: codes start at 0, so 0–127 is 128 characters.ผิด: รหัสเริ่มที่ 0 ดังนั้น 0–127 รวมเป็น 128 ตัว
  • (C) 256 characters256 ตัว
    Wrong: 256 is the 8-bit extended range.ผิด: 256 คือช่วงของรหัส 8 บิตแบบขยาย
  • (D) 100 characters100 ตัว
    Wrong: it does not match the 7-bit code range.ผิด: ไม่ตรงกับช่วงของรหัส 7 บิต

ข้อ 3

3 / 10

ASCII codes 0–31 are mostly used as what?รหัส ASCII ช่วง 0–31 ส่วนใหญ่ถูกใช้เป็นอะไร?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (B) Control charactersตัวอักษรควบคุม (control characters)

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) Digits 0–9ตัวเลข 0–9
    Wrong: the digit character 0 is code 48.ผิด: อักขระเลข 0 อยู่ที่รหัส 48
  • (B) Control charactersตัวอักษรควบคุม (control characters)
    Correct! e.g. NUL, LF, CR, ESC — not printable symbols.ถูกต้อง! เช่น NUL, LF, CR, ESC ซึ่งไม่ใช่สัญลักษณ์ที่พิมพ์ได้
  • (C) Uppercase letters A–Zตัวอักษรพิมพ์ใหญ่ A–Z
    Wrong: A starts at code 65.ผิด: A เริ่มที่รหัส 65
  • (D) Punctuation symbolsสัญลักษณ์วรรคตอน
    Wrong: punctuation is in the printable range from code 33 up.ผิด: วรรคตอนอยู่ในช่วงพิมพ์ได้ตั้งแต่รหัส 33 ขึ้นไป

ข้อ 4

4 / 10

The first printable character is code 32 — which character is it?อักขระที่พิมพ์ได้ตัวแรกคือรหัส 32 ตรงกับอักขระใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (D) A spaceช่องว่าง (space)

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) The letter Aตัวอักษร A
    Wrong: A is code 65.ผิด: A คือรหัส 65
  • (B) A full stop (.)จุด (.)
    Wrong: the full stop is code 46.ผิด: จุดคือรหัส 46
  • (C) The digit 0ตัวเลข 0
    Wrong: the digit character 0 is code 48.ผิด: อักขระเลข 0 คือรหัส 48
  • (D) A spaceช่องว่าง (space)
    Correct! Code 32 is space, written SP.ถูกต้อง! รหัส 32 คือช่องว่าง เขียนย่อว่า SP

ข้อ 5

5 / 10

What is the denary ASCII code of the uppercase letter A?ตัวอักษร A ตัวพิมพ์ใหญ่มีรหัส ASCII ฐานสิบเท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (B) 6565

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 9797
    Wrong: 97 is lowercase a.ผิด: 97 คือรหัสของ a ตัวพิมพ์เล็ก
  • (B) 6565
    Correct! Uppercase A is code 65.ถูกต้อง! A ตัวพิมพ์ใหญ่คือรหัส 65
  • (C) 4141
    Wrong: 41 is the hexadecimal form of 65, not the denary value.ผิด: 41 เป็นรูปฐานสิบหกของ 65 ไม่ใช่ค่าฐานสิบ
  • (D) 4848
    Wrong: 48 is the digit character 0.ผิด: 48 คือรหัสของอักขระเลข 0

ข้อ 6

6 / 10

By how much is a lowercase letter's code larger than the uppercase form of the same letter?รหัสของตัวพิมพ์เล็กมากกว่ารหัสของตัวพิมพ์ใหญ่ (ตัวอักษรเดียวกัน) อยู่เท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (A) 3232

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 3232
    Correct! e.g. 97 (a) − 65 (A) = 32, the same for every letter.ถูกต้อง! เช่น 97 (a) − 65 (A) = 32 เท่ากันทุกตัวอักษร
  • (B) 1616
    Wrong: the real gap is 32.ผิด: ผลต่างจริงคือ 32
  • (C) 11
    Wrong: 1 is the gap between neighbours such as A and B.ผิด: 1 คือระยะห่างระหว่างตัวอักษรที่อยู่ติดกัน เช่น A กับ B
  • (D) 6565
    Wrong: 65 is the code of A, not the gap.ผิด: 65 คือรหัสของ A ไม่ใช่ผลต่าง

ข้อ 7

7 / 10

From the ASCII table, what denary code does the digit character 0 have?จากตาราง ASCII อักขระเลข 0 (ศูนย์) มีรหัสฐานสิบเท่าใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) 4848

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 00
    Wrong: code 0 is NUL, a control character.ผิด: รหัส 0 คือ NUL ซึ่งเป็นตัวควบคุม
  • (B) 3030
    Wrong: code 30 is RS, a control character.ผิด: รหัส 30 คือ RS ซึ่งเป็นตัวควบคุม
  • (C) 4848
    Correct! character '0' is code 48 and '9' is 57.ถูกต้อง! อักขระ '0' คือรหัส 48 และ '9' คือ 57
  • (D) 5858
    Wrong: code 58 is the colon ':'.ผิด: รหัส 58 คือเครื่องหมาย :

ข้อ 8

8 / 10

Which ASCII code range do the digit characters 0 to 9 use?อักขระเลข 0 ถึง 9 ใช้รหัส ASCII ช่วงใด?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (D) 48–5748–57

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) 0–90–9
    Wrong: codes 0–9 are control characters, not digit glyphs.ผิด: รหัส 0–9 เป็นตัวควบคุม ไม่ใช่อักขระตัวเลข
  • (B) 65–7465–74
    Wrong: 65–74 is A–J.ผิด: 65–74 คือ A–J
  • (C) 97–10697–106
    Wrong: 97–106 is a–j.ผิด: 97–106 คือ a–j
  • (D) 48–5748–57
    Correct! '0' = 48 up to '9' = 57 in order.ถูกต้อง! '0' = 48 เรียงต่อกันไปจนถึง '9' = 57

ข้อ 9

9 / 10

When sorting text by ASCII code, which comes first: a word starting with A (65) or one starting with b (98)?เมื่อเรียงข้อความตามรหัส ASCII คำที่ขึ้นต้นด้วย A (65) กับคำที่ขึ้นต้นด้วย b (98) คำใดมาก่อน?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (A) The word starting with A, because 65 < 98คำที่ขึ้นต้นด้วย A เพราะ 65 < 98

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) The word starting with A, because 65 < 98คำที่ขึ้นต้นด้วย A เพราะ 65 < 98
    Correct! Lower codes come first, so every uppercase letter sorts before lowercase.ถูกต้อง! รหัสที่น้อยกว่ามาก่อน ตัวพิมพ์ใหญ่ทุกตัวจึงมาก่อนตัวพิมพ์เล็ก
  • (B) The word starting with b, by case-insensitive alphabetical orderคำที่ขึ้นต้นด้วย b ตามลำดับตัวอักษรแบบไม่สนตัวพิมพ์
    Wrong: code order uses the numeric code value, not case-insensitive order.ผิด: การเรียงตามรหัสใช้ค่าตัวเลขของรหัส ไม่ใช่ลำดับที่ไม่สนตัวพิมพ์
  • (C) They tie, because it is the same letterมาพร้อมกัน เพราะเป็นตัวอักษรเดียวกัน
    Wrong: A and b are different codes (65 and 98).ผิด: A กับ b เป็นคนละรหัส (65 กับ 98)
  • (D) It depends on the word lengthขึ้นอยู่กับความยาวของคำ
    Wrong: comparison always starts from the first character.ผิด: การเทียบเริ่มจากอักขระตัวแรกก่อนเสมอ

ข้อ 10

10 / 10

The last ASCII code, 127, corresponds to what?รหัส ASCII ตัวสุดท้ายคือ 127 ตรงกับอะไร?

เฉลย / Answerซ่อนเฉลย / Hide

เฉลย / Answer: (C) DEL, a control characterDEL ซึ่งเป็นอักขระควบคุม

คำอธิบายแต่ละตัวเลือก / Explanation for each choice

  • (A) The character ~ตัวอักษร ~
    Wrong: ~ is code 126, the last printable character.ผิด: ~ คือรหัส 126 ซึ่งเป็นอักขระพิมพ์ได้ตัวสุดท้าย
  • (B) Another spaceช่องว่างอีกตัวหนึ่ง
    Wrong: space is only code 32.ผิด: ช่องว่างคือรหัส 32 เท่านั้น
  • (C) DEL, a control characterDEL ซึ่งเป็นอักขระควบคุม
    Correct! 127 is DEL, at the end of the table and not a printable symbol.ถูกต้อง! 127 คือ DEL อยู่ท้ายตารางและไม่ใช่สัญลักษณ์ที่พิมพ์ได้
  • (D) The start of the extended codesจุดเริ่มของรหัสแบบขยาย
    Wrong: extended codes start at 128, outside 7-bit ASCII.ผิด: รหัสแบบขยายเริ่มที่ 128 ซึ่งอยู่นอก ASCII 7 บิต