الجبر البولياني ومخططات كارناوغ
مُقدَّم
8:05
تصميم المنطق الرقمي
Digital logic needs only two voltage levels, a handful of gates, and time. A three-input function has just eight rows, so checking every row is free, on paper…
سرد باللغة الإنجليزية · ترجمة نصية بالإنجليزية و中文 يمكنك التبديل بينهما
في هذا الدرس
| English | المعنى |
|---|---|
| Boolean algebra/ˈbuːlɪən ˈældʒɪbrə/ | الجبر البولياني |
| absorption/əbˈsɔːpʃn/ | قانون الامتصاص |
| De Morgan's theorem/də ˈmɔːɡənz ˈθɪərəm/ | قانون دي مورغان |
| Karnaugh map/ˈkɑːnɔː mæp/ | خريطة كارنو |
| don't-cares/dəʊnt keəz/ | الشروط غير المحددة |
One bulb, two switches
- A hallway light can be switched from either end of the hall. Flip either switch and the light changes state.
- That wiring is a logic function of two inputs, and the electrician built it without writing any algebra. This lesson gives the algebra and a map that simplifies it.
Boolean algebra
- Boolean algebra 布尔代数 works on 0 and 1 with AND ($A \cdot B$), OR ($A + B$) and NOT ($A'$). Most laws match ordinary algebra: $A \cdot (B + C) = A \cdot B + A \cdot C$.
- New ones shorten expressions. $A + A = A$, $A + A' = 1$, and absorption 吸收律: $A + A \cdot B = A$, because whenever $A \cdot B$ is 1, $A$ already is.
بسط A + A·B.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
امتصاص:.annotations $A \cdot B$ هو 1، فإن $A$ هو بالفعل 1، لذا لا يضيف الحد أي شيء. تحقق من الصفوف الأربعة في $A, B$ للتأكيد.
De Morgan: break the bar, change the sign
- De Morgan's theorem 德摩根定律 moves a NOT through a bracket: $(A \cdot B)' = A' + B'$ and $(A + B)' = A' \cdot B'$.
- It is how a NAND or NOR circuit is read. "Not both" is the same as "at least one is off".
The hallway light is the XOR: $F = A' \cdot B + A \cdot B'$. It is 1 exactly when the two switches differ, so flipping either one changes $F$:
| Switch A | Switch B | Light F |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
طابق كل تعبير مع ما يساويه.
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
دي مورغان: كسر الخط وتغيير الإشارة. المتغير المُجمَّع مع مكمِّله هو دائمًا 1؛ ومُضروب فيه هو دائمًا 0.
The Karnaugh map
- A Karnaugh map 卡诺图 lays out the truth table so that neighbouring cells differ in exactly one variable. The columns run 00, 01, 11, 10 (Gray-code order), and the edges wrap round.
- Circle 1s in rectangles of 1, 2, 4 or 8 cells. A group of $2^{k}$ cells removes $k$ variables: only the variables that stay constant across the group survive.
مجموعة من أربع خلايا في خريطة كارنوف تحافظ على أي متغيرات؟
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
المتغير الذي يأخذ قيمتين داخل المجموعة لا يمكنه التمييز بين الخلايا، لذا يتم استبعادها. مجموعة الصفوف الفردية تحتفظ بـ C فقط لأن A و B يتغيران بداخلها.
في خريطة كارنو ذات أربعة متغيرات، تترك مجموعة 8 خلايا كم عدد المتغيرات في حد الضرب الخاص بها؟
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
تزيل $8 = 2^{3}$ خلايا 3 من 4 متغيرات، تاركة حرفًا واحدًا، على سبيل المثال $D$ وحدها.
Worked example: the odd rows
- $F = \sum m(1, 3, 5, 7)$ is 1 on the odd rows of a three-variable table: exactly the rows where $C = 1$.
- On the map the four cells form one group. $A$ and $B$ both change inside it, so they drop out and $F = C$. Check all 8 rows: it matches.

تُقرأ مجموعة كارنوف لـ Σm(1, 3, 5, 7) للمتغيرات A, B, C على النحو التالي —
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
الصفوف الفردية هي بالضبط صفوف C = 1: مجموعة واحدة من أربع تزيل A و B. يؤكد التحقق من صف 8 أن F = C.
Don't-cares
- Some input combinations never happen, such as codes 10 to 15 on a decimal digit. Mark them as don't-cares 无关项 (X) on the map.
- An X may join a group to make it bigger, which removes more variables. Never circle Xs on their own: they need no output.
يجب إضافة مجموعة تتكون فقط من خلايا "لا يهم" إلى التعبير المبسط.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
لا تحتاج الحالات غير المحددة إلى مخرجات. قد تنضم إلى مجموعة من 1s لتوسيعها، لكن مجموعة Xs وحدها تضيف بوابات إضافية فقط.
Worked example: four-input majority
- $M$ is 1 when at least three of $A, B, C, D$ are 1: minterms 7, 11, 13, 14 and 15, the codes with three or four 1s.
- Four overlapping pairs give $M = A \cdot B \cdot C + A \cdot B \cdot D + A \cdot C \cdot D + B \cdot C \cdot D$, which factors to $M = A \cdot B \cdot (C + D) + C \cdot D \cdot (A + B)$.
- Checking all 16 rows against "count ≥ 3" agrees everywhere, and the factored form needs fewer gates than five separate minterms.
دالة الأغلبية للمتغير 4 (تكون 1 عندما يكون على الأقل 3 من المدخلات 1) تحتوي على حدود صغرى —
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
عدّ 1s في كل كود 4-بت: 0111 (7)، 1011 (11)، 1101 (13)، 1110 (14)، 1111 (15) هيCodes التي تحتوي على ثلاثة أو أربعة 1s. مبسطة: $AB(C+D) + CD(A+B)$، تم التحقق منها في جميع صفوف 16.
Three common slips
- Grouping diagonally. Groups must be rectangles of $2^{k}$ cells; diagonal neighbours differ in two variables.
- Keeping a changing variable. If a variable is 0 in some cells of the group and 1 in others, it drops out.
- Not checking. With 8 or 16 rows, an exhaustive check takes a minute and catches every grouping error.
خريطة كارنو لـ XOR A'·B + A·B' لا تحتوي على أي 1s متجاورين، لذا لا يمكن تبسيطها إلى عدد أقل من حدود الضرب.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
تقع 1s الخاصة بها عند 01 و 10، وهما يختلفان في كلا المتغيرين: قطري، غير متجاور. يبقى XOR كحدين، ولهذا السبب يحصل على بوابة خاصة به.
Recap
- Absorption and De Morgan shorten expressions: break the bar, change the sign.
- K-map groups are rectangles of $2^{k}$ cells in Gray order; a group keeps only its constant variables.
- Don't-cares enlarge groups but never form one; verify every result on the full table.
ما المشكلة؟ لا يرى ذلك سوى فريق الموقع.