Presentation is loading. Please wait.

Presentation is loading. Please wait.

EVALUATING BASIC LOGIC STATEMENTS INTRO TO SYSTEM DESIGN.

Similar presentations


Presentation on theme: "EVALUATING BASIC LOGIC STATEMENTS INTRO TO SYSTEM DESIGN."— Presentation transcript:

1 EVALUATING BASIC LOGIC STATEMENTS INTRO TO SYSTEM DESIGN

2 What is a Statement? – a meaningful, declarative sentence that can only be either true or false. Examples of sentences that are (or make) statements: STATEMENTEVALUATES AS: "Socrates is a man."TRUE "A triangle has three sides."TRUE "Paris is the capital of Spain."FALSE x = 6TRUE (only if there are 6 ‘x’s) The first two (make statements that) are true, the third is (or makes a statement that is) false, the fourth is an evaluative statement (assigns a value).

3 There are only 2 possible logic states: True = ON, HI, YES, CLOSED, NOT FALSE, any integer greater than 0 False = OFF, LO, NO, OPEN, NOT TRUE, zero

4 Not all sentences are statements… Examples of sentences that are not (or do not make) statements: "Who are you?" "Run!" "Greenness walks slowly." "I had one cucumber but the eggplant over there." "The King of France is wise." "Pegasus exists."

5 EXPRESSIONS: Evaluating logical statements always occurs by comparing 2 statements in an EXPRESSION: AND – the expression evaluates to TRUE only if both statements are TRUE OR – the expression evaluates to TRUE only if either statement is TRUE NAND – the expression evaluates to TRUE only if neither statement is TRUE (This is called an inverse statement) NOR – the expression evaluates to TRUE only if neither statement is TRUE NOT – the expression always evaluates as the OPPOSITE of the statement. This is not an evaluative or comparative statement. It is called a LOGIC INVERTER.

6 Truth Table A truth table is composed of one column for each input variable (for example, A and B), and one final column for all of the possible results of the logical operation that the table is meant to represent. Each row of the truth table contains one possible configuration of the input variables (for instance, A=true B=false), and the result of the operation for those values.

7 ANDORNAND INPUTOUTPUTINPUTOUTPUTINPUTOUTPUT ABA AND BAB AB 000000001 100101100 010011010 111111110 NORNOT INPUTOUTPUTINPUTOUTPUT ABA AND BA A 0010 1 1001 0 010 110

8 Conditional Expressions the input conditions in the expression must be either TRUE or FALSE (depending on the expression) in order for the output condition to be evaluated as either TRUE or FALSE. Conditional expressions are always written as IF (STATEMENT A) LOGICAL OPERATOR (STATEMENT B) THEN (OUTPUT) REMEMBER: Statement A and Statement B can only be evaluated to TRUE or FALSE and the OUTPUT will only evaluate to TRUE or FALSE, depending on the operator.


Download ppt "EVALUATING BASIC LOGIC STATEMENTS INTRO TO SYSTEM DESIGN."

Similar presentations


Ads by Google