The CPU and the fetch-execute cycle
הוצג
11:47
מעבד המרכזי (CPU)
המעבד בטלפון שלך עושה דבר פשוט כמעט עד כדי טלות. הוריד הוראה אחת. הבן מה היא פירושה. ביצע אותה. לאחר מכן הוריד את ההוראה הבאה. זהו…
קריינות באנגלית · כתוביות באנגלית ובסינית 中文 שאפשר להחליף ביניהן
בשיעור הזה
| English | משמעות |
|---|---|
| CPU/ˌsiː piː ˈjuː/ | מעבד מרכזי |
| data/ˈdeɪtə/ | Recorded facts, observations or values used for analysis or processing. |
| instructions/ɪnˈstrʌkʃnz/ | הוראות |
| ALU/ˌeɪ el ˈjuː/ | יחידת אריתמטיקה ולוגיקה |
| control unit/kənˈtrəʊl ˈjuːnɪt/ | יחידת בקרה |
| registers/ˈredʒɪstəz/ | רישומים |
| buses/ˈbʌsɪz/ | זרועות נתונים |
| program/ˈprəʊɡræm/ | A set of instructions specifying operations for a computer to carry out. |
| fetch–execute cycle/fetʃ ˈeksɪkjuːt ˈsaɪkl/ | The repeating process of obtaining an instruction, decoding it and carrying out the required operation. |
| logical comparisons | |
| control signals | |
| memory/ˈmeməri/ | Circuits that store data, such as registers, RAM and ROM. |
| address/əˈdres/ | An identifier specifying a location in memory or on a network. |
| chip | |
| Fetch | |
| Execute/ˈeksɪkjuːt/ | |
| PC | |
| MAR | |
| MDR | |
| CIR | |
| ACC | |
| Decode | |
| cache/kæʃ/ | מטמון |
| embedded system/emˈbedɪd ˈsɪstəm/ | מערכת משולבת |
| cores/kɔːz/ | Processing units within a processor that can execute instruction streams. |
| cache size | |
| clock speed/klɒk spiːd/ | The number of cycles of a processor's clock per second; it alone does not determine how quickly every program runs. |
| Storage/ˈstɔːrɪdʒ/ | |
| secondary storage/ˈsekəndəri ˈstɔːrɪdʒ/ | Non-volatile storage used to retain data and programs beyond immediate processing. |
| program counter/ˈprəʊɡræm ˈkaʊntə/ | A processor register holding the address of the next instruction to fetch in the simplified CPU model. |
| address bus/əˈdres bʌs/ | The signal lines used to identify a memory location or device involved in a transfer. |
| data bus/ˈdeɪtə bʌs/ | The signal lines carrying data between processor, memory and other connected components. |
| accumulator/əˈkjuːmjʊleɪtə/ | A register used to hold intermediate arithmetic or logical results during processing. |
יחידת עיבוד מרכזית
- ה-CPU מעבדת נתונים ומבצעת הוראות, בחזרה על מחזור מיליוני פעמים בשנייה.
- בתוכה נמצאים ALU, יחידת בקרה וריגיסטרים, הקשורים דרך סדרות נתונים (buses).
- היא מפעילה כל תוכנית באמצעות מחזור טעינה-ביצוע.
חלקי היחידה המרכזית
- ALU — מבצעת חישובים והשוואות לוגיות.
- יחידת בקרה (CU) — שולחת אותות בקרה כדי לשלוט בכל החלקים.
- ריגיסטרים — אחסונים זעירים ומהירים מאוד המחזיקים ערך אחד כל אחד.
- שלושה סדרות נתונים מקשרות אותם לזיכרון: כתובת (חד כיוונית), נתונים (דו-כיוונית), בקרה.


CPU מודרני הוא שבב יחיד המכיל את יחידת הבקרה, את ה-ALU ואת הריגיסטרים


The ALU in a CPU:
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
The arithmetic logic unit does the maths and logic; the control unit manages the parts.
ריגיסטרים ומחזור הטעינה-ביצוע
- רגיסטרים מיוחדים: PC (כתובת ההוראה הבאה), MAR (כתובת לגישה), MDR (נתונים/הוראה שנשאו), CIR (ההוראה הנערכת כרגע), ACC (תוצאת יחידת האלוגריתמית והאריטמטית).
- המחזור חוזר בשלושה שלבים: שאיבה (העתקת ההוראה לתוך מעבד, ולאחר מכן PC + 1) → פירוש (יחידת הביקורת מחשבת מה המשמעות) → ביצוע (ביצוע הפעולה).

מחזור השאיבה-פירוש-ביצוע שמעבד החוזר עליו עבור כל הוראה

מחזור ציוד-ביצוע
Tap round the loop the CPU repeats billions of times a second — fetch the instruction, decode what it means, execute it, then do it all again.
Match each CPU part to what it does.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
The ALU computes, the control unit directs, the PC tracks the next instruction, and cache keeps hot data close.
Put the stages of the cycle in order.
רמת קושי 3/5 · 200 מטבעות + בונוס קטן בהשלמה הראשונה היום
Fetch the instruction, decode what it means, then execute it — repeated continuously.
Cache, ביצועים, מערכות מובנות
- Cache הוא כמות קטנה של זיכרון מהיר מאוד בסמוך למעבד, המאחסנת נתונים המשתמשים בהם לעיתים קרובות — כך שמעבד מחכה פחות.
- הביצועים תלויים במספר ליבות, גודל ה-Cache ומהירות השעון (מחזור לשנייה).
- מערכת מובנת היא מחשב קטן שנועד בתוך מכשיר למשימה אחת קבועה (מכונת כביסה, מיקרוגל).

Cache וזיכרון ראשי (RAM) יושבים בסמוך למעבד כדי להעביר לו נתונים במהירות


Which change would improve CPU performance?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
More cores, a larger cache and a higher clock speed all improve performance.
Cache is small, very fast memory near the CPU that holds often-used data, so the CPU waits less than it would reading from main memory.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
A bigger cache, more cores and a higher clock speed all raise performance — cache helps by cutting the wait for data.
הכרטיס הזה חדש, לכן הוא מוצג באנגלית עד שהתרגום שלו יהיה מוכן.
Worked example: one trip round the cycle
The program counter 程序计数器 (PC) holds 20. Describe how the next instruction is fetched.
- The address 20 is copied from the PC to the MAR and sent along the address bus 地址总线 to memory. The instruction stored at address 20 comes back along the data bus 数据总线 into the MDR, then is copied to the CIR.
- The PC goes up by 1, to 21, ready for the next fetch. The control unit then decodes the instruction in the CIR, and it is executed (the ALU does any calculation, with the result in the accumulator 累加器).
Which register holds the address of the next instruction to be fetched?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
The PC holds the next address and is incremented after each fetch.
Doubling the number of cores always makes every program run twice as fast.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
Only tasks that can be split between cores speed up, and the cores must share work and memory.
הבנתך מושלמת
- CPU = ALU (מתמטיקה/לוגיקה) + CU (אותות בקרה) + ריגיסטרים, הקשורים באמצעות Bus כתובת/נתונים/בקרה
- רגיסטרים עיקריים: PC (ההוראה הבאה), MAR/MDR (זיכרון), CIR (הנוכחית), ACC (התוצאה)
- המחזור: שאיבה → פירוש → ביצוע
- ביצועים: ליבות, גודל Cache, מהירות שעון; Cache = זיכרון מהיר סמוך למעבד
מה השתבש? רק צוות האתר רואה זאת.