Skip to content · ⁨الانتقال إلى المحتوى⁩

Boolean logic · ⁨المنطق البولياني⁩

IGCSE Computer Science · ⁨IGCSE علوم الحاسوب⁩ · Topic 10 · ⁨الموضوع 10⁩

Video lesson for this topic · ⁨درس فيديو لهذا الموضوع⁩ Open the video page · ⁨افتح صفحة الفيديو⁩
8:37

المنطق البولياني

انظر عن قرب إلى هذه الشريحة. لا يوجد فيها شيء ذكي. لا يمكنها التفكير. بداخلها ملايين المفاتيح الصغيرة جداً، وكل مفتاح يمكن أن يكون واحداً من اثنين فقط…

English narration · English + 中文 subtitles burned in · ⁨سرد باللغة الإنجليزية · ترجمة مدمجة بالإنجليزية + الصينية⁩

Syllabus · ⁨المنهج⁩
English
Candidates should be able to: Notes and guidance
1 Identify and use the standard symbols for logic gates • See section 4 for logic gate symbols
2 Define and understand the functions of logic gates • Including: – NOT – AND – OR – NAND – NOR – XOR (EOR) – the binary output produced from all the possible binary inputs • NOT is a single input gate • All other gates are limited to two inputs
3 (a) Use logic gates to create given logic circuits from a: (i) problem statement (ii) logic expression (iii) truth table (b) Complete a truth table from a: (i) problem statement (ii) logic expression (iii) logic circuit • Circuits must be drawn for the statement given, without simplification • Logic circuits will be limited to a maximum of three inputs and one output • An example truth table with three inputs, for completion: A B C Output | 0 0 0 | 0 0 1 | 0 1 0 | 0 1 1 | 1 0 0 | 1 0 1 | 1 1 0 | 1 1 1
(c) Write a logic expression from a: (i) problem statement (ii) logic circuit (iii) truth table
العربية
يجب أن يكون المرشحون قادرين على: ملاحظات وإرشادات
1 تحديد واستخدام الرموز القياسية للأبواب المنطقية • انظر القسم 4 لرمز الأبواب المنطقية
2 تعريف وفهم وظائف الأبواب المنطقية • بما في ذلك: – NOT – AND – OR – NAND – NOR – XOR (EOR) – المخرجات الثنائية الناتجة عن جميع المدخلات الثنائية الممكنة • NOT بوابة ذات مدخل واحد فقط • جميع الأبواب الأخرى محدودة بمدخلين
3 (أ) استخدام الأبواب المنطقية لإنشاء دوائر منطقية محددة من: (i) نص المشكلة (ii) التعبير المنطقي (iii) جدول الحقيقة (ب) إكمال جدول الحقيقة من: (i) نص المشكلة (ii) التعبير المنطقي (iii) دائرة منطقية • يجب رسم الدوائر بناءً على النص المعطى، بدون تبسيط • ستكون الدوائر المنطقية محدودة بحد أقصى ثلاثة مدخلات ومخرج واحد • مثال على جدول حقيقة بثلاثة مدخلات لإكماله: A B C Output | 0 0 0 | 0 0 1 | 0 1 0 | 0 1 1 | 1 0 0 | 1 0 1 | 1 1 0 | 1 1 1
(ج) كتابة تعبير منطقي من: (i) نص المشكلة (ii) دائرة منطقية (iii) جدول الحقيقة

Source: Cambridge International syllabus · ⁨المصدر: منهج كامبريدج الدولي⁩

10.1

What is Boolean logic? · ⁨ما هي المنطق البولياني؟⁩

English

Boolean logic 布尔逻辑 works with values that are either true or false. In electronics these are shown as 1 (true) and 0 (false). A logic gate 逻辑门 takes one or more of these inputs and gives one output, following a fixed rule.

A truth table 真值表 lists every possible set of inputs and the output for each. You build it by writing out all the input combinations.

العربية

المنطق البولياني يعمل مع قيم إما صحيحة أو خاطئة. في الإلكترونييات، تُعرض هذه كـ 1 (صحيح) و0 (خاطئ). البوابة المنطقية تأخذ مدخلًا واحدًا أو أكثر وتعطي مخرجًا واحدًا، وفق قاعدة ثابتة.

جدول الحقيقة يسرد كل مجموعة ممكنة من المدخلات والمخرج المقابل لكل منها. يتم بناؤه بكتابة جميع تركيبات الإدخال.

دائرة إلكترونية مبنية على لوحة تجارب
تُبنى البوابات المنطقية من دوائر إلكترونية مثل هذه الدائرة، حيث تقوم كل بوابة بتشغيل 1s و 0s
10.2

The six logic gates · ⁨الست بوابات المنطقية⁩

English
A logic circuit in action: the half adder

You must know six gates. NOT has one input; all the others have two inputs (A and B).

NOT gate

The NOT gate 非门 reverses the input. Output is 1 when the input is 0.

A Output
0 1
1 0

AND gate

The AND gate 与门 gives output 1 only when both inputs are 1.

A B Output
0 0 0
0 1 0
1 0 0
1 1 1

OR gate

The OR gate 或门 gives output 1 when at least one input is 1.

A B Output
0 0 0
0 1 1
1 0 1
1 1 1

NAND gate

The NAND gate 与非门 is AND followed by NOT. The output is the opposite of AND.

A B Output
0 0 1
0 1 1
1 0 1
1 1 0

NOR gate

The NOR gate 或非门 is OR followed by NOT. The output is the opposite of OR.

A B Output
0 0 1
0 1 0
1 0 0
1 1 0

XOR gate

The XOR gate 异或门 (exclusive OR) gives output 1 when the inputs are different.

A B Output
0 0 0
0 1 1
1 0 1
1 1 0
العربية
دائرة منطقية تعمل: المضاف النصف

يجب أن تعرف ست بوابات. NOT لها مدخل واحد؛ جميع الباقات الأخرى لها مدخلان (A و B).

رموز البوابات المنطقية الست — NOT، AND، OR، NAND، NOR و XOR — كل منها بمدخلات مسماة ومخرج واحد
البوابات المنطقية الست. دائرة صغيرة على المخرج تعني أن النتيجة معكوسة (NOT، NAND، NOR)
ثلاثة رقائق حاسوب سوداء صغيرة ذات صفوف من المسامير المعدنية، مطبوع عليها كل منها رمز
شريحة منطقية حقيقية: داخلها توجد أبواب منطقية مثل تلك الموجودة في هذه الصفحة

بوابة NOT

بوابة NOT تعكس المدخل. المخرج يكون 1 عندما يكون المدخل 0.

A Output
0 1
1 0

بوابة AND

بوابة AND تعطي مخرج 1 فقط عندما يكون كلا المدخلين 1.

جدول حقيقة لبوابة AND: فقط 1 AND 1 يعطي 1
AND يعطي 1 فقط عندما يكون كلا المدخلين 1
A B Output
0 0 0
0 1 0
1 0 0
1 1 1

بوابة OR

بوابة OR تعطي مخرج 1 عندما يكون على الأقل أحد المدخلات 1.

جدول حقيقة لبوابة OR: 0 OR 0 يعطي 0، والباقي يعطي 1
OR يعطي 1 عندما يكون أي من المدخلين 1
A B Output
0 0 0
0 1 1
1 0 1
1 1 1

بوابة NAND

بوابة NAND هي AND متبوعة بـ NOT. المخرج هو عكس AND.

A B Output
0 0 1
0 1 1
1 0 1
1 1 0

بوابة NOR

بوابة NOR هي OR متبوعة بـ NOT. المخرج هو عكس OR.

A B Output
0 0 1
0 1 0
1 0 0
1 1 0

بوابة XOR

بوابة XOR (OR الحصري) تعطي مخرج 1 عندما تكون المدخلات مختلفة.

A B Output
0 0 0
0 1 1
1 0 1
1 1 0
Explore · ⁨استكشف⁩

The logic gates · ⁨البوابات المنطقية⁩

Switch the inputs and pick a gate to see its output — AND, OR, NOT, NAND, NOR, XOR. · ⁨غيّر المدخلات واختر بوابة لرؤية مخرجاتها — AND، OR، NOT، NAND، NOR، XOR.⁩

Vocabulary · ⁨مفردات⁩ Train · ⁨تدريب⁩
English العربية
Boolean logic/ˈbuːlɪən ˈlɒdʒɪk/ المنطق البولياني
logic gate/ˈlɒdʒɪk ɡeɪt/ بوابة منطقية
truth table/truːθ ˈteɪbl/ جدول الحقيقة
NOT gate/nɒt ɡeɪt/ بوابة NOT
AND gate/ænd ɡeɪt/ بوابة AND
OR gate/ɔː ɡeɪt/ بوابة OR
NAND gate/nænd ɡeɪt/ بوابة NAND
NOR gate/nɔː ɡeɪt/ بوابة NOR
XOR gate/ˈeksɔː ɡeɪt/ بوابة XOR
logic expression/ˈlɒdʒɪk ekˈspreʃn/ تعبير منطقي
10.3

Logic expressions · ⁨تعبيرات منطقية⁩

English

A logic expression 逻辑表达式 writes a circuit using letters and gate words. The usual way to write the gates:

Gate In words
NOT A NOT A
A AND B A AND B
A OR B A OR B

For example, the expression (A AND B) OR (NOT C) means: do A AND B, do NOT C, then OR the two results together.

العربية

التعبير المنطقي يكتب دائرة باستخدام أحرف وكلمات البوابات. الطريقة المعتادة لكتابة الباقات:

Gate In words
NOT A NOT A
A AND B A AND B
A OR B A OR B

على سبيل المثال، التعبير (A AND B) OR (NOT C) يعني: قم بـ A AND B، ثم قم بـ NOT C، ثم اجمع نتيجتيهما معًا عبر OR.

التعبير X يساوي A AND B OR NOT C مرسوماً كدائرة: بوابة AND تأخذ A و B، وبوابة NOT تأخذ C، وبوابة OR تجمع الاثنين في المخرج X
التعبير X = (A AND B) OR (NOT C) مرسوماً كدائرة منطقية
Explore · ⁨استكشف⁩

Truth tables · ⁨جداول الحقيقة⁩

Build the truth table for AND, OR, XOR and NOT — the logic behind every expression. · ⁨بني جدول الحقيقة لـ AND، OR، XOR و NOT — المنطق الكامن وراء كل تعبير.⁩

10.4

Logic circuits · ⁨دوائر المنطق⁩

English

A logic circuit 逻辑电路 joins gates together to carry out a task. The output of one gate can become the input of another. At IGCSE a circuit has up to three inputs and one output.

You must be able to move between four forms:

  • a problem statement 问题陈述 (a description in words),
  • a logic expression,
  • a logic circuit,
  • a truth table.

From a problem statement to a circuit

Read the statement and pick out the conditions and the logic words (and, or, not). For example:

An alarm (X) sounds when the door is open (A) AND the system is switched on (B).

This is X = A AND B, so you draw one AND gate with inputs A and B.

Completing a truth table from a circuit or expression

To fill in a truth table:

  1. Write all the input combinations. For three inputs there are 8 rows (000 up to 111).
  2. Work out each gate's output in order, one column at a time.
  3. The last column is the final output.
A B C A AND B (A AND B) OR C
0 0 0 0 0
0 0 1 0 1
0 1 0 0 0
0 1 1 0 1
1 0 0 0 0
1 0 1 0 1
1 1 0 1 1
1 1 1 1 1

Adding a middle "working" column for each gate makes the final output easy to fill in. Always draw the circuit exactly as the statement says, without simplifying it.

Worked example. Complete the truth table for X = (A AND B) OR (NOT C) for the row A = 1, B = 0, C = 0. Work outwards from the brackets, one gate at a time. First A AND B = 1 AND 0 = 0, because AND needs both inputs to be 1. Next NOT C = NOT 0 = 1. Finally OR the two results: 0 OR 1 = 1. So X = 1. Give each intermediate gate its own column rather than trying to do the whole expression in one step: with three inputs there are $2^3 = 8$ rows, and those intermediate columns are where the method marks live even if the final answer slips.

العربية

الدائرة المنطقية تربط الباقات معاً لأداء مهمة. مخرج بوابة واحدة يمكن أن يصبح مدخلًا لبوابة أخرى. في IGCSE، الدائرة تحتوي على ما يصل إلى ثلاثة مدخلات ومخرج واحد.

دائرة منطقية: بوابة AND تأخذ المدخلات A و B تغذي مدخلًا واحدًا من بوابة OR whose other input is C، مما يعطي المخرج X
بناء الدائرة لـ X = (A AND B) OR C — مخرج بوابة AND يغذي بوابة OR

يجب أن تكون قادراً على الانتقال بين أربعة أشكال:

  • بيان المشكلة (وصف نصي)،
  • تعبير منطقي،
  • دائرة منطقية،
  • جدول حقيقة.

من بيان المشكلة إلى دائرة

اقرأ البيان واستخرج الشروط والكلمات المنطقية (and, or, not). على سبيل المثال:

إنذار (X) يعمل عندما تكون الباب مفتوحة (A) AND النظام مفعل (B).

هذا هو X = A AND B، لذا ترسم بوابة AND واحدة بمدخلات A و B.

إكمال جدول حقيقة من دائرة أو تعبير

لملء جدول حقيقة:

  1. اكتب جميع تركيبات الإدخال. بالنسبة لثلاثة مدخلات، يوجد 8 صفوف (000 حتى 111).
  2. احسب مخرج كل بوابة بالترتيب، عمودًا تلو الآخر.
  3. العمود الأخير هو المخرج النهائي.
ثلاثة مدخلات تعطي 2 × 2 × 2 = 8 صفوف؛ تم سرد التركيبات الثمانية بالعد التصاعدي بالنظام الثنائي من 000 إلى 111، مع قلب العمود الأخير في كل صف
ثلاثة مدخلات تعطي 8 صفوف: كل تركيبة معدة بالنظام الثنائي
A B C A AND B (A AND B) OR C
0 0 0 0 0
0 0 1 0 1
0 1 0 0 0
0 1 1 0 1
1 0 0 0 0
1 0 1 0 1
1 1 0 1 1
1 1 1 1 1

إضافة عمود وسيط "عمل" لكل بوابة يجعل تعبئة المخرج النهائي سهلة. ارسم الدائرة دائمًا كما يقول البيان، بدون تبسيطها.

مثال محلول. أكمل جدول الحقيقة لـ X = (A AND B) OR (NOT C) للصف A = 1, B = 0, C = 0. احسب خارج الأقواس، بوابة واحدة في كل مرة. أولاً A AND B = 1 AND 0 = 0، لأن AND يتطلب أن يكون كلا المدخلين 1. ثم NOT C = NOT 0 = 1. أخيراً، اجمع النتيجتين باستخدام OR: 0 OR 1 = 1. إذن X = 1. خصص لكل بوابة متوسطة عموداً خاصاً بها بدلاً من محاولة حساب التعبير بأكمله في خطوة واحدة: مع ثلاثة مدخلات هناك $2^3 = 8$ صفوف، وتلك الأعمدة المتوسطة هي حيث تكمن قيمة الطريقة حتى لو أخطأت الإجابة النهائية.

Vocabulary · ⁨مفردات⁩ Train · ⁨تدريب⁩
English العربية
logic circuit/ˈlɒdʒɪk ˈsɜːkɪt/ دائرة منطقية
problem statement/ˈprɒbləm ˈsteɪtmənt/ بيان المشكلة
10.5

Exam tips · ⁨نصائح للامتحان⁩

English
  • Learn all six gates and their truth tables: NOT, AND, OR, NAND (NOT AND), NOR (NOT OR), XOR (output 1 when the inputs are different).
  • Build a truth table with all input rows (2 inputs → 4 rows, 3 inputs → 8), counting up in binary, and add a working column for each gate.
  • Turn a problem statement into a logic expression by picking out the AND / OR / NOT words, then draw it exactly as written — do not simplify it.
  • NAND and NOR give the opposite output to AND and OR; a small circle on a gate's output means the result is inverted.
العربية
  • احفظ جميع الأبواب الستة وجداول حقيتها: NOT، AND، OR، NAND (NOT AND)، NOR (NOT OR)، XOR (يُخرج 1 عندما تكون المدخلات مختلفة).
  • بنِ جدول صدق مع جميع صفوف المدخلات (2 مدخلات → 4 صفوف، 3 مدخلات → 8)، بالعد الثنائي، وأضف عملاً عملياً لكل بوابة.
  • حول نص المشكلة إلى تعبير منطقي عن طريق تحديد كلمات AND / OR / NOT، ثم ارسمه تماماً كما كُتب — لا تبسطه.
  • NAND و NOR يعطيان نتيجة عكسية لـ AND و OR؛ الدائرة الصغيرة على مخرج البوابة تعني أن النتيجة معكوسة.

Interactive lessons on this topic · ⁨دروس تفاعلية حول هذا الموضوع⁩

Work through it step by step, with instant-check exercises. · ⁨ا-working عليه خطوة بخطوة، مع تمارين تحقق فوري.⁩

Past Papers · ⁨أوراق الامتحانات السابقة⁩

More topics in IGCSE Computer Science · ⁨IGCSE علوم الحاسوب⁩ · ⁨المزيد من المواضيع في IGCSE Computer Science · ⁨IGCSE علوم الحاسوب⁩⁩

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP