AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

Logical operations

Lessons 4 · 1 lessons · B. Boltayev, A. Azamatov, A. Asqarov, M. Sodiqov, G. Azamatova. Fundamentals of Informatics and Computer Technology, Grade 8. Second edition. “O‘zbekiston milliy ensiklopediyasi” State Scientific Publishing House, Tashkent, 2015
4

Logical operations

Textbook: pp. 22–27
GoalKnows statements and the operations AND, OR and NOT, builds truth tables and evaluates logical expressions.
New words
statement: a declarative sentence that is either true or false · mulohazaconjunction (AND), written ∧: true only when both statements are true · mantiqiy ko‘paytirish (VA)disjunction (OR), written ∨: true when at least one statement is true · mantiqiy qo‘shish (YOKI)truth table: a table of all value combinations of the variables and the resulting value · rostlik jadvali
Explanation

A statement is a declarative sentence of which we can say that it is true or false; questions and commands are not statements. We denote statements by letters such as A and B, and true by 1 and false by 0. Compound statements are made from simple ones with the words AND, OR and NOT. The conjunction A ∧ B is true only when both statements are true (11→1, 10→0, 01→0, 00→0); the disjunction A ∨ B is true when at least one is true (11→1, 10→1, 01→1, 00→0); the negation ¬A reverses the value (¬1 = 0, ¬0 = 1). In an expression, brackets come first, then negation, then ∧, and finally ∨; operations of the same rank go from left to right. A truth table with n variables has 2ⁿ rows.

ABA ∧ BA ∨ B¬A
11110
10010
01011
00001
ABAND0ABF000010100111

F = A AND B → 0

The A and B buttons flip an input between 0 and 1

💡 Where will I use this?
In real life

The teacher stated a rule: “If you have both a notebook and a pen, we start the written work.” A pupil with a pen but no notebook could not start, because both parts of the condition had to be true.

Who uses it

Programmers write conditions, search-engine developers build queries with “and” and “or”, and accountants filter lists by a condition.

Try it today

Write an “if ... and ...” rule for three simple conditions from your day and list the cases in which it is true.

Worked examples
With A = 1, B = 0: A ∧ ¬B ∨ B. First ¬B = 1, then A ∧ ¬B = 1 ∧ 1 = 1, finally 1 ∨ B = 1 ∨ 0 = 1. Answer: 1.
AB¬A¬A ∨ B
1101
1000
0111
0011
Truth table of ¬A ∨ B. (A, B) = (1,1): ¬A = 0, 0 ∨ 1 = 1; (1,0): 0 ∨ 0 = 0; (0,1): 1 ∨ 1 = 1; (0,0): 1 ∨ 0 = 1. The result column: 1, 0, 1, 1.
Class activity

“True-false” game: the teacher says a sentence; pupils stand if it is true and sit if it is false. Then two sentences are joined with “AND” or “OR” and the class discusses how to react.

Practice
1
Which are statements: a) “Samarkand is a city in Uzbekistan.” b) “Close the door.” c) “12 is divisible by 5.” d) “How old are you?”
2
With A = 1, B = 0, C = 1 evaluate A ∨ B ∧ C.
3
With the same values evaluate ¬(A ∧ C) ∨ B.
4
Why does a truth table with three variables have 8 rows?
Story of the Week · The Khwarizmi WayWhy box B let the charge inClose the week: all of this week’s subjects in one storyRead →