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

Hardware and Virtual Machines · ⁨ฮาร์ดแวร์และเครื่องเสมือน (Virtual Machines)⁩

A-Level Computer Science · ⁨Computer Science A-Level⁩ · Topic 15 · ⁨หัวข้อ 15⁩

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

RISC, Pipelines & Logic

นักออกแบบชิปสองคนเผชิญปัญหาเดียวกัน: ทำให้โปรแกรมทำงานเร็ว คนหนึ่งบอกว่า — สร้างคำสั่งทรงพลัง เพื่อให้แต่ละคำสั่งทำงานได้มาก คนอื่นบอกว่า — รักษา…

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

15.1

RISC vs CISC processors · ⁨โปรเซสเซอร์ RISC เทียบกับ CISC⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
Show understanding of Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) processors Differences between RISC and CISC Understand interrupt handling on CISC and RISC processors
Show understanding of the importance/use of pipelining and registers in RISC processors
Show understanding of the four basic computer architectures SISD, SIMD, MISD, MIMD
Show understanding of the characteristics of massively parallel computers
Show understanding of the concept of a virtual machine Give examples of the role of virtual machines Understand the benefits and limitations of virtual machines
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
แสดงความเข้าใจ关于 คอมพิวเตอร์ RISC (Reduced Instruction Set Computers) และ คอมพิวเตอร์ CISC (Complex Instruction Set Computers) ความแตกต่างระหว่าง RISC และ CISC เข้าใจการจัดการสัญญาณรบกวน (interrupt handling) บนโปรเซสเซอร์ CISC และ RISC
แสดงความเข้าใจ关于ความสำคัญ/การใช้งานของ pipelining และ รีจิสเตอร์ ในโปรเซสเซอร์ RISC
แสดงความเข้าใจเกี่ยวกับสถาปัตยกรรมคอมพิวเตอร์พื้นฐานทั้งสี่ SISD, SIMD, MISD, MIMD
แสดงความเข้าใจเกี่ยวกับลักษณะของ คอมพิวเตอร์แบบขนานระดับสูง
แสดงความเข้าใจเกี่ยวกับแนวคิดของ เครื่องเสมือน (virtual machine) ให้ตัวอย่างบทบาทของ เครื่องเสมือน เข้าใจข้อดีและข้อจำกัดของ เครื่องเสมือน

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

English

Two styles of CPU design. The CPU itself plugs into the motherboard 主板, the main board that links the processor, the memory and every other part of the computer together.

CISC

A CISC 复杂指令集 (Complex Instruction Set Computers) has many, often complex instructions (one may do several memory accesses and operations), of variable length, so decoding is intricate. It does more per instruction in hardware. Examples: Intel x86.

RISC

A RISC 精简指令集 (Reduced Instruction Set Computers) has a small set of simple instructions, each doing one basic operation, all of fixed length (fast to decode). Only load and store touch memory; everything else is register 寄存器 to register. Programs are longer but each instruction is quick and predictable, which suits pipelining. Examples: ARM, RISC-V.

Feature CISC RISC
Instruction set many few
Instruction length variable fixed
Memory access many instructions only load/store
Pipeline-friendly harder naturally
Per-instruction cycles varies usually 1

The trade-off is doing more per instruction (CISC) vs doing each instruction faster and more predictably (RISC). Modern Intel chips translate CISC instructions into simpler RISC-like micro-ops internally.

"Identify four features of a RISC processor." Any four of: a small set of simple instructions; instructions of fixed length (one word); most instructions complete in one clock cycle; many general-purpose registers; only load and store instructions access memory (all arithmetic is register to register); hard-wired control (no microcode); designed for pipelining; the compiler does more of the work, so programs contain more instructions and need more memory. "Identify four features of a CISC processor." Any four of: a large set of instructions, many of them complex (one instruction may do several operations); instructions of variable length; instructions that take several clock cycles; fewer registers; instructions that can access memory directly; microprogrammed control; less suited to pipelining; shorter programs, so a simpler compiler and less memory. "Describe what is meant by RISC and CISC" (two marks each): name the expansion and give the defining idea (few simple single-cycle instructions; many complex multi-cycle instructions).

Interrupt handling on the two designs. On a CISC processor the current instruction, however complex, is completed before the interrupt is serviced; the processor then saves the contents of its registers (including the program counter) on the stack, jumps to the interrupt service routine, and restores the registers afterwards. On a RISC processor with a pipeline, several instructions are part-way through at the moment the interrupt 中断 arrives, so the processor must either let every instruction in the pipeline finish, or discard (flush) the partly executed instructions and restart them after the interrupt; either way the pipeline is emptied, the registers are saved, and the service routine runs. The exam phrasing: "pipelining makes interrupt handling more complex, because the contents of the pipeline must be dealt with before the interrupt can be serviced".

ไทย

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

CISC มีคำสั่งซับซ้อนหลายแบบที่มีความยาวไม่คงที่; RISC มีคำสั่งเรียบง่ายไม่กี่แบบที่มีความยาวคงที่
CISC มีคำสั่งซับซ้อนจำนวนมาก; RISC มีคำสั่งเรียบง่ายเพียงเล็กน้อย

เมนบอร์ดคอมพิวเตอร์บนพื้นหลังสีขาว แสดงซ็อกเก็ต CPU แบบสี่เหลี่ยมตรงกลาง ช่องเสียบหน่วยความจำที่ยาวหลายช่อง ช่องขยายหลายช่อง และแถวพอร์ต I/O ตามขอบด้านหนึ่ง *เมนบอร์ดเชื่อมต่อกับ CPU หน่วยความจำและส่วนประกอบอื่นๆ เข้าด้วยกัน

CISC

CISC (Complex Instruction Set Computers) มี คำสั่งมากมาย มักจะซับซ้อน (คำสั่งหนึ่งอาจทำการเข้าถึงหน่วยความจำและการดำเนินการได้หลายครั้ง) มีความ ยาวไม่คงที่ ทำให้การถอดรหัสมีความซับซ้อน ทำได้มากกว่าต่อหนึ่งคำสั่งผ่านฮาร์ดแวร์ ตัวอย่าง: Intel x86

RISC

RISC (Reduced Instruction Set Computers) มี ชุดคำสั่งน้อยแต่เรียบง่าย แต่ละคำสั่งทำงานพื้นฐานเพียงอย่างหนึ่ง มีความ ยาวคงที่ (ถอดรหัสได้เร็ว) มีเพียงคำสั่ง โหลด และ จัดเก็บ เท่านั้นที่เข้าถึงหน่วยความจำ ส่วนที่เหลือเป็น รีจิสเตอร์ กับ รีจิสเตอร์ โปรแกรมมีขนาดใหญ่ขึ้นแต่แต่ละคำสั่งรวดเร็วและคาดการณ์ได้ เหมาะกับการทำ Pipelining ตัวอย่าง: ARM, RISC-V

คุณสมบัติ CISC RISC
ชุดคำสั่ง มาก น้อย
ความยาวคำสั่ง ไม่คงที่ คงที่
การเข้าถึงหน่วยความจำ คำสั่งมากมาย เฉพาะโหลด/จัดเก็บ
เหมาะกับ Pipeline ยาก โดยธรรมชาติ
วัฏจักรต่อคำสั่ง เปลี่ยนแปลง ปกติ 1

ข้อแลกเปลี่ยนคือการทำ ได้มากกว่าต่อหนึ่งคำสั่ง (CISC) เทียบกับการทำแต่ละคำสั่ง เร็วและคาดการณ์ได้มากขึ้น (RISC) ชิป Intel รุ่นใหม่แปลคำสั่ง CISC เป็น micro-ops ที่เรียบง่ายคล้าย RISC ภายใน

"ระบุคุณสมบัติของโปรเซสเซอร์ RISC จำนวนสี่ประการ" สี่ประการใดก็ได้จาก: ชุดคำสั่งน้อย แต่ เรียบง่าย; คำสั่งมีความ ยาวคงที่ (หนึ่งคำ); คำสั่งส่วนใหญ่เสร็จสิ้นใน หนึ่งวัฏจักรนาฬิกา; มี รีจิสเตอร์ ใช้งานทั่วไป จำนวนมาก; มีเพียงคำสั่ง โหลดและจัดเก็บ เท่านั้นที่เข้าถึงหน่วยความจำ (การคำนวณทางคณิตศาสตร์ทั้งหมดระหว่างรีจิสเตอร์กับรีจิสเตอร์); ระบบควบคุมแบบ ฮาร์ดไวร์ด (ไม่มีไมโครโค้ด); ออกแบบมาเพื่อ Pipelining; คอมไพเลอร์ ทำงานมากขึ้น ดังนั้นโปรแกรมจึงมีคำสั่งมากและใช้หน่วยความจำมากขึ้น "ระบุคุณสมบัติของโปรเซสเซอร์ CISC จำนวนสี่ประการ" สี่ประการใดก็ได้จาก: ชุดคำสั่งใหญ่ หลายคำสั่ง ซับซ้อน (คำสั่งหนึ่งอาจทำได้หลายการดำเนินการ); คำสั่งมีความ ยาวไม่คงที่; คำสั่งที่ใช้เวลา หลายวัฏจักร; มี รีจิสเตอร์ น้อยกว่า; คำสั่งสามารถ เข้าถึงหน่วยความจำโดยตรง; ระบบควบคุมแบบ ไมโครโปรแกรม(); ไม่เหมาะเท่าสำหรับ Pipelining; โปรแกรมสั้นลง ดังนั้นคอมไพเลอร์จึงง่ายและใช้หน่วยความจำน้อยลง "อธิบายความหมายของ RISC และ CISC" (คะแนนละสอง): ชื่อคำย่อและแนวคิดกำหนดลักษณะ (คำสั่ง đơnวัฏจักรเรียบง่ายจำนวนน้อย; คำสั่งหลายวัฏจักรซับซ้อนจำนวนมาก)

การจัดการ Interrupt ในทั้งสองสถาปัตยกรรม บนโปรเซสเซอร์ CISC คำสั่งปัจจุบันไม่ว่าจะซับซ้อนแค่ไหนจะ เสร็จสมบูรณ์ ก่อนที่จะจัดการ Interrupt โปรเซสเซอร์จะบันทึกเนื้อหาในรีจิสเตอร์ (รวม Program Counter) ลงบน Stack แล้ว跳转ไปยัง Service Routine และคืนค่ารีจิสเตอร์หลังจากนั้น บนโปรเซสเซอร์ RISC ที่มี Pipeline คำสั่งหลายตัวกำลังดำเนินการอยู่ครึ่งทางเมื่อ Interrupt arrival มาถึง โปรเซสเซอร์จึงต้องให้ทุกคำสั่งใน Pipeline เสร็จสิ้น หรือ ทิ้ง (flush) คำสั่งที่ดำเนินการไปแล้วบางส่วนแล้วเริ่มใหม่หลังจัดการ Interrupt ไม่ว่ากรณีใด Pipeline จะว่างเปล่า รีจิสเตอร์จะถูกบันทึก และ Service Routine จะทำงาน รูปแบบคำถามสอบ: "Pipelining ทำให้การจัดการ Interrupt ซับซ้อนขึ้น เพราะเนื้อหาใน Pipeline ต้องได้รับการจัดการก่อนที่ Interrupt จะสามารถบริการได้"

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
motherboard/ˈmʌðəbɔːd/ เมนบอร์ด
CISC/sɪsk/ CISC
RISC/rɪsk/ RISC
interrupt/ˈɪntərʌpt/ interrupt
pipeline/ˈpaɪplaɪn/ พิพไลน์
15.1

Pipelining

English

A pipeline 流水线 processes instructions in overlapping stages, like an assembly line: Fetch → Decode → Execute (in the ALU 算术逻辑单元) → Memory access → Write back. Each stage works on a different instruction at once, so once the pipeline is full, one instruction completes per cycle. RISC's fixed-length, simple instructions make every stage take the same time. A pipeline can stall on a hazard 冒险 — a data hazard (an instruction needs a result not ready yet) or a control hazard (a branch makes the next address unknown).

RISC chips keep data in many registers because memory is slow and registers are fast; the compiler allocates values to registers wisely.

"Describe the use of pipelining in RISC processors" (three marks). (1) The fetch–execute cycle is divided into stages (fetch, decode, execute, memory access, write back); (2) several instructions are in the pipeline at once, each at a different stage, so while one is being executed the next is being decoded and the one after fetched; (3) a new instruction is started, and one completed, in every clock cycle once the pipeline is full, which increases throughput 吞吐量 (the number of instructions completed per second), although each instruction still takes the same time on its own. Fixed-length single-cycle RISC instructions are what make the stages equal and the pipeline possible.

Worked example. A processor uses five pipeline stages (IF, ID, OF, EX, WB). Four instructions enter the pipeline one after another. In which cycle does the last instruction complete, and how many cycles would the four take without pipelining?

Instruction 1 occupies IF in cycle 1, ID in 2, OF in 3, EX in 4 and WB in 5; instruction 2 starts one cycle later and finishes in cycle 6; instruction 3 in cycle 7; instruction 4 in cycle 8. In general $n$ instructions through $k$ stages take $n + k - 1$ cycles, here $4 + 5 - 1 = 8$. Without pipelining each instruction takes all five cycles before the next starts: $4 \times 5 = 20$ cycles. The exam's table is filled by writing each instruction's stages diagonally, one column to the right of the previous instruction.

A processor running this fast gives off a lot of heat, so a heat-sink 散热器 and fan sit on top of it. The metal fins spread the heat and the fan blows it away, keeping the CPU cool enough to work.

ไทย

Pipeline ประมวลผลคำสั่งใน ขั้นตอนที่ซ้อนทับกัน เหมือนสายการผลิต: ดึงข้อมูล → ถอดรหัส → ดำเนินการ (ใน ALU) → เข้าถึงหน่วยความจำ → เขียนกลับ แต่ละขั้นตอนทำงานกับคำสั่งที่แตกต่างกันพร้อมกัน ดังนั้นเมื่อ Pipeline เต็ม จะมี คำสั่งหนึ่งเสร็จสิ้นต่อวัฏจักร คำสั่งความยาวคงที่และเรียบง่ายของ RISC ทำให้ทุกขั้นตอนใช้เวลาเท่ากัน Pipeline อาจหยุดชะงักเมื่อเกิด Hazard — Data Hazard (คำสั่งต้องการผลลัพธ์ที่ยังไม่พร้อม) หรือ Control Hazard (Branch ทำให้ที่อยู่ถัดไปไม่ทราบ)

กราฟ Gantt ของ 5 ขั้นตอน pipeline IF, ID, EX, MEM, WB ตลอด 10 วัฏจักรนาฬิกา พร้อมคำสั่ง A ถึง F จำนวน 6 คำสั่งที่ถูกเลื่อนออกทีละวัฏจักรเพื่อซ้อนทับกันในแนวทแยง *Pipelining ซ้อนทับขั้นตอนของคำสั่งหกคำสั่ง ทำให้มีคำสั่งหนึ่งเสร็จสิ้นต่อวัฏจักร

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

"อธิบายการใช้ Pipelining ในโปรเซสเซอร์ RISC" (สามคะแนน) (1) วัฏจักรดึง-ดำเนินการถูกแบ่งออกเป็นขั้นตอน (ดึง, ถอดรหัส, ดำเนินการ, เข้าถึงหน่วยความจำ, เขียนกลับ); (2) คำสั่งหลายตัว อยู่ใน Pipeline พร้อมกัน แต่ละตัวอยู่ที่ ขั้นตอนต่างกัน ดังนั้นในขณะที่คำสั่งหนึ่งกำลังดำเนินการ คำสั่งถัดไปกำลังถูกถอดรหัส และคำสั่งถัดไปกำลังถูกดึง; (3) เมื่อ Pipeline เต็ม จะมีคำสั่งใหม่เริ่มต้นและคำสั่งหนึ่งเสร็จสิ้นใน ทุกวัฏจักรนาฬิกา ซึ่งเพิ่ม Throughput (จำนวนคำสั่งที่เสร็จสิ้นต่อวินาที) แม้แต่ละคำสั่งจะใช้เวลาเท่าเดิมเมื่อทำงานแยกต่างหาก คำสั่ง RISC ความยาวคงที่และหนึ่งวัฏจักรคือสิ่งที่ทำให้ขั้นตอนเท่ากันและทำให้ Pipeline เป็นไปได้

ตัวอย่างฝึกฝน โปรเซสเซอร์ใช้ 5 ขั้นตอน Pipeline (IF, ID, OF, EX, WB) คำสั่งสี่ตัวเข้าสู่ Pipeline ตามลำดับ คำสั่งสุดท้ายจะเสร็จสิ้นในวัฏจักรที่เท่าไหร่ และหากไม่มี Pipeline คำสั่งทั้งสี่จะใช้เวลากี่วัฏจักร?

คำสั่ง 1 เข้า IF ในรอบ 1, ID ใน 2, OF ใน 3, EX ใน 4 และ WB ใน 5; คำสั่ง 2 เริ่มช้าลงหนึ่งรอบและเสร็จสิ้นในรอบ 6; คำสั่ง 3 ในรอบ 7; คำสั่ง 4 ในรอบ 8. โดยทั่วไป คำสั่ง $n$ ผ่าน $k$ ขั้นตอน ใช้เวลา $n + k - 1$ รอบ ที่นี่คือ $4 + 5 - 1 = 8$. หากไม่มี Pipelining คำสั่งแต่ละตัวต้องใช้ทั้งห้ารอบก่อนคำสั่งถัดไปจะเริ่ม: $4 \times 5 = 20$ รอบ. ตารางในข้อสอบจะเติมได้โดยการเขียนขั้นตอนของแต่ละคำสั่งแบบทแยงมุม คอลัมน์ถัดไปทางขวาของคำสั่งก่อนหน้า

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

เครื่องทำความเย็น CPU แบบ Tower มีพัดลมสีดำด้านหน้า, สnown ของฟินโลหะระบายความร้อนสูงเรียงซ้อนกัน, และท่อทองแดงนำความร้อนวิ่งขึ้นมาจากฐานแบนที่สัมผัสกับโปรเซสเซอร์
ฮีตซิงก์และพัดลมของ CPU ทำหน้าที่พาความร้อนออกจากโปรเซสเซอร์
Explore · ⁨สำรวจ⁩

How pipelining fills up · ⁨การ ? เติมเต็ม⁩

Step through the clock cycles. Once the pipeline is full, a new instruction finishes every cycle — even though each one still takes several stages — because the stages of different instructions overlap. · ⁨ดูขั้นตอนรอบนาฬิกา: เมื่อ ? เต็มแล้ว คำสั่งใหม่จะเสร็จสิ้นทุก ๆ รอบนาฬิกา — แม้ว่าจะใช้เวลาหลายขั้นตอน — เนื่องจากขั้นตอนของคำสั่งที่ต่างกันซ้อนทับกัน⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
ALU/ˌeɪ el ˈjuː/ ALU
hazard/ˈhæzəd/ อันตราย
throughput/ˈθruːpʊt/ ปริมาณงานผ่าน
heat-sink/hiːt sɪŋk/ ฮีตซิงค์
Flynn's taxonomy/flɪnz tækˈsɒnəmi/ Classification ของ Flynn
15.1

Flynn's taxonomy · ⁨ทฤษฎีบทของแฟลนนี่⁩

English

Flynn's taxonomy 弗林分类 sorts computers by the number of instruction and data streams:

  • SISD — one instruction, one data stream (a traditional single core).
  • SIMD 单指令多数据 — one instruction works on many data items at once (GPUs, CPU vector extensions). Great for images, video, scientific arrays.
  • MISD — several operations on the same data; rare, mostly theoretical.
  • MIMD 多指令多数据 — many processors run different instructions on different data (multi-core CPUs, clusters). The most general.

Describing the four architectures (two marks each). SISD: a single processor executes one instruction at a time on one item of data; no parallelism, the traditional von Neumann machine. SIMD: one instruction is applied simultaneously to many data items, by many processing elements acting in step; used for array and graphics processing. MISD: several processors apply different instructions to the same data; rarely used, for example a fault-tolerant system where several processors check one stream. MIMD: many processors, each executing its own instructions on its own data, independently; the multi-core computer and the cluster.

A graphics card 显卡 (with its GPU) is a real example of SIMD hardware: it has thousands of small cores that run the same instruction on many pixels or numbers at once, which is why GPUs are so fast for images, video and machine learning.

ไทย

ทฤษฎีบทของแฟลนนี่ จัดกลุ่มคอมพิวเตอร์ตามจำนวนสตรีมคำสั่งและสตรีมข้อมูล:

  • SISD — สตรีมคำสั่งหนึ่ง สตรีมข้อมูลหนึ่ง (แกนเดียวแบบดั้งเดิม).
  • SIMD — สตรีมคำสั่งหนึ่งทำงานกับ ข้อมูลจำนวนมากพร้อมกัน (GPUs, การต่อขยายเวกเตอร์ของ CPU) เหมาะสำหรับภาพ วิดีโอ และ arreglo ทางวิทยาศาสตร์.
  • MISD — หลายการดำเนินการบนข้อมูลเดียวกัน; นادر, ส่วนใหญ่เป็นทฤษฎี.
  • MIMD —许多 processors ทำงาน คำสั่งที่แตกต่างกันบนข้อมูลที่ต่างกัน (CPU multi-core, clusters). เป็นรูปแบบที่กว้างที่สุด.

อธิบายสถาปัตยกรรมทั้งสี่ (ข้อละ 2 คะแนน). SISD: โปรเซสเซอร์เดียว รัน คำสั่งหนึ่งต่อครั้ง กับ ข้อมูลหนึ่งรายการ; ไม่มีการประมวลผลแบบขนาน, เครื่อง von Neumann แบบดั้งเดิม. SIMD: คำสั่งหนึ่ง ถูกนำไปใช้กับ ข้อมูลหลายรายการ พร้อมกัน โดยใช้หน่วยประมวลผลหลายหน่วยทำงานร่วมกัน; ใช้สำหรับการประมวลผล array และกราฟิก. MISD: หลายโปรเซสเซอร์ นำ คำสั่งที่แตกต่างกัน ไปใช้กับ ข้อมูลเดียวกัน; นادرใช้ เช่น ระบบทนต่อความผิดพลาดที่หลายโปรเซสเซอร์ตรวจสอบสตรีมเดียว. MIMD: หลายโปรเซสเซอร์, แต่ละตัวรัน คำสั่งของตัวเอง กับ ข้อมูลของตัวเอง อย่างอิสระ; คอมพิวเตอร์ multi-core และ cluster.

หน่วยควบคุมเดียวส่งสตรีมคำสั่งไปยังหน่วยประมวลผลสี่หน่วย โดยแต่ละหน่วยทำงานกับข้อมูลของตนเอง
SIMD: หลายโปรเซสเซอร์รันคำสั่งเดียวกันบนข้อมูลต่างกัน

การ์ดกราฟิก (ที่มี GPU) เป็นตัวอย่างจริงของฮาร์ดแวร์ SIMD: มันมีแกนเล็กๆ จำนวนนับพันที่รันคำสั่งเดียวกันกับพิกเซลหรือตัวเลขจำนวนมากพร้อมกัน นี่คือเหตุผลที่ GPUs เร็วมากสำหรับภาพ วิดีโอ และการเรียนรู้ของเครื่อง

การ์ดกราฟิกบนพื้นหลังสีขาว แสดงพัดลมระบายความร้อนขนาดใหญ่เหนือ GPU และขั้วต่อทองคำที่เสียบเข้ากับเมนบอร์ด
การ์ดจอ: GPU ของมันทำงานคำสั่งเดียวกันกับข้อมูลหลายรายการพร้อมกัน (SIMD)
โปรเซสเซอร์อิสระสี่ตัว แต่ละตัวรับสายการ指令จากด้านบนและข้อมูลแต่ละรายการจากด้านล่างแยกต่างหาก
MIMD: โปรเซสเซอร์แต่ละตัวทำงานด้วยคำสั่งของตัวเองบนข้อมูลของตัวเอง
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
SIMD/ˈsɪmdiː/ SIMD
MIMD/ˈmɪmdiː/ MIMD
graphics card/ˈɡræfɪks kɑːd/ การ์ดกราฟิก
massively parallel/ˈmæsɪvli ˈpærəlel/ แบบขนานมาก
distributed memory/ˈdɪstrɪbjuːtɪd ˈmeməri/ หน่วยความจำแบบกระจาย
15.1

Massively parallel computers · ⁨คอมพิวเตอร์แบบขนานระดับมหาศาล⁩

English

A massively parallel 大规模并行 system uses thousands of processors on a fast network, each with its own memory (distributed memory 分布式内存), exchanging data by messages. It is MIMD, needs specially-written software (MPI, CUDA), and suits climate simulation, large machine learning 机器学习 training, and astrophysics. The largest supercomputers 超级计算机 are massively parallel.

"Outline the characteristics of massively parallel computers" (three marks). A very large number of processors (thousands), each with its own memory, connected by a network (a high-speed interconnect or bus) so that they can pass messages to one another; they work simultaneously on parts of the same problem, so the problem must be written as a program that can be split into parts that run in parallel and combine their results. It is an MIMD arrangement.

The processors live in tall server 服务器 racks, often filling a whole room (a data centre 数据中心), wired together so they can work on one big problem at the same time.

ไทย

ระบบ แบบขนานระดับมหาศาล ใช้ โปรเซสเซอร์นับพันตัว บนเครือข่ายความเร็วสูง โดยแต่ละตัวมีหน่วยความจำของตนเอง (หน่วยความจำแบบกระจาย), แลกเปลี่ยนข้อมูลผ่านข้อความ มันเป็น MIMD ต้องใช้ซอฟต์แวร์ที่เขียนเฉพาะ (MPI, CUDA) เหมาะสำหรับการจำลองสภาพภูมิอากาศ การฝึกสอน machine learning ขนาดใหญ่ และดาราศาสตร์ ซูเปอร์คอมพิวเตอร์ ที่ใหญ่ที่สุดล้วนเป็นแบบขนานระดับมหาศาล

"อธิบายลักษณะของคอมพิวเตอร์แบบขนานระดับมหาศาล (สามคะแนน)." มี โปรเซสเซอร์จำนวนมากมาก (นับพันตัว), แต่ละตัวมีหน่วยความจำของตนเอง, เชื่อมต่อกันด้วย เครือข่าย (อินเตอร์คอนเนกต์ความเร็วสูงหรือบัส) เพื่อให้สามารถส่ง ข้อความ ถึงกันได้; ทำงาน พร้อมกัน กับส่วนต่างๆ ของ ปัญหาเดียวกัน ดังนั้นปัญหานั้นต้องถูกเขียนเป็นโปรแกรมที่สามารถแบ่งออกเป็นส่วนๆ ที่รันแบบขนานและรวมผลลัพธ์เข้าด้วยกัน เป็นโครงสร้างแบบ MIMD

โปรเซสเซอร์อยู่ในตู้ เซิร์ฟเวอร์ สูงๆ มักจะเต็มทั้งห้อง ( ศูนย์ข้อมูล), เชื่อมต่อสายกันเพื่อให้สามารถทำงานกับปัญหาใหญ่หนึ่ง问题时พร้อมกัน

แถวยาวของตู้เซิร์ฟเวอร์สีดำบนพื้นสีขาวยกสูงในศูนย์ข้อมูล อัดแน่นไปด้วยอุปกรณ์และสายเคเบิล
แถวเซิร์ฟเวอร์ในศูนย์ข้อมูล เหมือนกับที่ใช้สำหรับคอมพิวเตอร์แบบขนานระดับมหาศาล
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
machine learning/məˈʃiːn ˈlɜːnɪŋ/ การเรียนรู้ของเครื่อง
supercomputers/ˌsuːpəkəmˈpjuːtəz/ ซูเปอร์คอมพิวเตอร์
server/ˈsɜːvə/ เซิร์ฟเวอร์
data centre/ˈdeɪtə ˈsentə/ ศูนย์ข้อมูล
15.1

Virtual machines · ⁨เครื่องเสมือน⁩

English

A virtual machine 虚拟机 (VM) is a software emulation of a whole computer — the software inside sees a CPU, memory and disks that look real but are managed by host software.

  • a system VM runs a complete OS. A hypervisor 虚拟机监控器 creates and manages VMs, each booting its own guest OS. Uses: run different OSes on one machine; server consolidation; sandboxing 沙箱 (risky software runs isolated); snapshots.
  • a process (language) VM runs one program in portable bytecode 字节码 — the JVM (Java), the CLR (.NET), CPython. Benefits: portability ("write once, run anywhere"), runtime safety checks, and just-in-time compilation 即时编译 for near-native speed. The cost is an extra layer and needing the VM installed.

"Describe what is meant by a virtual machine" (two marks). A software emulation (implementation) of a computer system that runs on a host computer and behaves, to the programs running inside it, like a separate physical computer with its own processor, memory and storage. The host operating system 宿主操作系统 runs on the actual hardware, manages the real resources and (through the hypervisor) creates and controls the virtual machines; each guest operating system 客户操作系统 runs inside a virtual machine, manages the applications in it, and is unaware that its hardware is virtual.

Benefits (give two). Several different operating systems can run on one machine at the same time; software can be tested on many systems without buying the hardware; a new computer system can be emulated and tried before it is built; each VM is isolated, so a crash or malware in one does not affect the host or the others; VMs can be copied, moved and backed up as files, and a server can be shared between many users, reducing hardware cost. Limitations (give two). A VM runs more slowly than the real hardware because every instruction passes through the emulation layer; it consumes the host's memory and processing power, so the host must be powerful; some hardware features or devices are not emulated exactly, so the tested software may behave differently on the real machine; licences are needed for each guest OS, and setting the system up needs expertise.

ไทย

เครื่องเสมือน (VM) คือ การจำลองคอมพิวเตอร์ทั้งเครื่องด้วยซอฟต์แวร์ — ซอฟต์แวร์ด้านในเห็น CPU หน่วยความจำ และดิสก์ที่ดูเหมือนจริงแต่ถูกจัดการโดยซอฟต์แวร์โฮสต์

  • system VM รัน OS แบบสมบูรณ์ hypervisor สร้างและจัดการ VM แต่ละตัวบูต guest OS ของตัวเอง ใช้: รัน OS ต่างๆ บนเครื่องเดียว; รวมเซิร์ฟเวอร์; sandboxing (ซอฟต์แวร์เสี่ยง風險ทำงานแยก**;)**; สแนปช็อต
  • process (language) VM รันโปรแกรมหนึ่งด้วย bytecode ที่พกพาได้ — JVM (Java), CLR (.NET), CPython ประโยชน์: ความสามารถในการพกพา ("เขียนครั้งเดียว รันได้ทุกที่",) การตรวจสอบความปลอดภัยขณะรัน, และ just-in-time compilation เพื่อความเร็วใกล้เคียง native ค่าใช้จ่ายคือชั้นเพิ่มอีกชั้นหนึ่งและความจำเป็นต้องติดตั้ง VM
Stack ของเครื่องเสมือน: ฮาร์ดแวร์ทางกายภาพด้านล่าง, ระบบปฏิบัติการโฮสต์อยู่ข้างบน, ตามด้วย hypervisor, และด้านบนนั้นคือเครื่องเสมือนสามเครื่อง แต่ละเครื่องมี guest operating system พร้อมแอปพลิเคชันของตนเอง
คอมพิวเตอร์จริงหนึ่งเครื่อง, หลายเครื่อง apparent: ระบบปฏิบัติการโฮสต์และ hypervisor แบ่งปันฮาร์ดแวร์, และแต่ละ guest operating system รันราวกับว่ามีเครื่องของตัวเอง

"อธิบายความหมายของเครื่องเสมือน (virtual machine)" (2 คะแนน). โปรแกรมจำลองระบบคอมพิวเตอร์ที่ทำงานบนคอมพิวเตอร์โฮสต์ และ behaving กับโปรแกรมที่ทำงานอยู่ภายใน เหมือนกับคอมพิวเตอร์กายภาพแยกต่างหากที่มีหน่วยประมวลผล หน่วยความจำ และการจัดเก็บข้อมูลของตัวเอง ระบบปฏิบัติการ โฮสต์ ทำงานบนฮาร์ดแวร์จริง จัดการทรัพยากรจริงและ (ผ่าน hypervisor) สร้างและควบคุมเครื่องเสมือน; แต่ละ ระบบปฏิบัติการผู้ใช้งาน (guest) ทำงานอยู่ในเครื่องเสมือน จัดการแอปพลิเคชันในนั้น และไม่รู้ว่าฮาร์ดแวร์ของตนเป็นแบบเสมือน

ประโยชน์ (ยกตัวอย่างสองข้อ). ระบบปฏิบัติการหลายชนิดสามารถทำงานบนเครื่องเดียวได้ในเวลาเดียวกัน; ซอฟต์แวร์สามารถ ทดสอบ บนหลายระบบโดยไม่ต้องซื้อฮาร์ดแวร์; ระบบคอมพิวเตอร์ ใหม่ สามารถจำลองและทดลองได้ก่อนสร้าง;每台 VM เป็น แยกกัน (isolated), ดังนั้นความล้มเหลวหรือมัลแวร์ในเครื่องหนึ่งจะไม่กระทบต่อโฮสต์หรือเครื่องอื่น; VM สามารถ คัดลอก ย้าย และสำรองข้อมูล เป็นไฟล์ และเซิร์ฟเวอร์สามารถแชร์ให้ผู้ใช้หลายคนใช้共同, ลดค่าใช้จ่ายด้านฮาร์ดแวร์. ข้อจำกัด (ยกตัวอย่างสองข้อ). VM ทำงาน ช้ากว่า ฮาร์ดแวร์จริงเพราะทุกคำสั่งต้องผ่านชั้นจำลอง; ใช้ หน่วยความจำและกำลังประมวลผล ของโฮสต์, ดังนั้นโฮสต์ต้องมีประสิทธิภาพสูง; บางคุณสมบัติหรืออุปกรณ์ฮาร์ดแวร์ ไม่ถูกจำลอง อย่างแม่นยำ,ดังนั้นซอฟต์แวร์ที่ทดสอบอาจ behave ต่างจากเครื่องจริง; ต้องมี ใบอนุญาต สำหรับแต่ละระบบปฏิบัติการผู้ใช้งาน และการตั้งค่าระบบต้องการความรู้ความเชี่ยวชาญ.

Explore · ⁨สำรวจ⁩

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

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

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
virtual machine/ˈvɜːtʃuːəl məˈʃiːn/ virtual machine
hypervisor/ˌhaɪpəˈvaɪzə/ hypervisor
sandboxing/ˈsændbɒksɪŋ/ การ Sandbox
bytecode/ˈbaɪtkəʊd/ 字节码
just-in-time compilation/dʒʌst ɪn taɪm ˌkɒmpɪˈleɪʃn/ just-in-time compilation
host operating system/həʊst ˈɒpəreɪtɪŋ ˈsɪstəm/ ระบบปฏิบัติการโฮสต์
guest operating system/ɡest ˈɒpəreɪtɪŋ ˈsɪstəm/ ระบบปฏิบัติการผู้รับ
15.2

Boolean algebra · ⁨บูลีนพีชคณิต⁩

Syllabus · ⁨หลักสูตร⁩
English
Candidates should be able to: Notes and guidance
Produce truth tables for logic circuits including half adders and full adders May include logic gates with more than two inputs
Show understanding of a flip-flop (SR, JK) Draw a logic circuit and derive a truth table for a flip-flop Understand of the role of flip-flops as data storage elements
Show understanding of Boolean algebra Understand De Morgan’s laws Perform Boolean algebra using De Morgan’s laws Simplify a logic circuit/expression using Boolean algebra
Show understanding of Karnaugh maps (K-map) Understand of the benefits of using Karnaugh maps Solve logic problems using Karnaugh maps
ไทย
ผู้เข้าสอบควรสามารถ: หมายเหตุและคำแนะนำ
สร้าง ตารางความจริง สำหรับวงจรตรรกะ ซึ่งรวมถึง ** HALF ADDERS** และ FULL ADDERS อาจรวมประตูตรรกะที่มีอินพุตมากกว่าสองทาง
แสดงความเข้าใจ关于 ฟลิป-ฟลอป (flip-flop) (SR, JK) วาดวงจรตรรกะและสร้าง ตารางความจริง สำหรับ ฟลิป-ฟลอป เข้าใจบทบาทของ ฟลิป-ฟลอป ในฐานะองค์ประกอบจัดเก็บข้อมูล
แสดงความเข้าใจ关于 布尔代数 (Boolean algebra) เข้าใจ กฎของเดมอร์گان (De Morgan’s laws) ทำการคำนวณด้วย 布尔代数 โดยใช้ กฎของเดมอร์گان ลดทอนวงจรหรือนิพจน์ตรรกะโดยใช้ 布尔代数
แสดงความเข้าใจ关于 แผนที่คาร์นัฟ (Karnaugh maps / K-map) เข้าใจข้อดีของการใช้ แผนที่คาร์นัฟ แก้ปัญหาตรรกะโดยใช้ แผนที่คาร์นัฟ

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

English
The half adder: XOR + AND add two bits

Boolean algebra 布尔代数 simplifies Boolean 布尔 expressions, which can equally be described by truth tables 真值表. Symbols: + for OR, · for AND (often omitted), an overbar for NOT.

Key laws include commutative, associative and distributive (as in ordinary algebra), plus:

  • identity $A + 0 = A$, $A \cdot 1 = A$; null $A + 1 = 1$, $A \cdot 0 = 0$.
  • idempotent $A + A = A$; inverse $A + \overline{A} = 1$, $A \cdot \overline{A} = 0$.
  • De Morgan's laws 德摩根定律: $(A + B)' = A' \cdot B'$; $(A \cdot B)' = A' + B'$ — negate the whole, swap AND/OR, negate each operand.
  • absorption 吸收律: $A + AB = A$.

Simplifying reduces the number of terms, so the resulting logic circuit has fewer gates. Example: $Z = AB + A\overline{B} = A(B + \overline{B}) = A$.

The laws with their names (quote the name at each step when "show all working" is asked).

Law OR form AND form
identity $A + 0 = A$ $A \cdot 1 = A$
null (annulment) $A + 1 = 1$ $A \cdot 0 = 0$
idempotent $A + A = A$ $A \cdot A = A$
complement (inverse) $A + \overline{A} = 1$ $A \cdot \overline{A} = 0$
commutative $A + B = B + A$ $A \cdot B = B \cdot A$
associative $A + (B + C) = (A + B) + C$ $A(BC) = (AB)C$
distributive $A + BC = (A + B)(A + C)$ $A(B + C) = AB + AC$
absorption $A + AB = A$ $A(A + B) = A$
De Morgan $\overline{A + B} = \overline{A} \cdot \overline{B}$ $\overline{A \cdot B} = \overline{A} + \overline{B}$
double negation $\overline{\overline{A}} = A$

Worked example. Simplify $X = \overline{\overline{(A \cdot B)} \cdot \overline{(A + B)}}$, showing all working.

$X = \overline{\overline{(A \cdot B)}} + \overline{\overline{(A + B)}}$ (De Morgan on the outer bar) $= A \cdot B + A + B$ (double negation) $= A + B$ (absorption, $A + AB = A$, applied with $A + B$ absorbing $AB$).

Worked example. Simplify $(\overline{A + B}) \cdot (\overline{A} + B)$.

$= \overline{A} \cdot \overline{B} \cdot (\overline{A} + B)$ (De Morgan) $= \overline{A}\,\overline{B}\,\overline{A} + \overline{A}\,\overline{B}\,B$ (distributive) $= \overline{A}\,\overline{B} + 0$ (idempotent, complement) $= \overline{A}\,\overline{B}$.

Worked example. Simplify $Y = \overline{A}\,\overline{B}\,\overline{C} + \overline{A}\,\overline{B}\,C + A\,\overline{B}\,C$.

$= \overline{A}\,\overline{B}(\overline{C} + C) + A\,\overline{B}\,C$ (distributive) $= \overline{A}\,\overline{B} + A\,\overline{B}\,C$ (complement, identity) $= \overline{B}(\overline{A} + AC)$ (distributive) $= \overline{B}(\overline{A} + C)$, using $\overline{A} + AC = (\overline{A} + A)(\overline{A} + C) = \overline{A} + C$. Applying De Morgan to a three-input term works the same way: $\overline{A + B + C} = \overline{A} \cdot \overline{B} \cdot \overline{C}$.

Sum-of-products from a truth table. Take every row whose output is 1, write the AND of its inputs (a variable barred where it is 0), and OR the terms: a row with $A = 1, B = 0, C = 1$ gives $A\,\overline{B}\,C$. This is the sum-of-products 积之和 form the exam asks for, and it is the starting point for both algebraic simplification and the Karnaugh map.

ไทย
Half Adder: XOR + ADD บวกบิตสองตัว

布尔พีชคณิต ช่วยทำให้ 布尔 expresión สั้นลง,ซึ่งสามารถอธิบายได้ด้วย ตารางความจริง. สัญลักษณ์: + สำหรับ OR, · สำหรับ AND (มักถูกละไว้), เส้นท่อนบนสำหรับ NOT.

กฎสำคัญรวมถึงกฎการสลับตำแหน่ง การรวมกลุ่ม และการกระจาย (เหมือนพีชคณิตทั่วไป) plus:

  • identity $A + 0 = A$, $A \cdot 1 = A$; null $A + 1 = 1$, $A \cdot 0 = 0$.
  • idempotent $A + A = A$; inverse $A + \overline{A} = 1$, $A \cdot \overline{A} = 0$.
  • De Morgan's laws: $(A + B)' = A' \cdot B'$; $(A \cdot B)' = A' + B'$ — negate ทั้งส่วน, สลับ AND/OR, negate ตัวประกอบแต่ละตัว.
  • absorption: $A + AB = A$.

การทำให้สั้นลงลดจำนวนพจน์,ดังนั้นวงจรตรรกะที่ได้จะมี gate น้อยลง. ตัวอย่าง: $Z = AB + A\overline{B} = A(B + \overline{B}) = A$.

กฎพร้อมชื่อ (ระบุชื่อเมื่อ "แสดงวิธีทำทั้งหมด" ถูกถาม).

กฎ รูปแบบ OR รูปแบบ AND
identity $A + 0 = A$ $A \cdot 1 = A$
null (annulment) $A + 1 = 1$ $A \cdot 0 = 0$
idempotent $A + A = A$ $A \cdot A = A$
complement (inverse) $A + \overline{A} = 1$ $A \cdot \overline{A} = 0$
commutative $A + B = B + A$ $A \cdot B = B \cdot A$
associative $A + (B + C) = (A + B) + C$ $A(BC) = (AB)C$
distributive $A + BC = (A + B)(A + C)$ $A(B + C) = AB + AC$
absorption $A + AB = A$ $A(A + B) = A$
De Morgan $\overline{A + B} = \overline{A} \cdot \overline{B}$ $\overline{A \cdot B} = \overline{A} + \overline{B}$
double negation $\overline{\overline{A}} = A$

ตัวอย่างที่คำนวณแล้ว. ทำให้ $X = \overline{\overline{(A \cdot B)} \cdot \overline{(A + B)}}$ สั้นลง,แสดงวิธีทำทั้งหมด.

$X = \overline{\overline{(A \cdot B)}} + \overline{\overline{(A + B)}}$ (De Morgan ที่เส้นท่อนนอก) $= A \cdot B + A + B$ (double negation) $= A + B$ (absorption, $A + AB = A$, ใช้กับ $A + B$ ที่ดูด $AB$).

ตัวอย่างที่คำนวณแล้ว. ทำให้ $(\overline{A + B}) \cdot (\overline{A} + B)$ สั้นลง.

$= \overline{A} \cdot \overline{B} \cdot (\overline{A} + B)$ (De Morgan) $= \overline{A}\,\overline{B}\,\overline{A} + \overline{A}\,\overline{B}\,B$ (distributive) $= \overline{A}\,\overline{B} + 0$ (idempotent, complement) $= \overline{A}\,\overline{B}$.

ตัวอย่างที่คำนวณแล้ว. ทำให้ $Y = \overline{A}\,\overline{B}\,\overline{C} + \overline{A}\,\overline{B}\,C + A\,\overline{B}\,C$ สั้นลง.

$= \overline{A}\,\overline{B}(\overline{C} + C) + A\,\overline{B}\,C$ (distributive) $= \overline{A}\,\overline{B} + A\,\overline{B}\,C$ (complement, identity) $= \overline{B}(\overline{A} + AC)$ (distributive) $= \overline{B}(\overline{A} + C)$, ใช้ $\overline{A} + AC = (\overline{A} + A)(\overline{A} + C) = \overline{A} + C$. การประยุกต์ใช้ De Morgan กับเทอมสามอินพุตทำงานเหมือนกัน: $\overline{A + B + C} = \overline{A} \cdot \overline{B} \cdot \overline{C}$.

ผลบวกของผลคูณจากตารางความจริง. นำทุกแถวที่ output เป็น 1,เขียน AND ของ input ของแถวนั้น (ตัวแปรมีเส้นท่อนบนเมื่อเป็น 0),และ OR พจน์们: แถวที่มี $A = 1, B = 0, C = 1$ ให้ $A\,\overline{B}\,C$. นี่คือรูปแบบ ผลบวกของผลคูณ ที่ข้อสอบถามถึง,และเป็นจุดเริ่มต้นของการทำให้สั้นด้วยพีชคณิตและ Karnaugh map.

Explore · ⁨สำรวจ⁩

Boolean algebra · ⁨พีชคณิตบูลีน⁩

A·B, A+B, Ā …

Boolean algebra is just these gates written as expressions — compare the truth tables. · ⁨พีชคณิตบูลีนก็คือเกตเหล่านี้เขียนเป็นนิพจน์ — เปรียบเทียบตารางความจริง⁩

Explore · ⁨สำรวจ⁩

Boolean truth tables · ⁨布尔真值表⁩

Pick an operator and the inputs to build its truth table — the algebra behind logic circuits. · ⁨选择运算符和输入以构建其 truth table——逻辑电路背后的代数。⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
De Morgan's laws/də ˈmɔːɡənz lɔːz/ กฎของเด摩根
absorption/əbˈsɔːpʃn/ การดูดซับ
Karnaugh map/ˈkɑːnɔː mæp/ แผนที่คาร์นัฟ
half adder/hɑːf ˈædə/ HALF ADDER
Watch lesson · ⁨ดูบทเรียน⁩
15.2

Karnaugh maps · ⁨ตารางคาร์โน⁩

English

A Karnaugh map 卡诺图 (K-map) simplifies a Boolean expression by grouping adjacent 1s from a truth table. Columns and rows use Gray code 格雷码 order (00, 01, 11, 10) so adjacent cells differ in one variable.

Place a 1 in each cell where the output is 1. Find rectangular groups of 1s whose sides are powers of 2 (1, 2, 4, 8), wrapping around edges if it makes a bigger group. The larger the group, the simpler the term: a group of 2 drops one variable, a group of 4 drops two, and so on — variables that change within the group disappear. OR the group terms together for the simplified expression. Cover every 1 using as few, as large, groups as possible.

Worked example. A Karnaugh map for $A$ and $B$ has 1s in the cells $\overline{A}B$ and $AB$. Simplify. The two 1s are adjacent - they share the $B=1$ column - so group them as a rectangle of 2. Inside that group $B$ stays 1 throughout while $A$ changes from 0 to 1, and any variable that changes within a group disappears. So the group leaves simply $X = B$. Compare that with the sum of products read straight off the table, $\overline{A}B + AB$: the same circuit, two gates fewer. Two rules do most of the work - make each group as large as possible (a group of 2 drops one variable, 4 drops two, 8 drops three), and remember the map wraps around its edges, so the leftmost and rightmost columns are adjacent. That wrap is the grouping most candidates miss.

Building and reading a K-map. Label the columns $AB$ and the rows $C$ (or $CD$) in Gray-code order 00 01 11 10, so that neighbouring cells differ in one variable only. Put a 1 in every cell whose minterm appears in the expression (or whose truth-table row outputs 1). Then draw the fewest, largest loops that cover every 1: each loop must be a rectangle of $1, 2, 4$ or $8$ cells, loops may overlap, may wrap across the left–right and top–bottom edges, and the four corners together make a loop. For each loop write the variables that are constant inside it (barred if 0), and OR the loop terms: that is the optimal sum-of-products. Why use one? It gives the simplest expression without algebra, in a few steps, with less chance of error, and the same map suits three or four variables.

Worked example. $Z = \overline{A}\,\overline{B}\,\overline{C} + \overline{A}\,\overline{B}\,C + \overline{A}\,B\,\overline{C} + \overline{A}\,B\,C + A\,\overline{B}\,\overline{C} + A\,\overline{B}\,C$.

On the three-variable map the 1s fill columns 00, 01 and 10 in both rows. The loop of four over columns 00 and 01 has $A = 0$ throughout and $B$, $C$ both varying: term $\overline{A}$. The loop of four over columns 00 and 10 (wrapping round) has $B = 0$ throughout: term $\overline{B}$. So $Z = \overline{A} + \overline{B}$, which Boolean algebra confirms: $\overline{A}(\overline{B} + B) + \ldots = \overline{A} + \overline{B}$. Two loops of two would also be correct but not optimal; a loop is as large as the 1s allow.

Worked example (four variables). A map has 1s only in its four corners: $\overline{A}\,\overline{B}\,\overline{C}\,\overline{D}$, $A\,\overline{B}\,\overline{C}\,\overline{D}$, $\overline{A}\,\overline{B}\,C\,\overline{D}$ and $A\,\overline{B}\,C\,\overline{D}$. Because the top and bottom rows are adjacent and so are the outer columns, the corners are one loop of four; $B = 0$ and $D = 0$ in all of them while $A$ and $C$ vary, so $Z = \overline{B}\,\overline{D}$.

ไทย

ตารางคาร์โน (K-map) ทำให้布尔 expression สั้นลงโดยการ จับกลุ่ม 1s ที่ติดกัน จากตารางจริง. คอลัมน์และแถวใช้ลำดับ Gray code (00, 01, 11, 10) เพื่อให้เซลล์ที่ติดกันต่างกันเพียงตัวแปรเดียว.

วาง 1 ในแต่ละเซลล์ที่ output เป็น 1. หากลุ่มสี่เหลี่ยมผืนผ้าของ 1s ที่มีด้านเป็นเลขยกกำลังของ 2 (1, 2, 4, 8),พันรอบขอบถ้าจะทำให้กลุ่มใหญ่ขึ้น. ยิ่งกลุ่มใหญ่ยิ่ง简短: กลุ่มขนาด 2 ลบตัวแปรหนึ่ง, กลุ่มขนาด 4 ลบสอง,และอื่นๆ — ตัวแปรที่เปลี่ยนภายในกลุ่มจะหายไป. OR พจน์กลุ่มเข้าด้วยกันเพื่อรับ expression ที่简化. ครอบคลุมทุก 1 โดยใช้กลุ่มให้น้อยที่สุดและใหญ่ที่สุดเท่าที่จะทำได้.

ตัวอย่างที่คำนวณแล้ว. ตารางคาร์โนสำหรับ $A$ และ $B$ มี 1s ในเซลล์ $\overline{A}B$ และ $AB$. ทำให้简短. 1s ทั้งสอง ติดกัน - они共用 $B=1$ คอลัมน์ - ดังนั้นจับกลุ่มเป็นสี่เหลี่ยมผืนผ้าขนาด 2. ภายในกลุ่มนั้น $B$ เป็น 1 ตลอด mientras $A$ เปลี่ยน จาก 0 เป็น 1,และตัวแปรที่เปลี่ยนภายในกลุ่ม หายไป. ดังนั้นกลุ่มนี้เหลือเพียง $X = B$. เปรียบเทียบกับผลบวกของผลคูณอ่านตรงจากตาราง, $\overline{A}B + AB$: วงจรเดียวกัน,น้อยลง 2 gates. กฎสองข้อทำหน้าที่หลัก - ทำให้กลุ่ม ใหญ่ที่สุดเท่าที่จะทำได้ (กลุ่ม 2 ลบตัวแปรหนึ่ง, 4 ลบสอง, 8 ลบสาม),และจำไว้ว่าตาราง พันรอบ ขอบ,ดังนั้นคอลัมน์ซ้ายสุดและขวาสุดติดกัน. การพันรอบนี้เป็นสิ่งที่ผู้เข้าสอบส่วนใหญ่พลาดในการจับกลุ่ม.

ตารางคาร์โนสองตาราง: ตารางสามตัวแปรสำหรับ expression หกพจน์ที่มีวงกลมสีแดงสี่วงลงมาสองคอลัมน์แรกให้ not A และวงกลมสีฟ้าสี่วงพันรอบคอลัมน์ภายนอกให้ not B; และตารางสี่ตัวแปรที่ 1s ทั้งสี่มุมสร้างวงกลมพันรอบหนึ่งให้ not B และ not D
วงกลมของ 1, 2, 4 หรือ 8 ones; term สำหรับวงกลมรักษาเฉพาะตัวแปรที่ไม่เปลี่ยนภายใน. ขอบเชื่อมต่อกัน,ดังนั้นวงกลมอาจพันรอบ,และมุมทั้งสี่นับเป็นติดกัน

การสร้างและอ่าน K-map. จัดลำดับคอลัมน์ $AB$ และแถว $C$ (หรือ $CD$) ตามลำดับ Gray-code 00 01 11 10 เพื่อให้เซลล์ที่ติดกันแตกต่างกันเพียงตัวแปรเดียวเท่านั้น ใส่เลข 1 ในทุกเซลล์ที่มี minterm ปรากฏในนิพจน์ (หรือแถวของตารางความจริงที่แสดงผลลัพธ์เป็น 1) จากนั้นวาด วงวนน้อยที่สุดและใหญ่ที่สุด ที่ครอบคลุมเลข 1 ทั้งหมด: แต่ละวงวนต้องเป็นสี่เหลี่ยมผืนผ้าขนาด $1, 2, 4$ หรือ $8$ เซลล์ วงวนสามารถ ทับซ้อนกันได้, สามารถ ม้วนรอบ ขอบซ้าย-ขวาและบน-ล่างได้ และมุมทั้งสี่รวมกันก็ถือเป็นวงวนหนึ่ง สำหรับแต่ละวงวน ให้ระบุตัวแปรที่เป็น ค่าคงที่ ภายในวงวนนั้น (ใช้เส้นทอนหากเป็น 0) แล้วนำเทอมของวงวนมา OR กัน: นั่นคือผลบวกของผลคูณที่เหมาะสมที่สุด ทำไมต้องใช้? เพราะให้นิพจน์ที่ง่ายที่สุด โดยไม่ต้องใช้พีชคณิต, ทำได้ในไม่กี่ขั้นตอน มีโอกาสเกิดข้อผิดพลาดน้อยกว่า, และแผนที่เดียวกันนี้สามารถใช้กับสามหรือสี่ตัวแปรก็ได้

ตัวอย่างที่แสดงวิธีทำ. $Z = \overline{A}\,\overline{B}\,\overline{C} + \overline{A}\,\overline{B}\,C + \overline{A}\,B\,\overline{C} + \overline{A}\,B\,C + A\,\overline{B}\,\overline{C} + A\,\overline{B}\,C$

บนแผนภูมิสามตัวแปร เลข 1 จะเติมเต็มคอลัมน์ 00, 01 และ 10 ในทั้งสองแถว วงวนสี่เซลล์ที่ครอบคลุมคอลัมน์ 00 และ 01 จะมี $A = 0$ ตลอดทั้งวงวน และมี $B$, $C$ เปลี่ยนแปลงไปพร้อมกัน: เทอมคือ $\overline{A}$ วงวนสี่เซลล์ที่ครอบคลุมคอลัมน์ 00 และ 10 (ม้วนรอบ) จะมี $B = 0$ ตลอดทั้งวงวน: เทอมคือ $\overline{B}$ ดังนั้น $Z = \overline{A} + \overline{B}$, ซึ่งพีชคณิตบูลian ยืนยันว่า: $\overline{A}(\overline{B} + B) + \ldots = \overline{A} + \overline{B}$ การทำวงวนสองวงละสองเซลล์ก็จะถูกต้องแต่ไม่ เหมาะสมที่สุด; ขนาดของวงวนจะเท่ากับจำนวนเลข 1 ที่อนุญาตให้ได้มากที่สุดเท่าที่จะทำได้

ตัวอย่างวิธีทำ (สี่ตัวแปร). แผนภูมิมีเลข 1 อยู่เฉพาะที่มุมทั้งสี่: $\overline{A}\,\overline{B}\,\overline{C}\,\overline{D}$, $A\,\overline{B}\,\overline{C}\,\overline{D}$, $\overline{A}\,\overline{B}\,C\,\overline{D}$ และ $A\,\overline{B}\,C\,\overline{D}$ เนื่องจากแถบบนและแถบล่างติดกัน และคอลัมน์ด้านนอกก็ติดกัน มุมทั้งสี่จึงเป็นวงวนเดียวสี่เซลล์; $B = 0$ และ $D = 0$ มีค่าคงที่ในทุกจุด ในขณะที่ $A$ และ $C$ เปลี่ยนแปลงไป: ดังนั้น $Z = \overline{B}\,\overline{D}$

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
Gray code/ɡreɪ kəʊd/ โค้ดเกรย์
15.2

Half adder and full adder · ⁨Half adder และ full adder⁩

English

A half adder 半加器 adds two single bits $A$ and $B$, giving a sum $S$ and a carry 进位 $C$:

A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

So $S = A \text{ XOR } B$ and $C = A \text{ AND } B$. It ignores any carry-in — hence "half".

A full adder 全加器 adds three bits ($A$, $B$, carry-in), giving a sum and a carry-out: $S = A \text{ XOR } B \text{ XOR } C_{\text{in}}$. It can be built from two half adders plus an OR gate. Chaining full adders (each carry-out feeding the next carry-in) makes a multi-bit "ripple-carry" adder.

The full-adder truth table. With inputs $A$, $B$ and the carry-in $C_{\text{in}}$: the sum $S$ is 1 when an odd number of inputs is 1, and the carry-out is 1 when two or more inputs are 1.

$A$ $B$ $C_{\text{in}}$ $S$ $C_{\text{out}}$
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1

The circuit questions the exam sets. Given a circuit of an XOR and an AND gate sharing two inputs, or two half adders and an OR gate, "complete the truth table (show your working)" means adding a column for every intermediate gate output and filling the rows in order; "state the name of the circuit" is half adder or full adder; "state the purpose of each output" is the sum of the bits and the carry to the next column. Sum-of-products for the half adder: $S = \overline{A}B + A\overline{B}$, $C = AB$. A chain of full adders, each passing its carry-out to the next carry-in, adds two multi-bit numbers.

ไทย

Half adder เพิ่มบิตเดี่ยวสองตัว $A$ และ $B$, ให้ผลบวกเป็น $S$ และมี carry เป็น $C$:

A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

ดังนั้น $S = A \text{ XOR } B$ และ $C = A \text{ AND } B$ มันไม่สนใจ carry-in — จึงเรียกว่า "half"

A half adder block with inputs A and B and outputs sum and carry, beside its circuit where A and B feed an XOR gate giving the sum and an AND gate giving the carry
A half adder, as a block and as a circuit of an XOR and an AND gate

Full adder เพิ่มบิตสามตัว ($A$, $B$, carry-in), ให้ผลบวกและ carry-out: $S = A \text{ XOR } B \text{ XOR } C_{\text{in}}$ สามารถสร้างจาก half adder สองตัวบวกกับ OR gate การต่อ chain ของ full adders (โดยที่ carry-out ของแต่ละตัวป้อนเข้า carry-in ของตัวถัดไป) ทำให้เกิด multi-bit "ripple-carry" adder

Two half adders chained with an OR gate to add A, B and a carry-in: the first half adder takes A and B, the second adds the carry-in, and the OR gate combines the two carries into the carry-out
A full adder is built from two half adders and an OR gate

ตารางความจริงของ full-adder. ด้วยอินพุต $A$, $B$ และ carry-in $C_{\text{in}}$: ผลบวก $S$ จะเป็น 1 เมื่อจำนวนอินพุตที่เป็น 1 เป็นจำนวน คี่, และ carry-out จะเป็น 1 เมื่อมีอินพุตเป็น 1 สองตัวขึ้นไป

$A$ $B$ $C_{\text{in}}$ $S$ $C_{\text{out}}$
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1

**คำถามวงจรในการสอบ.**给定 XOR gate และ AND gate ที่แชร์อินพุตสองตัว, หรือ half adder สองตัวและ OR gate, "เติมตารางความจริง (แสดงวิธีทำ)" หมายความว่าเพิ่ม คอลัมน์สำหรับผลลัพธ์ของแต่ละ intermediate gate และเติมข้อมูลตามลำดับบรรทัด; "ระบุชื่อของวงจร" คือ half adder หรือ full adder; "ระบุวัตถุประสงค์ของแต่ละเอาต์พุต" คือ ผลบวก ของบิตและ carry ไปยังคอลัมน์ถัดไป Sum-of-products สำหรับ half adder: $S = \overline{A}B + A\overline{B}$, $C = AB$. Chain ของ full adders ที่ส่ง carry-out ของแต่ละตัวไปยัง carry-in ของตัวถัดไป จะเพิ่มตัวเลข multi-bit ได้สองจำนวน

Explore · ⁨สำรวจ⁩

The gates inside an adder · ⁨Gates ภายใน adder⁩

A half-adder's sum bit is an XOR gate and its carry is an AND gate — toggle A and B and watch the truth-table row light up. · ⁨บิตผลบวกของ half-adder เป็น XOR gate และ carry เป็น AND gate — เปลี่ยนค่า A และ B แล้วดูแถวใน truth table แสงสว่างขึ้น⁩

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
sum-of-products/sʌm ɒv ˈprɒdʌkts/ ผลรวมของผลคูณ
carry/ˈkæri/ carry
full adder/fʊl ˈædə/ adders.html full adder.html
15.2

Flip-flops

English

A flip-flop 触发器 is a bistable 双稳态 circuit — two stable states (0 and 1) — that remembers its state. It stores one bit and is the basic element of registers and SRAM.

SR flip-flop

An SR flip-flop SR触发器 has inputs S (set) and R (reset) and outputs Q and $\overline{Q}$. S=1,R=0 sets Q to 1; S=0,R=1 resets it to 0; S=0,R=0 holds; S=1,R=1 is invalid. Built from two cross-coupled NOR gates.

"Draw a logic circuit for an SR flip-flop and label the inputs." Two NOR gates (or two NAND gates), the output of each connected back to one input of the other; the free input of one gate is S, of the other R; the outputs are $Q$ and $\overline{Q}$. The feedback is what the marks are for: without it there is no memory. "State the purpose of a flip-flop." To store one bit of data; it is the basic memory element from which registers and static RAM are built, and it holds its value until it is deliberately changed. The invalid input $S = R = 1$ makes both outputs 0, so that $\overline{Q}$ is no longer the complement of $Q$, and the state after both inputs return to 0 is unpredictable, which is the SR flip-flop's weakness.

JK flip-flop

A JK flip-flop JK触发器 improves on it by using the previously-invalid 1,1 input as a toggle 翻转 (the output flips). This makes it ideal for building counters 计数器 (a chain of toggling flip-flops). It is usually clocked — inputs act only on a clock edge, keeping flip-flops synchronised.

Flip-flops are the building blocks of registers (n bits = n flip-flops), counters, and SRAM 静态RAM cells.

JK flip-flop truth table. The clock 时钟 input decides when the J and K inputs are read, so the output changes only on a clock pulse: with $J = K = 0$ the output is held; $J = 1, K = 0$ sets $Q$ to 1; $J = 0, K = 1$ resets it to 0; $J = K = 1$ toggles it (Q becomes $\overline{Q}$). The last row is exactly the SR flip-flop's forbidden input turned into a useful one, which is why the JK is preferred: every input combination is valid, and the clocked operation makes it the building block of counters and shift registers.

ไทย

Flip-flop คือวงจร bistable — มีสถานะที่เสถียรสองอย่าง (0 และ 1) — ที่ จำ สถานะของตัวเองไว้ได้ มันเก็บข้อมูลหนึ่งบิต และเป็นองค์ประกอบพื้นฐานของ registers และ SRAM

SR flip-flop

SR flip-flop SR มีอินพุตคือ S (set) และ R (reset) และเอาต์พุตคือ Q และ $\overline{Q}$. S=1,R=0 ตั้งค่า Q เป็น 1; S=0,R=1 รีเซ็ตให้เป็น 0; S=0,R=0 เก็บค่าเดิมไว้; S=1,R=1 เป็น ค่าที่ไม่ถูกต้อง สร้างจาก NAND gate สองตัวที่เชื่อมข้ามกัน

An SR flip-flop built from two cross-coupled NOR gates, with S feeding one gate and R the other, each gate's output fed back to the other's input, and its truth table: hold, set, reset and the invalid state
The SR flip-flop: two NOR gates feeding each other. With both inputs 0 the outputs hold whatever they were, which is the memory; S sets Q to 1, R resets it, and S = R = 1 is not allowed

"วาดวงจรตรรกะสำหรับ SR flip-flop และติดฉลากอินพุต." ใช้ NOR gate สองตัว (หรือ NAND gate สองตัว) เอาต์พุตของแต่ละตัวเชื่อมกลับเข้าไปที่อินพุตหนึ่งของอีกตัวหนึ่ง; อินพุตที่เหลือของ_gate_ หนึ่งคือ S, ของอีกตัวคือ R; เอาต์พุตคือ $Q$ และ $\overline{Q}$ การ feedback คือสิ่งที่คะแนนประเมิน: หากไม่มีมันจะไม่มีหน่วยความจำ "ระบุวัตถุประสงค์ของ flip-flop." เพื่อเก็บข้อมูลหนึ่งบิต; มันเป็นองค์ประกอบหน่วยความจำพื้นฐานที่ใช้สร้าง registers และ static RAM, และมันจะรักษาค่าไว้จนกว่าจะถูกเปลี่ยนแปลงอย่างตั้งใจ อินพุตที่ไม่ถูกต้อง $S = R = 1$ ทำให้เอาต์พุตทั้งสองเป็น 0, ดังนั้น $\overline{Q}$就不再是$Q$ complement, และสถานะหลังจากอินพุตทั้งสองกลับสู่ 0 นั้นไม่สามารถคาดเดาได้, ซึ่งเป็นจุดอ่อนของ SR flip-flop

JK flip-flop

JK flip-flop JK ปรับปรุงขึ้นโดยใช้อินพุตที่ไม่ถูกต้องก่อนหน้านี้ 1,1 เป็น toggle (เอาต์พุตสลับสถานะ) ทำให้เหมาะสำหรับการสร้าง counters (chain ของ flip-flops ที่ toggle กัน) โดยทั่วไปจะมี clock — อินพุตจะทำงานเฉพาะเมื่อมีสัญญาณ clock edge, ทำให้ flip-flops ทำงานแบบ synchronized

A JK flip-flop block symbol with J, K and clock inputs and outputs Q and Q-bar, beside its build from four cross-coupled NAND gates with the Q and Q-bar outputs fed back to the input gates
A JK flip-flop: its symbol and a build from NAND gates

Flip-flops เป็นส่วนประกอบพื้นฐานของ registers (n บิต = n flip-flops), counters, และเซลล์ SRAMRAM

ตารางจริงของ JK flip-flop. อินพุต clock กำหนดเมื่อใดที่อินพุต J และ K จะถูกอ่าน ดังนั้นเอาต์พุตจึงเปลี่ยนก็ต่อเมื่อมีสัญญาณ clock: ด้วย $J = K = 0$ เอาต์พุตจะถูก เก็บ; $J = 1, K = 0$ ตั้งค่า $Q$ เป็น 1; $J = 0, K = 1$ รีเซ็ต เป็น 0; $J = K = 1$ สลับ ค่า (Q กลายเป็น $\overline{Q}$). บรรทัดสุดท้ายนี้คืออินพุตต้องห้ามของ SR flip-flop ที่ถูกแปลงให้เป็นประโยชน์ได้ นี่คือเหตุผลที่ JK được prefer: ทุกชุดอินพุตมีความถูกต้อง และการทำงานด้วย clock ทำให้มันเป็นหน่วยพื้นฐานของเคาน์เตอร์และ shift registers.

Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
register/ˈredʒɪstə/ รีจิสเตอร์ (register)
flip-flop/flɪp flɒp/ ฟลิป-ฟลอป
bistable/baɪˈsteɪbl/ บิสเทเบิ้ล
toggle/ˈtɒɡl/ ทักเกิล
counters/ˈkaʊntəz/ เคาน์เตอร์
SRAM/ˈesræm/ SRAM
clock/klɒk/ นาฬิกา
SR flip-flop/ˌes ˈɑː flɪp flɒp/ SR flip-flop
JK flip-flop/ˌdʒeɪ ˈkeɪ flɪp flɒp/ JK flip-flop
15.2

Definitions the examiner accepts · ⁨คำนิยามที่ผู้สอบยอมรับ⁩

English

A definition question is marked against fixed wording. Learn these exactly, and give one answer only.

Term Definition
RISC a processor with a small set of simple, fixed-length instructions, most executed in one clock cycle, using many registers and pipelining
CISC a processor with a large set of complex, variable-length instructions, many taking several clock cycles and accessing memory directly
pipelining dividing the fetch–execute cycle into stages so that several instructions are processed at once, each at a different stage
SISD / SIMD / MISD / MIMD one instruction on one data item; one instruction on many data items; many instructions on one data item; many instructions on many data items
massively parallel computer thousands of processors, each with its own memory, connected by a network and working simultaneously on one problem
virtual machine a software emulation of a computer system running on a host computer and behaving like a separate physical computer
hypervisor the software that creates virtual machines and shares the host's hardware between them
truth table a table listing every combination of inputs to a logic circuit with the resulting output(s)
sum-of-products a Boolean expression written as the OR of AND terms, one term for each input combination giving 1
Karnaugh map a grid of the truth-table outputs, arranged in Gray-code order, in which loops of adjacent 1s give the simplified expression
half adder a circuit that adds two bits, producing a sum and a carry
full adder a circuit that adds two bits and a carry-in, producing a sum and a carry-out
flip-flop a bistable circuit that stores one bit, holding its output until its inputs change it
ไทย

คำถามคำนิยามจะให้คะแนนตามข้อความที่กำหนดไว้你必须 exact. เรียนรู้ให้ถูกต้องและตอบเพียงคำตอบเดียวเท่านั้น

พจน์ นิยาม
RISC โปรเซสเซอร์ที่มีชุดคำสั่งง่ายๆ ความยาวคงตัวจำนวนน้อย ส่วนใหญ่ดำเนินการในหนึ่งรอบนาฬิกา ใช้รีจิสเตอร์จำนวนมากและการทำ Pipelining
CISC โปรเซสเซอร์ที่มีชุดคำสั่งซับซ้อน ความยาวไม่คงตัวจำนวนมาก หลายคำสั่งใช้เวลาหลายรอบนาฬิกาและเข้าถึงหน่วยความจำโดยตรง
Pipelining การแบ่งรอบ Fetch–Execute ออกเป็นขั้นตอนต่างๆ เพื่อให้สามารถประมวลผลคำสั่งหลายคำสั่งพร้อมกันได้ โดยแต่ละคำสั่งอยู่ในขั้นตอนที่แตกต่างกัน
SISD / SIMD / MISD / MIMD คำสั่งเดียวต่อข้อมูลหนึ่งรายการ; คำสั่งเดียวต่อข้อมูลหลายรายการ; คำสั่งหลายคำสั่งต่อข้อมูลหนึ่งรายการ; คำสั่งหลายคำสั่งต่อข้อมูลหลายรายการ
คอมพิวเตอร์แบบขนานระดับมหาศาล มีโปรเซสเซอร์หลักพันตัว แต่ละตัวมีหน่วยความจำของตัวเอง เชื่อมต่อกันด้วยเครือข่ายและทำงานพร้อมกันกับปัญหาเดียวกัน
Virtual machine การจำลองระบบคอมพิวเตอร์ด้วยซอฟต์แวร์ที่ทำงานบน Host Computer และมีพฤติกรรมเหมือนคอมพิวเตอร์ทางกายภาพเครื่องหนึ่ง
Hypervisor ซอฟต์แวร์ที่ใช้สร้าง Virtual Machine และแบ่งปันฮาร์ดแวร์ของ Host ระหว่างเครื่องเหล่านั้น
Truth table ตารางที่ระบุทุกชุดค่าอินพุตที่เป็นไปได้ของวงจรลอจิก besertaเอาต์พุตที่เกิดขึ้นตามนั้น
Sum-of-products นิพจน์ Boolean ที่เขียนในรูป OR ของ AND terms โดยแต่ละ term แทนชุดอินพุตหนึ่งชุดที่ให้ผลลัพธ์เป็น 1
Karnaugh map ตารางที่แสดงเอาต์พุตจาก truth table จัดเรียงตามลำดับ Gray-code ซึ่งการวงกลุ่ม 1s ที่อยู่ติดกันจะให้นิพจน์ที่ลดทอนแล้ว
Half adder วงจรที่ใช้บวกบิตสองตัว เพื่อสร้างผลบวกและค่า carry
Full adder วงจรที่ใช้บวกบิตสองตัวและรับค่า carry-in เพื่อสร้างผลบวกและค่า carry-out
Flip-flop วงจร bistable ที่เก็บข้อมูลหนึ่งบิต โดยรักษาสถานะเอาต์พุตไว้จนกว่าอินพุตจะเปลี่ยนสถานะ
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
Boolean/ˈbuːlɪən/ Boolean
truth tables/truːθ ˈteɪblz/ ตารางความจริง
15.2

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

English
  • RISC and CISC are answered as lists of features: simple, fixed, one cycle, many registers, load/store, pipelined against complex, variable, multi-cycle, fewer registers, direct memory access, microcode. Four of each.
  • Pipelining: stages, several instructions at once, one completed per cycle, higher throughput; $n + k - 1$ cycles for $n$ instructions through $k$ stages; interrupts must empty the pipeline.
  • Flynn's four categories are "how many instruction streams" by "how many data streams"; say what runs on what. Massively parallel: many processors, own memory, network, same problem.
  • Virtual machine: emulation of a computer on a host; host OS on the hardware, hypervisor sharing it, guest OS inside. Two benefits and two limitations, each a full sentence.
  • Boolean algebra: name each law as you use it; De Morgan swaps the operator and negates each term; check with a truth table if in doubt.
  • K-map: Gray-code order, largest loops of 1/2/4/8, wrapping allowed, one term per loop with the unchanging variables. State why: simplest expression with no algebra.
  • Half adder gives sum and carry; full adder also takes a carry-in; SR flip-flop is two cross-coupled NOR/NAND gates and stores one bit; JK's 1,1 input toggles.

Common mistakes

  • Swapping the RISC and CISC feature lists, or offering "faster" as a feature; give the design features, not a verdict.
  • Describing pipelining as "running instructions in parallel on several cores"; it is stages of one processor overlapping.
  • Confusing SIMD (one instruction, many data) with MIMD (many of both), or describing MISD as the common case.
  • Defining a virtual machine as "a copy of a computer" without the word emulation or the host and guest.
  • Applying De Morgan to only part of an expression under a long bar, or dropping the bar without swapping AND for OR.
  • Looping a group of three, or a non-rectangular group, in a K-map; ordering the columns 00, 01, 10, 11 instead of Gray code.
  • Writing the carry of a half adder as XOR and the sum as AND.
  • Drawing an SR flip-flop as two gates with no feedback, or leaving out the invalid state from its truth table.
ไทย
  • RISC และ CISC ตอบเป็นรายการคุณลักษณะ: เรียบง่าย, ความยาวคงตัว, รอบเดียว, รีจิสเตอร์มาก, Load/Store, ทำ Pipelining เปรียบเทียบกับซับซ้อน, ความยาวไม่คงตัว, หลายรอบ, รีจิสเตอร์น้อยกว่า, เข้าถึงหน่วยความจำโดยตรง, Microcode. อย่างละสี่ข้อ
  • Pipelining: ขั้นตอน, คำสั่งหลายคำสั่งพร้อมกัน, เสร็จสมบูรณ์หนึ่งคำสั่งต่อรอบ, Throughput สูงขึ้น; $n + k - 1$ รอบสำหรับ $n$ คำสั่งผ่าน $k$ ขั้นตอน; การเกิด Interrupt ต้องทำให้ Pipeline ว่างเปล่า
  • หมวดหมู่สี่ของ Flynn คือ "จำนวนสายการไหลของคำสั่ง" ต่อ "จำนวนสายการไหลของข้อมูล"; บอกว่าอะไรทำงานบนอะไร แบบขนานระดับมหาศาล: โปรเซสเซอร์จำนวนมาก, มีหน่วยความจำเอง, เครือข่าย, แก้ไขปัญหาเดียวกัน
  • Virtual machine: การจำลองคอมพิวเตอร์บน Host; Host OS อยู่บนฮาร์ดแวร์, Hypervisor แบ่งปันทรัพยากร, Guest OS อยู่ภายใน. ประโยชน์สองข้อและข้อจำกัดสองข้อ, ข้อละประโยคเต็ม
  • Boolean algebra: ตั้งชื่อกฎแต่ละข้อขณะใช้งาน; De Morgan สลับ operator และลบกลับ (negate) แต่ละเทอม; ตรวจสอบด้วย truth table หากไม่แน่ใจ
  • K-map: ลำดับ Gray-code, วงกลมใหญ่ที่สุดของ 1/2/4/8, การห่อหุ้มได้, เทอมหนึ่งต่อวงกลม พร้อมตัวแปรที่ไม่เปลี่ยนแปลง. อธิบายเหตุผล: นิพจน์ที่เรียบง่ายที่สุดโดยไม่ใช้พีชคณิต
  • Half adder ให้ผลบวกและcarry; Full adder รับ carry-in เพิ่มเติม; SR flip-flop ประกอบด้วย NOR/NAND gates สองตัวตัดกันและเก็บหนึ่งบิต; JK ที่อินพุต 1,1 จะสลับสถานะ

ข้อผิดพลาดที่พบบ่อย

  • การสลับรายการคุณลักษณะของ RISC และ CISC, หรือเสนอ "เร็วขึ้น" เป็นคุณลักษณะ; ให้คุณลักษณะการออกแบบ ไม่ใช่คำตัดสิน
  • การอธิบาย Pipelining ว่า "การทำงานแบบขนานของคำสั่งบนคอร์หลายคอร์"; มันคือการซ้อนทับขั้นตอนของโปรเซสเซอร์เดียว
  • การสับสนระหว่าง SIMD (คำสั่งเดียว ข้อมูลหลายรายการ) กับ MIMD (ทั้งสองอย่างหลายรายการ), หรืออธิบาย MISD sebagai กรณีทั่วไป
  • การนิยาม Virtual machine ว่า "สำเนาของคอมพิวเตอร์" โดยขาดคำว่า emulation หรือ host และ guest
  • การประยุกต์ใช้ De Morgan กับเพียงบางส่วนภายใต้เส้นบาร์ที่ยาว, หรือลบลบกลับโดยไม่ได้สลับ AND เป็น OR
  • การวงกลุ่มสามตัว หรือกลุ่มที่ไม่เป็นรูปสี่เหลี่ยมผืนผ้า ใน K-map; การจัดลำดับคอลัมน์เป็น 00, 01, 10, 11 แทนที่จะเป็น Gray code
  • การเขียน carry ของ half adder เป็น XOR และผลบวกเป็น AND
  • การวาด SR flip-flop เป็นสองเกตโดยไม่มีการป้อนกลับ, หรือข้ามสถานะที่ผิดไปจากตารางความจริง
Vocabulary · ⁨คำศัพท์⁩ Train · ⁨ฝึกฝน⁩
English ไทย
Boolean algebra/ˈbuːlɪən ˈældʒɪbrə/ พีชคณิตบูลีน

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

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

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

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

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

IGCSE, A-Level & AP