1 / 8

EVALUATING BASIC LOGIC STATEMENTS

EVALUATING BASIC LOGIC STATEMENTS. INTRO TO SYSTEM DESIGN. What is a Statement?. – a meaningful, declarative sentence that can only be either true or false. Examples of sentences that are (or make) statements : STATEMENT EVALUATES AS: "Socrates is a man." TRUE

cassia
Download Presentation

EVALUATING BASIC LOGIC STATEMENTS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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: • STATEMENT EVALUATES AS: • "Socrates is a man." TRUE • "A triangle has three sides." TRUE • "Paris is the capital of Spain." FALSE • x = 6 TRUE (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. 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.

More Related