Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Software

IGCSE Computer Science · ⁨Computer Science IGCSE⁩ · Topic 4 · ⁨หัวข้อ 4⁩

Video lesson for this topic · ⁨บทเรียนวิดีโอสำหรับหัวข้อนี้⁩ Open the video page · ⁨เปิดหน้าวิดีโอ⁩
13:11

ฮาร์ดแวร์และซอฟต์แวร์

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

English narration · English + 中文 subtitles burned in · ⁨การบรรยายภาษาอังกฤษ · คำบรรยายภาษาอังกฤษ + 中文 ลอยตัวบนภาพ⁩

4.1

Hardware and software · ⁨ฮาร์ดแวร์และซอฟต์แวร์⁩

English

A computer system is made of two parts that work together.

  • Hardware 硬件 is the physical 物理的 parts of the computer — the parts you can touch. Examples: the CPU, memory, keyboard, screen and hard disk.
  • Software 软件 is the programs 程序 that control the computer and tell the hardware what to do.

Hardware cannot do anything useful on its own. Software needs hardware to run on. Both are needed.

ไทย

ระบบคอมพิวเตอร์ประกอบด้วยสองส่วนที่ทำงานร่วมกัน

ฮาร์ดแวร์คือส่วนประกอบทางกายภาพ (CPU, คีย์บอร์ด); ซอฟต์แวร์คือโปรแกรม (แอป, ระบบปฏิบัติการ)
ฮาร์ดแวร์คือส่วนประกอบทางกายภาพ; ซอฟต์แวร์คือโปรแกรม
  • ฮาร์ดแวร์ คือส่วนประกอบ ทางกายภาพ ของคอมพิวเตอร์ — ส่วนที่คุณสัมผัสได้ ตัวอย่าง: CPU, หน่วยความจำ, คีย์บอร์ด, จอภาพ และไดรฟ์แข็ง
  • ซอฟต์แวร์ คือ โปรแกรม ที่ควบคุมคอมพิวเตอร์และบอกฮาร์ดแวร์ว่าควรทำอะไร

ฮาร์ดแวร์ไม่สามารถทำอะไรที่เป็นประโยชน์ได้ด้วยตัวเอง ซอฟต์แวร์ต้องการฮาร์ดแวร์เพื่อรัน ทั้งสองอย่างจำเป็น

เมนบอร์ดคอมพิวเตอร์พร้อมชิต สล็อต และคอนเนกเตอร์
เมนบอร์ดและส่วนประกอบที่ติดตั้งอยู่บนมันคือฮาร์ดแวร์ — ส่วนประกอบทางกายภาพที่คุณสัมผัสได้
ระบบปฏิบัติการเดสก์ท็อปบนหน้าจอ
ระบบปฏิบัติการคือซอฟต์แวร์ — โปรแกรมที่บอกฮาร์ดแวร์ว่าควรทำอะไร
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
Hardware/ˈhɑːdweə/ Hardware
physical/ˈfɪzɪkl/ ทางกายภาพ
Software/ˈsɒftweə/ Software
programs/ˈprəʊɡræmz/ โปรแกรม
4.1

Types of software · ⁨ประเภทของซอฟต์แวร์⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
1 Describe the difference between system software and application software and provide examples of each • System software provides the services that the computer requires, including operating system and utility software • Application software provides the services that the user requires
2 Describe the role and basic functions of an operating system • Including: – managing files – handling interrupts – providing an interface – managing peripherals and drivers – managing memory – managing multitasking – providing a platform for running applications – providing system security – managing user accounts
3 Understand how hardware, firmware and an operating system are required to run applications software • Applications are run on the operating system • The operating system is run on the firmware • The bootloader (firmware) is run on the hardware
4 Describe the role and operation of interrupts • Including: – how an interrupt is generated – how it is handled using an interrupt service routine – what happens as a result of the interrupts • Software interrupts include division by zero and two processes trying to access the same memory location • Hardware interrupts include pressing a key on the keyboard and moving the mouse
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
1 อธิบายความแตกต่างระหว่าง ซอฟต์แวร์ระบบ และ ซอฟต์แวร์แอปพลิเคชัน พร้อมยกตัวอย่างของแต่ละชนิด • ซอฟต์แวร์ระบบให้บริการที่คอมพิวเตอร์ต้องการ รวมถึงระบบปฏิบัติการและซอฟต์แวร์ utility • ซอฟต์แวร์แอปพลิเคชันให้บริการที่ผู้ใช้ต้องการ
2 อธิบายบทบาทและหน้าที่พื้นฐานของ ระบบปฏิบัติการ • รวมถึง: – การจัดการไฟล์ – การจัดการการรบกวน (interrupts) – การให้อินเตอร์เฟซ – การจัดการอุปกรณ์ต่อพ่วงและไดรเวอร์ – การจัดการหน่วยความจำ – การจัดการการทำงานหลายอย่างพร้อมกัน – การให้เป็นแพลตฟอร์มสำหรับรันแอปพลิเคชัน – การให้ความปลอดภัยให้กับระบบ – การจัดการบัญชีผู้ใช้
3 เข้าใจว่าฮาร์ดแวร์, ฟIRMWARE และระบบปฏิบัติการ จำเป็นต้องทำงานร่วมกันอย่างไรเพื่อรันซอฟต์แวร์แอปพลิเคชัน • แอปพลิเคชันถูกรันบนระบบปฏิบัติการ • ระบบปฏิบัติการถูก runnable บน firmware • Bootloader (firmware) ถูกรันบนฮาร์ดแวร์
4 อธิบายบทบาทและการทำงานของ การรบกวน (interrupts) • รวมถึง: – การสร้างการรบกวนเกิดขึ้นได้อย่างไร – การจัดการการรบกวนโดยใช้ service routine ของการรบกวน (ISR) – สิ่งที่เกิดขึ้นเป็นผลมาจากการรบกวน • การรบกวนแบบซอฟต์แวร์รวมถึงการหารด้วยศูนย์ และการพยายามเข้าถึงตำแหน่งหน่วยความจำเดียวกันโดยสองกระบวนการ • การรบกวนแบบฮาร์ดแวร์รวมถึงการกดปุ่มบนคีย์บอร์ดและการขยับเมาส์

Source: Cambridge International syllabus · ⁨แหล่งที่มา: หลักสูตร Cambridge International⁩

English

Software is split into two types.

System software

System software 系统软件 controls the computer itself and gives a base for other programs to run on. Examples:

  • operating system 操作系统 (see below);
  • compiler 编译器 and linker 链接器 (tools that turn programs into a form the computer can run);
  • device driver 设备驱动程序 — software that lets the operating system control a piece of hardware;
  • utility software 实用程序 — small tools that look after the computer (for example anti-virus, backup, disk clean-up).

Below the operating system sits firmware 固件 – software stored permanently on ROM or flash that runs the moment the computer is switched on. The BIOS and the bootloader 引导程序 are firmware: they test the hardware and then load the operating system. So the layers stack up hardware → firmware → operating system → application software, each running on the layer below.

Application software

Application software 应用软件 lets the user do a useful task. Examples:

  • word processing 文字处理 software (writing documents);
  • spreadsheet 电子表格 software (working with numbers in a grid);
  • database management system 数据库管理系统 (storing and searching data);
  • web browser 网页浏览器 (viewing web pages).
System software Application software
Job runs and manages the computer helps the user do a task
Used by the computer (in the background) the user (directly)
Examples operating system, drivers, utilities word processor, browser, games
ไทย

ซอฟต์แวร์แบ่งออกเป็นสองประเภท

แผนภาพแยกซอฟต์แวร์ออกเป็นระบบซอฟต์แวร์ (ระบบปฏิบัติการ, อูทิลิตี้, ไดรเวอร์, คอมไพเลอร์) และซอฟต์แวร์แอปพลิเคชัน (โปรแกรมพิมพ์งาน, สเปรดชีต, ฐานข้อมูล, เบราว์เซอร์)
ซอฟต์แวร์แบ่งเป็นระบบซอฟต์แวร์ (รันคอมพิวเตอร์) และซอฟต์แวร์แอปพลิเคชัน (ช่วยให้ผู้ใช้ทำงาน)

ระบบซอฟต์แวร์

ระบบซอฟต์แวร์ ควบคุมคอมพิวเตอร์เองและเป็นพื้นฐานให้โปรแกรมอื่นรันได้ ตัวอย่าง:

  • operating system (ดูด้านล่าง);
  • compiler และ linker (เครื่องมือที่แปลงโปรแกรมให้อยู่ในรูปที่คอมพิวเตอร์รันได้);
  • device driver — ซอฟต์แวร์ที่ช่วยให้ระบบปฏิบัติการควบคุมฮาร์ดแวร์ชิ้นหนึ่ง;
  • utility software — เครื่องมือขนาดเล็กดูแลคอมพิวเตอร์ (เช่น แอนติไวรัส, การสำรองข้อมูล, ทำความสะอาดดิสก์)

ใต้ระบบปฏิบัติการมี firmware — ซอฟต์แวร์ที่บันทึกไว้ใน ROM หรือแฟลชอย่างถาวรและรันทันทีเมื่อเปิดเครื่อง BIOS และ bootloader เป็น firmware:它们ทดสอบฮาร์ดแวร์แล้วโหลดระบบปฏิบัติการ ดังนั้นชั้นจะเรียงกันจากล่างขึ้นบน hardware → firmware → operating system → application software, โดยแต่ละชั้นรันบนชั้นที่อยู่ด้านล่าง

ซอฟต์แวร์แอปพลิเคชัน

ซอฟต์แวร์แอปพลิเคชัน ช่วยให้ผู้ใช้ทำงานที่มีประโยชน์ ตัวอย่าง:

  • word processing software (เขียนเอกสาร);
  • spreadsheet software (ทำงานกับตัวเลขในตาราง);
  • database management system (จัดเก็บและค้นหาข้อมูล);
  • web browser (ดูหน้าเว็บ)
ระบบซอฟต์แวร์ ซอฟต์แวร์แอปพลิเคชัน
งาน รันและจัดการคอมพิวเตอร์ ช่วยผู้ใช้ทำงาน
ใช้โดย คอมพิวเตอร์ (ในพื้นหลัง) ผู้ใช้ (โดยตรง)
ตัวอย่าง ระบบปฏิบัติการ, ไดรเวอร์, อูทิลิตี้ โปรแกรมพิมพ์งาน, เบราว์เซอร์, เกม
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
operating system/ˈɒpəreɪtɪŋ ˈsɪstəm/ operating system
compiler/kəmˈpaɪlə/ compiler
linker/ˈlɪŋkə/ ลิงเกอร์
device driver/dɪˈvaɪs ˈdraɪvə/ ไดรเวอร์อุปกรณ์
utility software/juːˈtɪlɪti ˈsɒftweə/ ซอฟต์แวร์ระบบ
firmware/ˈfɜːmweə/ เฟิร์มแวร์
bootloader/ˈbuːtləʊdə/ บูตโหลดเดอร์
Application software/ˌæplɪˈkeɪʃn ˈsɒftweə/ ซอฟต์แวร์แอปพลิเคชัน
word processing/wɜːd ˈprəʊsesɪŋ/ การประมวลผลคำ
spreadsheet/ˈspredʃiːt/ ตารางคำนวณ
database management system/ˈdeɪtəbeɪs ˈmænɪdʒmənt ˈsɪstəm/ ระบบจัดการฐานข้อมูล
web browser/web ˈbraʊzə/ เว็บเบราว์เซอร์
providing a user interface/prəˈvaɪdɪŋ ə ˈjuːzə ˈɪntəfeɪs/ การจัดเตรียมอินเทอร์เฟซผู้ใช้
managing peripherals/ˈmænɪdʒɪŋ pəˈrɪfərəlz/ การจัดการอุปกรณ์ต่อพ่วง
managing multitasking/ˈmænɪdʒɪŋ ˈmʌltitæskɪŋ/ การจัดการ_multitasking
providing a platform/prəˈvaɪdɪŋ ə ˈplætfɔːm/ การจัดเตรียมแพลตฟอร์ม
4.1

The operating system · ⁨ระบบปฏิบัติการ⁩

English

An operating system (OS) is the main system software. It controls the whole computer and lets the hardware, the application software and the user work together. Without an OS the computer is very hard to use.

The OS has many roles:

  • managing files — saving, opening, naming, moving and deleting files;
  • handling interrupts (see below);
  • providing a user interface 用户界面 so the user can control the computer;
  • managing memory — deciding what is kept in RAM and where;
  • managing peripherals 外围设备 and their drivers — controlling devices like printers;
  • managing multitasking 多任务处理 — letting several programs run at once;
  • providing a platform 平台 for running application software;
  • managing security — user accounts, passwords and access rights.
ไทย

ระบบปฏิบัติการ (OS) เป็นระบบซอฟต์แวร์หลัก ควบคุมคอมพิวเตอร์ทั้งเครื่องและทำให้ฮาร์ดแวร์ ซอฟต์แวร์แอปพลิเคชัน และผู้ใช้ทำงานร่วมกันได้ โดยไม่มี OS การใช้คอมพิวเตอร์จะยากมาก

สี่ชั้นซ้อนกัน — ผู้ใช้ด้านบน, ตามด้วยซอฟต์แวร์แอปพลิเคชัน, ระบบปฏิบัติการ, และฮาร์ดแวร์ด้านล่างสุด
ระบบปฏิบัติการอยู่ระหว่างฮาร์ดแวร์และซอฟต์แวร์แอปพลิเคชันและผู้ใช้งาน ให้พวกเขาทำงานร่วมกันได้

OS มีหลายหน้าที่:

  • การจัดการไฟล์ — บันทึก เปิด ตั้งชื่อ ย้าย และลบไฟล์;
  • การจัดการสัญญาณรบกวน (interrupts) (ดูด้านล่าง)
  • การให้อินเทอร์เฟซผู้ใช้ เพื่อให้ผู้ใช้สามารถควบคุมคอมพิวเตอร์ได้;
  • การจัดการหน่วยความจำ — การตัดสินใจว่าอะไรจะถูกเก็บไว้ใน RAM และอยู่ที่ใด;
  • จัดการอุปกรณ์ต่อพ่วง และไดรเวอร์ของ它們 — ควบคุมอุปกรณ์เช่นเครื่องพิมพ์;
  • จัดการการทำงานหลายอย่างพร้อมกัน — ให้โปรแกรมหลายตัวทำงานได้พร้อมกัน;
  • การให้แพลตฟอร์ม สำหรับรันซอฟต์แวร์แอปพลิเคชัน;
  • การจัดการความปลอดภัย — บัญชีผู้ใช้ รหัสผ่าน และสิทธิ์การเข้าถึง
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
interrupt/ˈɪntərʌpt/ interrupt
4.1

Interrupts

English

An interrupt 中断 is a signal sent to the processor 处理器 to tell it that something needs attention now.

An interrupt can come from three sources:

  • hardware — for example a key is pressed, or a printer runs out of paper;
  • software — for example a program tries to divide by zero;
  • the user — for example the user presses a "cancel" key.

When an interrupt arrives, the processor stops what it is doing, saves its place, and services (deals with) the interrupt. When that is done, it goes back to what it was doing before. This lets the computer react quickly to important events.

ไทย

การขัดจังหวะ (interrupt) คือสัญญาณที่ส่งไปยัง หน่วยประมวลผลกลาง (processor) เพื่อบอกว่ามันมีบางสิ่งที่ต้องรับความสนใจทันที

การขัดจังหวะสามารถมาจากสามแหล่ง:

  • ฮาร์ดแวร์ — ตัวอย่างเช่นมีการกดคีย์ หรือเครื่องพิมพ์หมดกระดาษ;
  • ซอฟต์แวร์ — ตัวอย่างเช่นโปรแกรมพยายามหารด้วยศูนย์;
  • ผู้ใช้ — ตัวอย่างเช่นผู้ใช้อ กดปุ่ม "ยกเลิก"

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

วงจร: โปรแกรมหลักกำลังทำงาน จากนั้นเมื่อเกิดการขัดจังหวะ CPU จะบันทึกสถานะ, รัน routine การจัดการขัดจังหวะ, ฟื้นฟูสถานะและดำเนินต่อ
เมื่อเกิดการขัดจังหวะ CPU จะบันทึกตำแหน่ง, รัน routine การจัดการขัดจังหวะ, แล้วฟื้นฟูตำแหน่งและดำเนินต่อไป
Explore · ⁨สำรวจ⁩

How the CPU handles an interrupt · ⁨วิธีที่ CPU จัดการกับอินเทอร์รัปต์⁩

Step through an interrupt. The CPU pauses what it's doing, deals with the urgent event, then carries on exactly where it left off — which is how one processor juggles the keyboard, printer and timer at once. · ⁨ขั้นตอนการจัดการอินเทอร์รัปต์: CPU หยุดสิ่งที่กำลังทำไว้ชั่วคราว, แก้ไขเหตุการณ์เร่งด่วน, แล้วดำเนินต่อไปจากจุดที่หยุดไว้ — นี่คือวิธีที่โปรเซสเซอร์เดียวจัดการคีย์บอร์ด พริ้นเตอร์ และนาฬิกาไปพร้อมกัน⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
processor/ˈprəʊsesə/ หน่วยประมวลผล
central processing unit/ˈsentrəl ˈprəʊsesɪŋ ˈjuːnɪt/ หน่วยประมวลผลกลาง
programming language/ˈprəʊɡræmɪŋ ˈlæŋɡwɪdʒ/ ภาษาโปรแกรม
high-level language/haɪ ˈlevl ˈlæŋɡwɪdʒ/ ภาษาโปรแกรมระดับสูง
low-level language/ləʊ ˈlevl ˈlæŋɡwɪdʒ/ ภาษาระดับต่ำ
4.2

Programming languages · ⁨ภาษาการเขียนโปรแกรม⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
1 Explain what is meant by a high-level language and a low-level language, including the advantages and disadvantages of each • Advantages and disadvantages include: – ease of reading and writing code, e.g. low-level is hard to read – ease of debugging code – machine independence – direct manipulation of hardware
2 Understand that assembly language is a form of low-level language that uses mnemonics, and that an assembler is needed to translate an assembly language program into machine code
3 Describe the operation of a compiler and an interpreter, including how high-level language is translated by each and how errors are reported • A compiler translates the whole code at once before executing it, producing an executable file • An interpreter translates and executes the code line-by-line • A compiler provides an error report for the whole code if errors are detected • An interpreter stops execution when an error is found
4 Explain the advantages and disadvantages of a compiler and an interpreter • Including an understanding that an interpreter is mostly used when developing a program and a compiler is used to translate the final program
5 Explain the role of an IDE in writing program code and the common functions IDEs provide • Including: – code editors – run-time environment – translators – error diagnostics – auto-completion – auto-correction – prettyprint
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
1 อธิบายความหมายของ ภาษาสูง (high-level language) และ ภาษาต่ำ (low-level language) รวมถึงข้อดีและข้อเสียของแต่ละภาษา • ข้อดีและข้อเสียประกอบด้วย: – ความง่ายในการอ่านและเขียนโค้ด เช่น ภาษาต่ำอ่านยาก – ความง่ายในการแก้ไขข้อผิดพลาดในโค้ด – การไม่ขึ้นกับเครื่อง – การควบคุมฮาร์ดแวร์โดยตรง
2 เข้าใจว่า ภาษาแอสsemblี (assembly language) เป็นรูปแบบหนึ่งของภาษาต่ำที่ใช้คำย่อ (mnemonics), และจำเป็นต้องใช้ แอสsembler (assembler) เพื่อแปลงโปรแกรมภาษาแอสsemblีให้เป็น รหัสเครื่อง (machine code)
3 อธิบายการทำงานของ คอมไพล์ (compiler) และ อินเทอร์พรีเตอร์ (interpreter) รวมถึงวิธีการที่ภาษาสูงถูกแปลงโดยแต่ละตัวและการรายงานข้อผิดพลาด • คอมไพล์จะแปลงโค้ดทั้งหมดก่อนนำไปรัน สร้างไฟล์ที่รันได้ • อินเทอร์พรีเตอร์จะแปลงและรันโค้ดทีละบรรทัด • คอมไพล์จะรายงานรายการข้อผิดพลาดสำหรับโค้ดทั้งหมดหากพบข้อผิดพลาด • อินเทอร์พรีเตอร์จะหยุดการทำงานเมื่อพบข้อผิดพลาด
4 อธิบายข้อดีและข้อเสียของคอมไพล์และอินเทอร์พรีเตอร์ • รวมถึงความเข้าใจที่ว่าอินเทอร์พรีเตอร์มักใช้ในการพัฒนาโปรแกรม และคอมไพล์用於แปลงโปรแกรมสุดท้าย
5 อธิบายบทบาทของ IDE ในการเขียนโค้ดโปรแกรมและฟังก์ชันทั่วไปที่ IDE ให้มา • รวมถึง: – เครื่องมือแก้ไขโค้ด – สภาพแวดล้อมรัน-time – ตัวแปลภาษา – การวินิจฉัยข้อผิดพลาด – การเติมคำอัตโนมัติ – การแก้ไขอัตโนมัติ – การจัดรูปแบบโค้ดให้อ่านง่าย (prettyprint)

Source: Cambridge International syllabus · ⁨แหล่งที่มา: หลักสูตร Cambridge International⁩

English

All computers process data using the central processing unit 中央处理器 (CPU). To make the CPU do work, people write programs in a programming language 编程语言. There are two kinds.

High-level languages

A high-level language 高级语言 is written in words that look a bit like English (for example Python). It is:

  • easy for people to read, write and fix;
  • independent of the computer — the same program can run on different types of computer.

Low-level languages

A low-level language 低级语言 is close to what the hardware actually uses. It includes:

  • machine code 机器码 — instructions written in binary (0s and 1s), which the CPU runs directly;
  • assembly language 汇编语言 — machine code written with short word codes (mnemonics) instead of binary.

A low-level language relates to the specific 特定的 type of CPU, so a program written for one CPU may not run on another. It is used when the programmer needs full control of the hardware or very fast, small code.

ไทย

คอมพิวเตอร์ทั้งหมดประมวลผลข้อมูลโดยใช้ หน่วยประมวลผลกลาง (CPU) เพื่อทำให้ CPU ทำงาน ผู้คนจึงเขียน โปรแกรม ใน ภาษาการเขียนโปรแกรม มีสองประเภท

ภาษาระดับสูง

ภาษาระดับสูง เขียนด้วยคำที่ดูคล้ายภาษาอังกฤษ (เช่น Python)具有以下特点:它是:

  • ง่าย สำหรับคนอ่าน เขียน และแก้ไข;
  • ไม่ขึ้นกับคอมพิวเตอร์ — โปรแกรมเดียวกันสามารถรันบนคอมพิวเตอร์ประเภทต่างๆ ได้

ภาษาระดับต่ำ

ภาษาระดับต่ำ ใกล้เคียงกับสิ่งที่ฮาร์ดแวร์ใช้งานจริง ประกอบด้วย:

  • รหัสเครื่อง (machine code) — คำสั่งที่เขียนในรูปแบบไบนารี (0 และ 1) ซึ่ง CPU รันโดยตรง;
  • ภาษาแอสsembly (assembly language) — รหัสเครื่องที่เขียนด้วยรหัสคำสั้นๆ (mnemonics) แทนไบนารี

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

สามชั้นซ้อนกัน: ภาษาระดับสูงอยู่บนสุด, ตามด้วยแอสsembly, และรหัสเครื่องอยู่ล่างสุด
ภาษาระดับสูงใกล้เคียงกับภาษามนุษย์และรันได้ทุกคอมพิวเตอร์; ภาษาระดับต่ำ (แอสsembly และรหัสเครื่อง) ใกล้เคียงกับฮาร์ดแวร์และผูกติดกับ CPU ประเภทหนึ่ง
Explore · ⁨สำรวจ⁩

Computing concept lab · ⁨ห้องปฏิบัติการแนวคิดการคำนวณ⁩

Classify concrete examples by the computing idea they demonstrate. · ⁨จัดกลุ่มตัวอย่างที่เป็นรูปธรรมตาม idea การคำนวณที่แสดงออก⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
machine code/məˈʃiːn kəʊd/ เครื่องมิกซ์โค้ด (machine code)
assembly language/əˈsemblɪ ˈlæŋɡwɪdʒ/ Assembly Language
specific/spəˈsɪfɪk/ เฉพาะเจาะจง
4.2

Translators · ⁨โปรแกรมแปลภาษา (Translators)⁩

English

The CPU can only run machine code. A high-level program must first be changed into machine code. The software that does this is a translator 翻译程序. There are three types: a compiler and an interpreter (for high-level code), and an assembler (for low-level code).

Compiler

A compiler translates the whole program into machine code before it is run. After translating, the machine code can be run many times without translating again.

  • translation happens once, in full;
  • it reports all the errors together, at the end of translating;
  • the finished program runs fast and does not need the compiler to run.

Interpreter

An interpreter 解释器 translates and runs the program one line at a time.

  • it stops at the first error it finds, which helps when testing;
  • the program runs more slowly, because it is translated each time it runs;
  • the interpreter must be present every time the program runs.
Compiler Interpreter
Translates the whole program at once one line at a time
Errors all reported at the end stops at the first error
Speed of finished program faster slower
Needed to run later? no yes

Use a compiler when you want to share a fast, finished program. Use an interpreter when you are writing and testing a program and want to find errors easily.

Assembler

An assembler 汇编器 translates a low-level assembly-language program (written in mnemonics such as LDA, ADD) into machine code. Each mnemonic becomes one machine instruction – a direct one-to-one translation, unlike a compiler or interpreter, which work on high-level code.

Worked example. A team is writing a program. While developing it they want to find and fix errors quickly; when they ship it they want customers to run it fast without seeing the source code. Which translator suits each stage? While developing, use an interpreter: it translates and runs one line at a time and stops at the first error, so a mistake is easy to locate. To ship, use a compiler: it translates the whole program once into machine code, which then runs quickly with no translator present, and the customer receives only the executable rather than the source. The two are not rivals - name the stage and give the reason, because "a compiler is faster" on its own earns nothing.

ไทย

CPU สามารถรันได้เพียงรหัสเครื่องเท่านั้น โปรแกรมระดับสูงต้องถูกแปลงเป็นรหัสเครื่องก่อน ซอฟต์แวร์ที่ทำสิ่งนี้เรียกว่า โปรแกรมแปลภาษา (translator) มีสามประเภท: คอมไพเลอร์และอินเทอร์interpreter (สำหรับโค้ดระดับสูง) และแอสsembler (สำหรับโค้ดระดับต่ำ)

Compiler

คอมไพเลอร์ แปล ทั้ง โปรแกรมเป็นรหัสเครื่อง ก่อน ที่จะรัน หลังจากแปลแล้ว รหัสเครื่องสามารถรันได้หลายครั้งโดยไม่ต้องแปลซ้ำ

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

อินเทอร์พรีเตอร์

อินเทอร์ interpreter แปลและรันโปรแกรม ทีละบรรทัด

  • มันหยุดที่ ข้อผิดพลาดแรก ที่พบ ซึ่งช่วยในการทดสอบ;
  • โปรแกรมรันช้ากว่า เพราะมันถูกแปลทุกครั้งที่รัน;
  • อินเทอร์ interpreter ต้องมีอยู่ทุกครั้งเมื่อโปรแกรมรัน
คอมไพเลอร์ อินเทอร์พรีเตอร์
แปลงภาษา ทั้งโปรแกรมพร้อมกัน บรรทัดต่อบรรทัด
ข้อผิดพลาด รายงานทั้งหมดเมื่อจบ หยุดที่ข้อผิดพลาดแรก
ความเร็วของโปรแกรมที่แปลแล้ว เร็วกว่า ช้ากว่า
จำเป็นต้องใช้ในการรันในอนาคต? ไม่ ใช่

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

Assembler

แอสsembler แปลโปรแกรม ภาษาแอสsembly ระดับต่ำ (เขียนด้วย mnemonics เช่น LDA, ADD) เป็นรหัสเครื่อง Mnemonic แต่ละตัวกลายเป็น คำสั่งเครื่องหนึ่ง — การแปลแบบหนึ่งต่อหนึ่งโดยตรง ต่างจากคอมไพเลอร์หรืออินเทอร์ interpreter ที่ทำงานบนโค้ดระดับสูง

คอมไพเลอร์แปลทั้งโปรแกรมครั้งเดียวเป็นรหัสเครื่องที่รันได้หลายครั้ง เทียบกับอินเทอร์ interpreter ที่แปลและรันทีละบรรทัด
คอมไพเลอร์แปลทั้งโปรแกรมครั้งเดียวเป็นรหัสเครื่อง; อินเทอร์ interpreter แปลและรันทีละบรรทัด

ตัวอย่างที่คำนวณแล้ว. ทีมหนึ่งกำลังเขียนโปรแกรม ขณะพัฒนาพวกเขาต้องการหาและแก้ไขข้อผิดพลาดอย่างรวดเร็ว; เมื่อส่งมอบลูกค้าต้องการรันได้เร็วโดยไม่เห็นโค้ดต้นทาง โปรแกรมแปล nàoเหมาะสำหรับแต่ละขั้นตอน? ระหว่างการพัฒนา ใช้ อินเทอร์ interpreter: มันแปลและรันทีละบรรทัดและหยุดที่ข้อผิดพลาดแรก ทำให้errors Locate ผิดพลาดได้ง่าย ส่งมอบ ใช้ คอมไพเลอร์: มันแปลทั้งโปรแกรมครั้งเดียวเป็นรหัสเครื่องซึ่งรันได้เร็วโดยไม่มีโปรแกรมแปลอยู่ และลูกค้าได้รับเพียงไฟล์ اجرا executable แทนโค้ดต้นทาง ทั้งสองไม่ใช่คู่แข่ง - ระบุ ขั้นตอน และให้เหตุผล เพราะการตอบแค่ว่า "คอมไพเลอร์เร็วกว่า" โดยไม่ระบุขั้นตอนจะไม่ได้รับคะแนน

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
translator/trænˈsleɪtə/ translator
interpreter/ɪnˈtɜːprɪtə/ interpreter
assembler/əˈsemblə/ assembler
integrated development environment/ˈɪntɪɡreɪtɪd dɪˈveləpmənt enˈvaɪrənmənt/ integrated development environment
4.2

Integrated development environment (IDE) · ⁨สภาพแวดล้อมการพัฒนาแบบบูรณาการ (IDE)⁩

English

An integrated development environment 集成开发环境 (IDE) is software that helps you write programs. It puts many useful tools in one place:

  • a code editor 代码编辑器 — for typing in your program;
  • a run time environment 运行时环境 — for running the program to test it;
  • a translator — a compiler or interpreter to turn your code into machine code;
  • error diagnostics 错误诊断 — messages that help you find and understand mistakes;
  • auto-completion 自动补全 and auto-correction 自动纠错 — the IDE finishes or fixes code as you type;
  • prettyprinting 美化打印 — laying out the code neatly with colour and indentation so it is easy to read.
ไทย

สภาพแวดล้อมการพัฒนาแบบบูรณาการ (IDE) คือซอฟต์แวร์ที่ช่วยคุณเขียนโปรแกรม它将许多有用的工具放在一个地方:

  • ตัวแก้ไขโค้ด (code editor) — สำหรับพิมพ์โปรแกรมของคุณ;
  • สภาพแวดล้อมการรัน (run time environment) — สำหรับรันโปรแกรมเพื่อทดสอบ;
  • โปรแกรมแปลภาษา — คอมไพเลอร์หรืออินเทอร์ interpreter เพื่อแปลงโค้ดของคุณเป็นรหัสเครื่อง;
  • การวินิจฉัยข้อผิดพลาด (error diagnostics) — ข้อความที่ช่วยให้คุณค้นหาและเข้าใจความผิดพลาด;
  • การเติมอัตโนมัติ (auto-completion) และ การแก้ไขอัตโนมัติ (auto-correction) — IDE เติมหรือแก้ไขโค้ดขณะคุณพิมพ์;
  • prettyprinting — การจัดรูปแบบโค้ดให้เรียบร้อยด้วยสีและระยะย่อเพื่อให้อ่านง่าย
ซอร์สโค้ดในโปรแกรมแก้ไข: IDE รวมเครื่องมือแก้ไข, ดีบักเกอร์ และเครื่องมือรันไว้ในที่เดียว
ซอร์สโค้ดในโปรแกรมแก้ไข: IDE รวมเครื่องมือแก้ไข, ดีบักเกอร์ และเครื่องมือรันไว้ในที่เดียว
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
code editor/kəʊd ˈedɪtə/ ตัวแก้ไขโค้ด
run time environment/rʌn taɪm enˈvaɪrənmənt/ สภาพแวดล้อมการรัน
error diagnostics/ˈerə ˌdaɪəɡˈnɒstɪks/ การวินิจฉัยข้อผิดพลาด
auto-completion/ˈɔːtəʊ kəmˈpliːʃn/ การเติมเต็มอัตโนมัติ
auto-correction/ˈɔːtəʊ kəˈrekʃn/ การแก้ไขอัตโนมัติ
prettyprinting/ˈpretɪprɪntɪŋ/ การจัดรูปแบบที่สวยงาม
user interface/ˈjuːzə ˈɪntəfeɪs/ อินเทอร์เฟซผู้ใช้
peripherals/pəˈrɪfərəlz/ อุปกรณ์ต่อพ่วง
multitasking/ˈmʌltitæskɪŋ/ การทำงานหลายอย่างพร้อมกัน
platform/ˈplætfɔːm/ แพลตฟอร์ม
4.2

Exam tips · ⁨ข้อแนะนำสำหรับการสอบ⁩

English
  • Hardware is the physical parts; software is the programs. System software runs the computer (OS, drivers, utilities); application software does a task for the user.
  • A compiler translates the whole program at once (the finished program runs fast, and all errors are reported at the end); an interpreter translates line by line (it stops at the first error, runs slower, and is needed every time).
  • High-level languages are close to English and run on any computer; low-level languages (assembly, machine code) are tied to one type of CPU.
  • An interrupt is a signal that makes the CPU stop, save its place, service the event, then carry on where it left off.
  • Learn the operating system's roles: managing files, memory, peripherals, multitasking, security and the user interface.
ไทย
  • Hardware คือส่วนประกอบทางกายภาพ; software คือโปรแกรม System software ทำงานกับคอมพิวเตอร์ (OS, drivers, utilities); application software ทำหน้าที่สำหรับผู้ใช้
  • Compiler แปลงทั้งโปรแกรมพร้อมกัน (โปรแกรมที่เสร็จแล้วทำงานเร็ว และรายงานข้อผิดพลาดทั้งหมดในที่สุด); interpreter แปลงบรรทัดต่อบรรทัด (หยุดเมื่อเจอข้อผิดพลาดแรก ทำงานช้ากว่า และต้องใช้ทุกครั้ง)
  • ภาษา High-level ใกล้เคียงภาษาอังกฤษและรันได้บนทุกคอมพิวเตอร์; low-level languages (assembly, machine code) เชื่อมโยงกับ CPU แบบใดแบบหนึ่งเท่านั้น
  • Interrupt คือสัญญาณที่ทำให้ CPU หยุดบันทึกตำแหน่งปัจจุบัน รับมือกับเหตุการณ์ แล้วดำเนินต่อจากจุดที่ยังไม่จบ
  • เรียนรู้บทบาทของระบบปฏิบัติการ: การจัดการไฟล์ ความจำ อุปกรณ์เสริม การทำงานหลายอย่างพร้อมกัน ความปลอดภัย และอินเทอร์เฟซผู้ใช้
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
System software/ˈsɪstəm ˈsɒftweə/ ซอฟต์แวร์ระบบ

Interactive lessons on this topic · ⁨บทเรียนเชิงโต้ตอบสำหรับหัวข้อนี้⁩

Work through it step by step, with instant-check exercises. · ⁨ทำทีละขั้นตอน พร้อมแบบฝึกหัดตรวจสอบผลทันที⁩

Past Papers · ⁨ข้อสอบย้อนหลัง⁩

More topics in IGCSE Computer Science · ⁨Computer Science IGCSE⁩ · ⁨หัวข้อเพิ่มเติมใน IGCSE Computer Science · ⁨Computer Science IGCSE⁩⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP