LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does implies funciton works?

Solved!
Go to solution

When I give 110 as x input and 1 as y input I am getting the output as 11111111111111111111111111111001 i.e 11001

 

But actually negation of 110 is 001; 001+ 1 is 010

 

Why I am getting the output as 11111111111111111111111111111001

 

Kind Regards,

Rashme SR

0 Kudos
Message 11 of 14
(1,235 Views)
Solution
Accepted by topic author Rashme_SR

Your math is wrong.  0b110 inverted is 0b001, then the logical OR of 0b001 and 0b001 is 0b001.  But your input is not 0b110 it is actually 0b00000000000000000000000000000110 because your data type is a I32.  So your output is correct

 

0b00000000000000000000000000000110 inverted is 0b11111111111111111111111111111001, then logical OR with 0b00000000000000000000000000000001 is 0b11111111111111111111111111111001

 

Also I suspect the difference between your two outputs is due to how the signed data type is handled, changing all data types to a U32 results in the same output.

0 Kudos
Message 12 of 14
(1,229 Views)

srrashme wrote:

But actually negation of 110 is 001; 001+ 1 is 010


OR is NOT an addition.  In digital math, + is often used to denote OR and * is AND.  So 001 + 001 = 001 when dealing with digital math (001 OR 001 = 001).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 14
(1,228 Views)

I understood my mistake..

 

Thank you so much  Smiley Tongue

 

Kind Regards,

Rashme SR

0 Kudos
Message 14 of 14
(1,210 Views)