Difference between revisions of "CSC103: DT's Notes 1"

From dftwiki3
Jump to: navigation, search
Line 122: Line 122:
 
Back to the alarm example.  Assume that we have the same ''a'' and ''b'' boolean variables as previously, on that is true on Saturdays only and one that is true on Sundays only.  How could we make this alarm go off for any weekday and not on weekends?  We could simply say that we want the opposite of the alarm we had to see if we can stay in bed on weekends.  So that would be '''not''' ( ''a'' '''or''' ''b'' ).
 
Back to the alarm example.  Assume that we have the same ''a'' and ''b'' boolean variables as previously, on that is true on Saturdays only and one that is true on Sundays only.  How could we make this alarm go off for any weekday and not on weekends?  We could simply say that we want the opposite of the alarm we had to see if we can stay in bed on weekends.  So that would be '''not''' ( ''a'' '''or''' ''b'' ).
  
 +
For completeness we should show the truth table for the not operator.  It's pretty straightforward, and shown below:
  
 +
{| border="1" cellpadding="10" cellspacing="0"
 +
! a
 +
! '''not''' a
 +
|-
 +
|
 +
F
 +
|
 +
T
 +
|-
 +
|
 +
T
 +
|
 +
F
 +
|}
  
  

Revision as of 20:48, 30 January 2012

--© D. Thiebaut 08:10, 30 January 2012 (EST)


This section is only visible to computers located at Smith College