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، ووحدة التحكم، والمسجلات، مترابطة بـ الناقلات.
- تشغيل كل برنامج عبر دورة الاستخراج والتنفيذ.
أجزاء CPU
- 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 (نتيجة ALU).
- تتكرر الدورة ثلاث مراحل: استخراج (نسخ التعليمات إلى CPU، ثم PC + 1) → ترجمة (تحديد CU لمعناها) → تنفيذ (إجرائه).

دورة الاستخراج-الترجمة-التنفيذ التي تكررها CPU لكل تعليمات
دورة جلب التنفيذ
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 هي كمية صغيرة من الذاكرة سريعة جداً قريبة من CPU، تحتفظ بالبيانات المستخدمة بكثرة — لتقليل انتظار CPU.
- يعتمد الأداء على عدد النوى، وحجم الذاكرة المؤقتة، وسرعة الساعة (الدورات في الثانية).
- نظام مدمج هو حاسوب صغير مُبنى داخل جهاز لأداء مهمة ثابتة واحدة (غسالة، ميكروويف).

Cache والذاكرة الرئيسية (RAM) تقعان قريباً من CPU لتزويده بالبيانات بسرعة


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 (إشارات تحكم) + مسجلات، مترابطة عبر ناقلات العنوان/البيانات/التحكم
- المسجلات الرئيسية: PC (التعليمات التالية)، MAR/MDR (الذاكرة)، CIR (الحالية)، ACC (النتيجة)
- الدورة: جلب ← فك تشفير ← تنفيذ
- الأداء: النواة، حجم الذاكرة المخبأة، سرعة التردد; الذاكرة المخبأة = ذاكرة سريعة قريبة من وحدة المعالجة المركزية
ما المشكلة؟ لا يرى ذلك سوى فريق الموقع.