Making Decision
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Understanding NOT Logic

+20
WiezKhalifa
Asdfghjkl
Jung kook
JULIAN P.A
Ferre
Emie Ligutan
Admin
RicManipon
nyela
ilovebts
Pox
Lawrence
iramae
althea faye
James Navarro
LouiseSebastianeYagi
Sean Monacillo
Luwiezz
niella
justjoking10
24 posters
Go down
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Understanding NOT Logic

Wed Jul 25, 2018 9:06 am
Using the NOT operator

We use the logical NOT operator to reverse the meaning of a Boolean expression. For example, the following statement outputs Can register to vote when age is greater than or equal to 18:

if NOT (age < 18) then
    output "Can register to vote"
endif

This example uses parentheses around the expression age < 18 to show that the NOT operator applies to the entire Boolean expression age < 18. Without the parentheses, some languages might try to evaluate the expression NOT age before testing the less-than comparison. Depending on the programming language, the result would either be incorrect or the statement would not execute at all Quick Reference 1-1 contains the truth table for the NOT operator. As you can see, any expression that would be true without the operator becomes false with it, and any expression that would be false without the operator becomes true with it.


Understanding NOT Logic Nottt11
Quick Reference 1-1 NOT Logic Truth Table

You have already learned that arithmetic operators such as + and –, and relational operators such as > and <, are binary operators that require two operands. Unlike those operators, the NOT operator is a unary operator, meaning it takes only one operand—that is, you do not use it between two expressions, but you use it in front of a single expression. As when using the binary not-equal-to comparison operator, using the unary NOT operator can create confusing statements because negative logic is difficult to follow. For example, if your intention is not to allow voter registration for those under 18, then either of the following two statements will accomplish your goal, but the second one is easier to understand:

if NOT (age < 18) then
     output "Can register to vote"
endif

if age >= 18 then
     output "Can register to vote"
endif


Logic Example

Understanding NOT Logic Centra11
Figure 1-1 A Central Heating System installed inside a house.

For example consider  x is 0 when temperature is low, and it is 1 when temperature gets high.

Let's see how the Central Heating system behaves, by the way Central Heating gives more heat to your home when turned on. See the truth table below.


Understanding NOT Logic Notttt10

Did you UNDERSTAND NOT LOGIC?
If yes, would you please give different example/application of it?
        else comment down below your reactions/questions.
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding NOT Logic Empty Re: Understanding NOT Logic

Wed Aug 01, 2018 7:05 pm
Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Wed Aug 01, 2018 7:16 pm
justjoking10 wrote:Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
There's two type of programming, a positive logic and negative logic. If your'e negative logic, this is what you use often. I can tell you that looping is where negative logic is most applied.
avatar
justjoking10
Guru
Posts : 19
Join date : 2018-08-01

Understanding NOT Logic Empty Re: Understanding NOT Logic

Wed Aug 01, 2018 7:34 pm
I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 7:27 am
justjoking10 wrote:I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
Not sure if it's called neutral.  But yeah you can use both in a program.
niella
niella
Posts : 1
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 9:29 am
Admin wrote:
justjoking10 wrote:I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
Not sure if it's called neutral.  But yeah you can use both in a program.

most programmers use NEGATIVE logic because for them when it's not , okay it's not and then end! Cool
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 9:31 am
niella wrote:
Admin wrote:
justjoking10 wrote:I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
Not sure if it's called neutral.  But yeah you can use both in a program.

most programmers use NEGATIVE logic because for them when it's not , okay it's not and then end! Cool
Daniella. Is it like "If you don't like you can''t have it." Very Happy
LouiseSebastianeYagi
LouiseSebastianeYagi
Guru
Posts : 18
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 4:55 pm
Sir, is it possible to use and, or, not logic in a program? If it is, will it function properly?

Sent from Topic'it App
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 6:02 pm
LouiseSebastianeYagi wrote:Sir, is it possible to use and, or, not logic in a program? If it is, will it function properly?

Sent from Topic'it App
Yes it will, if it is logically right.
LouiseSebastianeYagi
LouiseSebastianeYagi
Guru
Posts : 18
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 6:43 pm
Sir may instance po na may mga ganung type ng logic?

Sent from Topic'it App
avatar
Luwiezz
Newbie
Posts : 3
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 6:50 pm
Using the NOT logic makes the flowchart or the code clear. With this logic, I think I am able to create a program properly
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 7:38 pm
LouiseSebastianeYagi wrote:Sir may instance po na may mga ganung type ng logic?

Sent from Topic'it App
This flowchart is a combination of AND and OR Logic. You can incorporate NOT logic or make it to negative logic. How? That's for you to know, can you do it?
Understanding NOT Logic 210
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:21 pm
LouiseSebastianeYagi wrote:Sir, is it possible to use and, or, not logic in a program? If it is, will it function properly?

Yes, oo naman pre as long as maganda yung pagkakagawa mo sa program mo tsaka tama .

Sent from Topic'it App
LouiseSebastianeYagi
LouiseSebastianeYagi
Guru
Posts : 18
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:22 pm
Sa paanong instance nangyayari yun. Oo tama siya pero paano maiaapply yun? Saan?

Sent from Topic'it App
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:24 pm
justjoking10 wrote:I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
di ko gets yung sa neutral pre pero pwede talaga gumamit ng POSITIVE LOGIC at NEGATIVE LOGIC sa program na gagawin. basta tama lang yung condition na dapat mameet

Sent from Topic'it App
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:27 pm
LouiseSebastianeYagi wrote:Sa paanong instance nangyayari yun. Oo tama siya pero paano maiaapply yun? Saan?

Sa tingin ko dipende yun sa problem. wala naman atang instance na gagawin yun sa ganito lang or ganyan. Nasa Programmer kasi yung kung paano niya iintindihin yung logic niya sa paggawa niya ng program. Maiaapply mo yun dipende sa condition na gusto mo mameet

Sent from Topic'it App
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:28 pm
Luwiezz wrote:Using the NOT logic makes the flowchart or the code clear. With this logic, I think I am able to create a program properly
kaso nakakalito talaga pre pag positive thinker ka 😂 sanayan lang siguro if saan comfortable

Sent from Topic'it App
LouiseSebastianeYagi
LouiseSebastianeYagi
Guru
Posts : 18
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:30 pm
Ayun na nga. Pero if possible nga, may instance ba na may nakagawa na nun?

Sent from Topic'it App
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:32 pm
justjoking10 wrote:Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
I think pre it's up to the programmer nalang kung paano yung takbo ng isip niya sa logic niya. meron din kasi Both eh na kaya mag isip ng positive logic tsaka negative logic. kaya wala naman at sinabi na kung kelan lang siya pwede gamitin sa pagkaka alam ko anytime naman pwede siya gamitin .

Sent from Topic'it App
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:34 pm
LouiseSebastianeYagi wrote:Ayun na nga. Pero if possible nga, may instance ba na may nakagawa na nun?

Possible pre na may nakagawa na nun . Yung mga malulupit siguro mag isip hahaha 😂

Sent from Topic'it App
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:34 pm
Sean Monacillo wrote:
justjoking10 wrote:I see Sir. Thank you. But is there a neutral type of programmer? I mean uses positive logic and negative logic in one program?
di ko gets yung sa neutral pre pero pwede talaga gumamit ng POSITIVE LOGIC at NEGATIVE LOGIC sa program na gagawin. basta tama lang yung condition na dapat mameet

Sent from Topic'it App
Again Im not sure if "neutral" is used as a term in proogramming, but yes you can utilize both NEGATIVE and POSITIVE Logic in one program.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:37 pm
Sean Monacillo wrote:
justjoking10 wrote:Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
I think pre it's up to the programmer nalang kung paano yung takbo ng isip niya sa logic niya. meron din kasi Both eh na kaya mag isip ng positive logic tsaka negative logic. kaya wala naman at sinabi na kung kelan lang siya pwede gamitin sa pagkaka alam ko anytime naman pwede siya gamitin .

Sent from Topic'it App
Sean got the point. Use what logic you want as long as it is working its good. But as an advanced programmer you might be conscious about using POSITIVE nor NEGATIVE Logic because you want your program to be structured.
avatar
Sean Monacillo
Guru
Posts : 19
Join date : 2018-08-02

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:40 pm
Admin wrote:
Sean Monacillo wrote:
justjoking10 wrote:Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
I think pre it's up to the programmer nalang kung paano yung takbo ng isip niya sa logic niya. meron din kasi Both eh na kaya mag isip ng positive logic tsaka negative logic. kaya wala naman at sinabi na kung kelan lang siya pwede gamitin sa pagkaka alam ko anytime naman pwede siya gamitin .

Sean got the point. Use what logic you want as long as it is working its good. But as an advanced programmer you might be conscious about using POSITIVE nor NEGATIVE Logic because you want your program to be structured.
Thank you po sir ! 😊 . pero sir pwede naman po siguro na stick nalang po sa positive logic or negative logic sir ? Am I right po ba sir ?



Last edited by Sean Monacillo on Thu Aug 02, 2018 8:43 pm; edited 1 time in total
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:41 pm
Luwiezz wrote:Using the NOT logic makes the flowchart or the code clear. With this logic, I think I am able to create a program properly

Good to know that you have used NOT Logic. Enjoy programming! Long way to go.
Admin
Admin
Admin
Posts : 132
Join date : 2018-07-25
https://jmdomain.forumotion.com

Understanding NOT Logic Empty Re: Understanding NOT Logic

Thu Aug 02, 2018 8:43 pm
Sean Monacillo wrote:
Admin wrote:
Sean Monacillo wrote:
justjoking10 wrote:Sir. When should we use the NOT Logic? Because I think it is more convenient for most of us not to use it.
I think pre it's up to the programmer nalang kung paano yung takbo ng isip niya sa logic niya. meron din kasi Both eh na kaya mag isip ng positive logic tsaka negative logic. kaya wala naman at sinabi na kung kelan lang siya pwede gamitin sa pagkaka alam ko anytime naman pwede siya gamitin .

Sean got the point. Use what logic you want as long as it is working its good. But as an advanced programmer you might be conscious about using POSITIVE nor NEGATIVE Logic because you want your program to be structured.
Thank you po sir ! 😊 . pero sir pwede naman po siguro na stick nalang po sa positive logic sir ? Am I right po ba sir ?

Sent from Topic'it App
You'll never know. Change is Constant. Otherwise, you'll experience it whether to use POSITIVE nor NEGATIVE Logic in your future programming.
Sponsored content

Understanding NOT Logic Empty Re: Understanding NOT Logic

Back to top
Permissions in this forum:
You cannot reply to topics in this forum