Truth Tables

I have to do an assignment for my computer programming class
regarding truth tables and I do not understand the concept behind
it all. If someone can give me an explanation of this, I would
really be thankful. You can find the assignment
here. I just
don't get it.

A truth table is a matrix (no not a movie). Say you have an
alarm on a chicken coop door and you want to know when the chickens
are in the coop and when the door is open to warn you that a fox
could get in. The truth table shows the states of the door (open or
closed) and the states of the chickens (in or out). so your truth
table would be:
doorOpen doorClosed
chickensIn 1 0
chickensOut 0 0
the only time the alarm would go off is when the chicken are
in the coop and the door is open. so your code would be:
if (chickensIn and doorOpen) {goCleseThe Door;}

Similar Messages

  • AND / OR  truth table in SQL

    why null is introduced in the AND and OR truth table?when will a statement/part of a statement return a null value??
    |AND               |True          |False             |NULL??        |
    |True               |True          |False             |Null             |
    |False              |False          |False             |False           |
    |Null                |Null             |Null               |Null             |is it introduced in AND/OR truth table for the null containing row(s)??
    select employee_id,last_name,job_id,salary
    from employees
    wheere salary >= 1000
    And job_id like '%man%';
    how the statement after the where cluz can return null value??Edited by: sayantan chakraborty on Aug 14, 2009 11:36 AM

    sayantan chakraborty wrote:
    how either of X and Y will return a null value?can you put any example?is there any syntax/ command which will print the return value of a statement as null?Say you had a table with columns X and Y. As long as NOT NULL constraints WERE NOT defined these values could contain NULLs. Then if you apply the WHERE condition of X = Y you would have the case of NULL = NULL which results in UNKNOWN.
    Simple Example:
    SQL > WITH test_data AS
      2  (
      3          SELECT 1 AS X, 1 AS Y FROM DUAL UNION ALL
      4          SELECT 2 AS X, 2 AS Y FROM DUAL UNION ALL
      5          SELECT 3 AS X, 5 AS Y FROM DUAL UNION ALL
      6          SELECT 4 AS X, 6 AS Y FROM DUAL UNION ALL
      7          SELECT 1 AS X, NULL AS Y FROM DUAL
      8  )
      9  SELECT  *
    10  FROM    test_data
    11  WHERE   X = Y
    12  /
             X          Y
             1          1
             2          2

  • AND/OR TRUTH TABLE.

    Is there any explanation for why
    1) TRUE AND NULL = NULL
    2) FALSE AND NULL = FALSE
    3) TRUE OR NULL = TRUE
    4) FALSE OR NULL = NULL
    Thank you,
    Narendra

    Just to diagramatically show what Toon has explained...
    It becomes clear if you jot down the logic tables and look at them yourself...
    ..X.. ..Y..  .AND.
    TRUE  TRUE   TRUE
    TRUE  FALSE  FALSE
    FALSE TRUE   FALSE
    FALSE FALSE  FALSEIf X is FALSE it doesn't matter if Y is unknown (NULL) because we know the truth table for AND
    always gives a result of FALSE if X is FALSE. (no.2 in your list)
    If X is TRUE, the result of AND logic becomes dependant on Y. If Y is unknown (NULL) then, the
    answer is also unknown. (no.1 in your list)
    ..X.. ..Y..  .OR..
    TRUE  TRUE   TRUE
    TRUE  FALSE  TRUE
    FALSE TRUE   TRUE
    FALSE FALSE  FALSEIf X is TRUE it doesn't matter if Y is unknown (NULL) because we know the truth table for OR
    always gives a result of TRUE if X is TRUE. (no.3 in your list)
    If X is FALSE, the result of OR logic becomes dependant on Y. If Y is unknown (NULL) then, the
    answer is also unknown (no.4 in your list)

  • Order of Operations with Parentheses

    I have a query that is returning unexpected results. I'm under the impression that when parentheses are included that they override operator precedence. If that is the case, the NOT_EQUAL_CHECK should be the negation of the EQUAL_CHECK, right? Using 10.2.0.4 on an AIX machine.
    WITH src AS
        (SELECT 'T' AS var1, 'T' AS var2 FROM dual
        UNION ALL
        SELECT 'T' AS var1, 'F' AS var2 FROM dual
        UNION ALL
        SELECT 'T' AS var1, NULL AS var2 FROM dual
        UNION ALL
        SELECT NULL AS var1, 'F' AS var2 FROM dual
        UNION ALL
        SELECT NULL AS var1, NULL AS var2 FROM dual
      SELECT   nvl(var1, 'NULL') AS var1,
          nvl(var2, 'NULL') as var2     ,
          CASE
            WHEN((var1 = var2) OR (var1 IS NULL AND var2 IS NULL))
            THEN 'T'
            ELSE 'F'
          END AS equal_check,
          CASE
            WHEN NOT((var1 = var2) OR (var1 IS NULL AND var2 IS NULL))
            THEN 'T'
            ELSE 'F'
          END AS not_equal_check
        FROM src
        ORDER BY var1,
          var2;
    VAR1   VAR2   EQUAL_CHECK   NOT_EQUAL_CHECK
    NULL   F      F             F
    NULL   NULL   T             F
    T      F      F             T
    T      NULL   F             F
    T      T      T             F

    Hi,
    Remember how SQL's 3-value logic works.
    'T' = NULLis neither TRUE nor FALSE, but rather the 3rd possibility: UNKNOWN.
    NOT UNKNOWN is, paradoxically, UNKNOWN.
    That is to say, the truth table of NOT is:
    X          NOT X
    TRUE          FALSE
    FALSE          TRUE
    UNKNOWN          UNKNOWNThe CASE expression
    CASE
        WHEN  <condition_x>
        THEN  'T'
        ELSE  'F'
    ENDreturns 'T' when condition_x evaluates to TRUE, and it returns 'F' in all other events, that is, whether condition_x is FALSE or condition_x is UNKNOWN.
    Putting NOT in fron of that condition:
    CASE
        WHEN  NOT <condition_x>
        THEN  'T'
        ELSE  'F'
    ENDchanges what happens when condition_x is either TRUE or FALSE, but it has no effect on the results when condition_x is UNKNOWN.
    If you want a CASE expression that is the opposite of equal_check, just swap the values in the THEN and ELSE clauses.
    Alternatively, you can negate the condition piece by piece, as shown in the last CASE expression below.
      SELECT   nvl(var1, 'NULL') AS var1,
          nvl(var2, 'NULL') as var2     ,
          CASE
            WHEN((var1 = var2) OR (var1 IS NULL AND var2 IS NULL))
            THEN 'T'
            ELSE 'F'
          END AS equal_check,
          CASE
            WHEN((var1 = var2) OR (var1 IS NULL AND var2 IS NULL))
            THEN 'F'
            ELSE 'T'
          END AS swap,
          CASE
            WHEN LNNVL (var1 = var2)
         AND  NVL (var1, var2)     IS NOT NULL
         THEN 'T'
            ELSE 'F'
          END AS piece_by_piece
        FROM src
        ORDER BY var1,
          var2;Output:
    VAR1 VAR2 E S P
    NULL F    F T T
    NULL NULL T F F
    T    F    F T T
    T    NULL F T T
    T    T    T F FNOT has a similar effect on 3-valued boolean values that multiplying by -1 has on numbers. If you multiply a positive number x by -1, the result will be different than x, and if you mutiply a negative number x by -1 then the result will also be different than x. But if you multiply 0 by -1, the result is still 0.
    Edited by: Frank Kulash on May 20, 2010 2:13 PM

  • How to find the flow of procedures?

    Hi we are using 11gR2. I have a procedure Proc_Cust_Rpt(id NUMBER);
    This procedure has two procedure calls inside it in an IF-THEN-ELSE condition. But at a time for the given input parameter only one of them is called. Again, inside the child procedures multiple procedures get called, but at a time only one of them will get called depending on the parameters passed. Then again there is one more level like this.
    What are the ways I can find out the flow of procedures depending on the parameter id passed? I want to avoid using DBMS_OUTPUT or a logging procedure to find the flow.

    >
    This procedure has two procedure calls inside it in an IF-THEN-ELSE condition. But at a time for the given input parameter only one of them is called. Again, inside the child procedures multiple procedures get called, but at a time only one of them will get called depending on the parameters passed. Then again there is one more level like this.
    What are the ways I can find out the flow of procedures depending on the parameter id passed? I want to avoid using DBMS_OUTPUT or a logging procedure to find the flow.
    >
    You need to do it the 'old fashioned' way: review the code and analyze those IF-THEN-ELSE conditions just like you have described.
    That will result in what is known as a 'truth table' that lists each of the TRUE/FALSE conditions for each IF-THEN-ELSE and the result of each possible boolean combination of those values.
    See the Wiki
    http://en.wikipedia.org/wiki/Truth_table
    Here is another article that shows how you create a truth table - the first example is pretty simple.
    http://aristotle.tamu.edu/~rasmith/Courses/Logic/Exercises/2.0.html
    IF1 IF2 IF3 PROCEDURE
    ========================
    TRUE TRUE TRUE PROC1
    TRUE TRUE FALSE PROC2
    TRUE FALSE TRUE PROC3
    TRUE FALSE FALSE PROC4
    FALSE TRUE TRUE PROC5
    FALSE TRUE FALSE PROC6
    FALSE FALSE TRUE PROC7
    FALSE FALSE FALSE PROC8

  • 4.1.1 SDK Problems with missing xpacket tags in sidecar XMP files

    The current 4.1.1 SDK has problems with sidecar XMP files that don't have the xpacket headers and trailers, i.e:
    <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
    <?xpacket end='w'?>
    is missing. Now, unfortunately Adobe Bridge CS2/CS3 does not export these xpackets in sidecar XMP files.
    The standard, http://www.aiim.org/documents/standards/xmpspecification.pdf, is also very vague about it all:
    ● Write external metadata as though it were embedded and then had the XMP Packets
    extracted and catenated by a postprocessor.
    The grammar is strange(past tense had) and the spec implies that the xpacket should be extracted and again catenated... Someone should review this document and clearly state if xpacket statements should be in sidecar files or not. I suspect myself that they should be there, but the standard is very vague.
    Anyway, there are two places in the SDK code where changes might be needed:
    XMPFiles::Initialize has XMP_Asserts in case the xpacket header/trailer is missing, but the underlying assert is only active in debug builds.
    XMPScanner::PacketMachine::FindNextPacket () also has in its truth table the assumption that the xpackets exist.
    There could be even other places in the code that assumes that the xpacket tags are present in all files, which includes text XMP sidecar files.
    Anyway.
    a) Shouldn't bridge export the xpacket tags? Same with any other application?
    b) If the spec is vague, then the SDK should not assume that the xpacket tags are present.
    Any comments? Has someone already fixed this issue as I suspect a lot of apps using the the XMP SDK would break concerning reading XMP sidecar files? Thx, Kent

    I was able to work around the problem by creating a mapped view of the .xmp file (this creates an array in memory backed by the file on disk, so there's no need to read the file into a separate internal buffer), and constructing the SXMPMeta object directly from the buffer. (The ctor for that class calls ParseFromBuffer, so this is the same thing as was suggested by other messages in this thread.)
    It seems that Adobe needs to do one of these things:
    (1) say that Bridge CS3 has a bug, and agree that Bridge CS3 should include a proper xpacket header when writing xmp sidecar files
    (2) say that the XMP Toolkit has a bug, and that the SDK should be able to parse sidecar files without an xpacket header, and agree to fix the toolkit
    (3) say that Bridge CS3 and the XMP Toolkit behave as expected, but then provide a sequence of steps by which users of the XMP Toolkit are expected to read xmp sidecar files written by Bridge CS3
    Does Bridge CS4 write an xpacket header to the xmp sidecar files?
    Maybe what I could do is create a custom file handler for .xmp sidecar files, so I could use the SXMPFiles for everything, instead of having to special-case .xmp files.
    My needs are pretty modest though, and it might be just as simple to use the MS DOM-based XML parser for load the xmp sidecar file. I bet I could get the data I need (only the "Rating" for now) using a simple XPath expression.
    -Matt

  • NOT operator

    hi everyone, i am having problem with the not operator in oracle.
    consider the following
    WITH data AS
    SELECT 'TAK' cd, 'PL' TYPE FROM dual UNION ALL
    SELECT 'TAK' cd, NULL TYPE FROM dual
    SELECT * FROM data WHERE NOT (cd = 'TAK' AND TYPE='PL')
    the above is not returning anything. what i want to do is to exclude all rows with cd=TAK and TYPE=PL
    the rest should be display. so the output should be
    CD       TYPE
    ============
    TAK      <NULL VALUE HERE>however, the query above is not doing that. how can i modify my query to exclude rows with cd=TAK and TYPE=PL but display the one that doesnt match this condition like
    second row, cd=TAK and TYPE=null

    Hi,
    elmasduro wrote:
    hi everyone, i am having problem with the not operator in oracle.
    consider the following
    WITH data AS
    SELECT 'TAK' cd, 'PL' TYPE FROM dual UNION ALL
    SELECT 'TAK' cd, NULL TYPE FROM dual
    SELECT * FROM data WHERE NOT (cd = 'TAK' AND TYPE='PL')the above is not returning anything. what i want to do is to exclude all rows with cd=TAK and TYPE=PL
    the rest should be display. so the output should be
    CD       TYPE
    ============
    TAK      <NULL VALUE HERE>however, the query above is not doing that. how can i modify my query to exclude rows with cd=TAK and TYPE=PL but display the one that doesnt match this condition like
    second row, cd=TAK and TYPE=nullRemember, SQL uses 3-value logic.
    Conditions can be TRUE, FALSE or UNKNOWN. Rows are returned if (and only if) the WHERE clause evaluates to TRUE.
    If either cd or type is NULL, but the other variable is what the condition is checking for, then
    WHERE NOT (cd = 'TAK' AND TYPE='PL')will evaluate to UNKNOWN, because
    NULL = x     is always UNKNOWN, regardless of what x is,
    TRUE AND UNKNOWN     is UNKNOWN, and
    NOT UNKNOWN     is UNKNOWN.
    See the truth tables in the SQL language manual:
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/conditions004.htm#sthref1938
    If you want to equate NULL cds with something other than 'TAK', and to equate NULL types with something other than 'PL', here's one way to do it:
    SELECT     *
    FROM     data
    WHERE     NVL (cd,   'OK') != 'TAK'
    OR     NVL (type, 'OK') != 'PL'
    ;I find the condition above easier to understand than the condition below, but they get the same results.
    SELECT     *
    FROM     data
    WHERE     NOT (    NVL (cd,   'OK') = 'TAK'
             AND      NVL (type, 'OK') = 'PL'
    ;

  • What does this odd use of NVL in a comparison do?

    The TOAD query optimizer recommended changing this test:
    (NOT (sites.pay_site_flag = 'N' AND sites.purchasing_site_flag = 'Y'))
    to this:
    (sites.pay_site_flag &lt;&gt; NVL ('N', UID) OR sites.purchasing_sige_flag &lt;&gt; 'Y')
    both sites.pay_site_flag and sites.purchasing_site_flag allow nulls, so the logical contrapositive is not valid.
    Testing seems to show that the query optimizer test returns the same result as the original test, but why? I don't understand how NVL ('N', UID) can ever evaluate to anything but 'N', and how can that be useful in this comparison?
    Edited by: Pete Hall on May 6, 2012 10:32 AM
    Edited by: Pete Hall on May 6, 2012 11:12 AM
    Edited by: Pete Hall on May 6, 2012 11:13 AM

    >
    That's true, and I did construct the truth table. It's equally true, if I substitute a literal 'N' in place of NVL ('N', UID), so what subtle difference does it make if the NVL function is used instead of the literal 'N'? I suppose it's possible that the TOAD optimizer just pulled that out of the air for no reason, but it seems unlikely.
    >
    For this example the use of NVL appears to be unnecessary. Can't tell for certain since the example that uses NVL also uses 'UID' which isn't explained anywhere; where did TOAD come up with 'UID'?
    The most likely explanation is that the template that TOAD uses includes NVL to handle cases where the NVL actually is necessary. And for cases where NVL isn't needed, and doesn't alter the results, it doesn't matter if it is left in. That could allow TOAD to use one template for all use cases rather than add code to determine the use cases where NVL isn't needed.
    Note that your original example
    (NOT (sites.pay_site_flag = 'N' AND sites.purchasing_site_flag = 'Y'))is often misinterpreted as meaning the NEGATION of the inner AND condition but testing will show that it is not. You should always use a truth table and full testing to make sure you get exactly what you want.
    Since there are two variables and they can each have three values there are nine possible combinations
    with q as (SELECT 1 TEST, 'N' PFLAG, 'Y' SFLAG FROM DUAL
               UNION ALL
               SELECT 2 TEST, 'Y' PFLAG, 'Y' SFLAG FROM DUAL
               UNION ALL
               SELECT 3 TEST, NULL PFLAG, 'Y' SFLAG FROM DUAL
               UNION ALL
               SELECT 4 TEST, 'N' PFLAG, 'N' SFLAG FROM DUAL
               UNION ALL
               SELECT 5 TEST, 'Y' PFLAG, 'N' SFLAG FROM DUAL
               UNION ALL
               SELECT 6 TEST, NULL PFLAG, 'N' SFLAG FROM DUAL
               UNION ALL
               SELECT 7 TEST, 'N' PFLAG, NULL SFLAG FROM DUAL
               UNION ALL
               SELECT 8 TEST, 'Y' PFLAG, NULL SFLAG FROM DUAL
               UNION ALL
               SELECT 9 TEST, NULL PFLAG, NULL SFLAG FROM DUAL
    SELECT * FROM Q WHERE
       (NOT (PFLAG = 'N' AND SFLAG = 'Y'))
    TEST,PFLAG,SFLAG
    2,Y,Y
    4,N,N
    5,Y,N
    6,,N
    8,Y,
                  The inner AND condition
       (PFLAG = 'N' AND SFLAG = 'Y')is TEST #1 of 9 possible combinations.
    It is natural to think that if you negate that with the NOT condition that you should get records that correspond to the other 8 conditions.
    But if you look at the above results you can see that you only get results matching tests 2, 4, 5, 6 and 8.
    Those DO NOT include tests 3 (PFLAG IS NULL and SFLAG = 'Y'), 7 (PFLAG = 'N' but SFLAG IS NULL) or 9 (both flags are NULL).
    That is the way NULLs can affect things.
    If you really need the NEGATION of the inner AND condition you need to specifically code for the null value combinations.
    to mean 'include all records with pay_site_flag IN (null, 'Y') OR purchasing_site_flag IN (null, 'N') but that is NOT what your condition does.
    The example provides
    If you did the truth table and testing

  • Changing a boolean value based on two buttons

    I know that this is a ridiculously simple question, but I've been having trouble with it.
    How would you set a boolean value based on the input from two other boolean values? Essentially what I want, in pseudocode, is this:
    boolA = true
    if (boolB)
         boolA = false
    if (boolC)
         boolA = true
    It should be really simple to do, but I can't figure it out. The problem is getting it to stay false, for example, after boolB goes back to false, and not just to have it only momentarily go to false. I want it to stay false until boolC goes to true, regardless of what boolB does after that. Any advice?
    Thanks,
    Logan Williams

    I would say implies is close to what was asked for.  However, the only issue is that for the case where both B and C are false, the logic shows that there is no change to A.  It is initially True, but if it happens to be False because of further changes, there is nothing in the If statements to change the logic.  And that is what is asked for.  That the Result stays False even when B goes back to False.  But the Implies function says that  F and F must be True.
    As described
    B         C         Result A
    T          T          T (because C is evaluated 2nd)
    T          F          F
    F          T          T
    F          F          x (initially T, but the code shown and what is asked for is actually no change from previous state)
       Implies Truth Table
    B         C         Result A
    T          T          T
    T          F          F
    F          T          T
    F          F          T

  • Error with select statement

    Hi All,
    I am getting the error 'Comma without preceding colon (after SELECT ?).' with the following select statement. Can someone help me with the error.          
            select single actdate_from actdate_to
            into ( lv_actdate_from, lv_actdate_to )
            from zsdcoop
            where kunnr = wa-kunnr and pfnum = wa-pfnum.
            if ( lv_actdate_from NE wa-actdate_from ) or ( lv_actdate_to NE wa-actdate_to ).
              wa-block = 'X'.
            Endif.
    Thanks,
    Veni.

    Typically, on statements like this, you want to use AND instead of OR.  Google "truth tables" for a detailed explanation of why.
    if ( lv_actdate_from NE wa-actdate_from ) or ( lv_actdate_to NE wa-actdate_to ).
    wa-block = 'X'.
    Should probably be:
    if ( lv_actdate_from NE wa-actdate_from ) AND ( lv_actdate_to NE wa-actdate_to ).
    wa-block = 'X'.

  • BLACKBERRY DESKTOP SOFTWARE and OSX Lion

    Dear all
    I have a new MacPro with latest OS XLion and after installed blackberry desktop software all system started go very slowly.
    I called Apple support and  they told me that BB has not any update that works with new OS X Lion system and installing and sync with BB software is not suggested
    Since this is an important issues as  I'm using BB for professional work I'll need to have such synchronization possible. How can I?
    Thank you for your prompt help
    Regards 

    Messagepads wrote:
    Well, to me, it doesn't seem correct that BB is not compatible with Lion !?
    I am using at the moment of writing this message the latest BB desktop software on my MB Pro 15 "mid-2010" and os X Lion without ANY problem of speed.
    Just had an issue with the transition to iCloud (as many other people) obliging me to "repatriate" manually all my calendar and contact files!
    For the rest, everything runs smoothly on my MAC
    Just check that you really have the latest version of the software through the update menu command.
    Really?  Here is the article from Blackberry: - Just talked to them AGAIN and the answer is that yes I will be in a continuos loop with over 25% of my entries changing every other time I synch.  Stupid
    Syncing calendar events from the BlackBerry smartphone using BlackBerry Desktop Software for Mac causes multiple modifications to existing events
    Article ID: KB25147
    Product(s) Affected:
    BlackBerry® Desktop Software (Mac OS)
    Overview
    When a sync is carried out with BlackBerry® Desktop Software for Mac and both the BlackBerry® smartphone and the calendar program on the Mac contain the same appointments or a large number of the same appointments the Mac sync alert appears showing modifications to those appointments already in the calendar on the Mac.
    BlackBerryDesktop Software (Mac OS)
    Mac OS
    The issue occurs because appointments on the BlackBerry smartphone are categorized as 'public' or 'private'. The appointments by default are 'public' and a checkbox within the appointment details allows a user to mark it as private.Cause
    As an example, iCal appointments do not have this categorization so when the sync takes places the BlackBerry smartphone data has this extra field being pushed and whilst iCal cannot display this data, the truth database in the Mac itself can store that information. This means that the data stored in the Mac truth table has this field added to its stored data.
    The software is working as designed. Those modifications should be accepted.Resolution------
    SOOOOOO - you accept and then synch - no problem.  Close computer - open again - try to synch and get exact same message.  Iphone is the answer.

  • Subvi and input

    The diagram function "Flatten To String" takes any datatype on its input
    connector.
    Is it possible to create a subvi that takes any datatype on its input
    connector?
    Thanks for yor answer
    Petter Kristiansen
    Industriell Informasjonsteknologi AS
    P.O.B 8208, Vågsbygd
    N-4602 Kristiansand, Norway
    Tel: +47 38 01 95 50, Direct: +47 38 01 95 53
    Fax: +47 38 01 95 59, Mobile: +47 915 88 802
    E_Mail: [email protected]

    X. wrote:
    Amazing how 16 years later, that's still pretty much the only supported approach...
    That's not true at all.  LabVIEW is a striclty typed programming language so having flexibility in input is going to be a problem.  Of course this gives the benefit of knowing you'll never have any compile type syntax errors.
    So you can flatten to a string, or you can convert to a raw array of bytes, or you can use a variant.  All of these options will allow you have an input that accepts multiple data types but they all have the same problem, which is that you need to code each data type you actually want by converting it to the strictly typed data you want so you can use it.
    This is why most people when they need this look for polymorphic VIs which allow them to have a VI for each type, and then have the VI automatically select the type based on the wired input.  This works well if you have say 10 or less data types to support.  It can work for 60+ but managing those instances can be a pain without proper scripting.
    But the magic bullet in my opinion is XNodes.  They are nodes on the block diagram, that create code, as you interact with them.  They have easy type adaption for inputs and outputs, and can allow for things like resizing, adding inputs or outputs.  The regular expression function is an XNode which is just a collection of VIs in a specific library, which says when to run each VI as you interact with it.
    XNodes development is not something NI wants non-NI developers doing, but some amazing things can be done with XNodes where the code to interact with something is written, as you wire it up.  It has the flexibility of variants, but the strict data typing of polymorphic VIs.
    Remember XNodes are very experimental and NI will not support code written with them, that being said XNodes are made by NI and shipped with LabVIEW, so they are considered stable in some cases.  They are also a lot of fun to play with and make, here are some of my favorite examples.
    https://lavag.org/files/file/250-circular-buffer/
    https://lavag.org/files/file/260-find-references-x​node/
    https://lavag.org/files/file/248-variant-repositor​y/
    https://lavag.org/files/file/169-openg-array-xnode​s/
    http://forums.ni.com/t5/LabVIEW/Truth-Table-Node/t​d-p/1293680
    https://decibel.ni.com/content/docs/DOC-13859
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Suggestion for turning this into one case structure

    This is a snippet from some exisiting code we were hired to modify/clean up. I have to assume there is some way I can reduce this to only have one case structure, maybe with a not-and or not-or. Or maybe I'm overthinking this. Basically I keep confusing myself in relatively simple code when thinking about the booleans being compared. Any help is appreciated.
    CLA, LabVIEW Versions 2010-2013
    Solved!
    Go to Solution.
    Attachments:
    cleanuppls.PNG ‏11 KB

    KathrynB wrote:
    This does look to be just a NAND, pure and simple.
    The truth table I came up with was:
    old   new    write to global
    0      0         1 (< is false, new is false)
    0      1         1 (< is true)
    1      0         1 (< is false, new is false)
    1      1         0 (< is false, new is true)
    Classic not-and.
    Your logic works in the case where you want one result if both inputs are TRUE, and another result otherwise.  That would require modifying the original logic.  In the case where the original logic persists, then you need one result if one input is TRUE and the other is FALSE, and another result otherwise.  In this case, you need Implies.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Xor/xnor gate implementation in java

    here is the code that implements the xor gate for my program...
        public static boolean xor(boolean... input)             //for n inputs
            boolean result=input[0];                            //assigns 1st value to result
            for(int i=0; i<input.length-1;)                     //loops till length-1
                result=(result&&!input[i+1])||(!result&&input[i+1]);                      //does A*B'+A'*B
                i++;
            return result;
        }the code gives the right output for 3 inputs...
    now here is the code that implements the xnor gate.
        public static boolean xnor(boolean... input)             //for n inputs
            boolean result=input[0];                            //assigns 1st value to result
            for(int i=0; i<input.length-1;)                     //loops till length-1
                result=(result&&input[i+1])||((!result)&&(!input[i+1]));                      //does A*B+A'*B'
                i++;
            return result;
    }the output of this for a given set of input should be exactly the opposite of the output of xor gate. however, the output comes out to be the same!
    i have checked my code several times and its all right. infact if i replace the above code with the following the output turns out to be fine...
        public static boolean xnor(boolean... input)             //for n inputs
            return(!XOR.xor(input));
        }any help?

    AceNeerav wrote:
    first, down to business...
    hello pete,
    i am not using xnor as negation of xor here but am implementing the text book formula for xnor which is...
    A ~ B = AB+A'B'
    Which is the same as !(A^B)
    A | B | AB | A' | B' | A'B' | AB+A'B' | A^B | (A^B)'
    0   0    0   1    1     1       1        0      1
    0   1    0   1    0     0       0        1      0
    1   0    0   0    1     0       0        1      0
    1   0    1   0    0     0       0        0      1Please do your own truth tables before making such assertions.
    You have already stated that you get the right results by inverting xor:
    AceNeerav wrote:
    i have checked my code several times and its all right. infact if i replace the above code with the following the output turns out to be fine...
        public static boolean xnor(boolean... input)             //for n inputs
    return(!XOR.xor(input));
    So why do you say that xnor works if it is the negation of xor, but it isn't the negation of xor, it's another formula which has the same value as the negation of xor.
    i am insisting so much about my code to work is because the logic is right and i just seek perfection in both, the logic and the coding.No, the logic is not right. I've already provided step by step illustration as to the logical difference between ((a~b)~c) and !(a^b^c) for values a,b,c = 1,0,0. Feel free work through the equations again yourself, or construct a truth table, using either a~b = ab + a'b' or a~b = (a^b)', to convince yourself of this.

  • Combinational logic for BCD seven segment

    HI all,
    I have to design the combinational logic for BCD to seven segment display using only And, Or and Not gates and simulate it using the multisim software. I had come out with the truth tables, kmaps and finally i got all the SOP for each of the segments (a - g).
    Now i have a problem, using multisim i do not know how to simulate the output. Am i going to draw all the logic diagram for a to g, and how am i going to combine them together?
    What other components do i need to proceed with the simulation? Please advice, thanks in advance!

    I'm not sure what SOP means, but I am very, very familiar with this project.
    Here is a file that sets up a basic structure for you so you can see how it works. I used a Common-anode 7-segment display since those seem to be more common in school kits, which makes the final gate outputs active low. I've only done the "A" segment for an example. You may notice that the gates I have are different than what you get with Karnaugh mapping, because I used the Quine-McCluskey method that Multisim's Logic Converter can produce. It makes for less gates, but is not a method you really want to do manually. If you are doing a school assignment, I would advise against using the Quine-McCluskey result, because an instructor will tear you apart if it doesn't work and you can't show your proofs, so don't forget to remove my gates!
    Ryan R.
    R&D
    Attachments:
    7-Segment Driver Array Starter.ms10 ‏101 KB

Maybe you are looking for

  • Itunes not recognizing my devices after installing 11.1.4

    As per itunes message to update to latest version, I updated to 11.1.4 on my PC. I'm running windows 8.1, 64 bit. After updating and restarting computer, itunes will not recognize any of my devices. iphone4s, ipod touch 5g, ipod touch 4g. The devices

  • Does the Officejet 8600 Pro Premium N911n printer perform auto tray selection?

    I have an Officejet 8600 Pro Pemium N911n printer,  CN577A with two trays. My Operating Sysem is Win8,64bit,there are no error messages, no system changes. The HP Officejet Pro 8600 e-All-in One series User Guide states that By default, the printer d

  • Problem Obtaining multiple results from MySql Stored Proc via JDBC

    I've spent alot of time on this and I'd be really grateful for anyones help please! I have written a java class to execute a MySQL stored procedure that does an UPDATE and then a SELECT. I want to handle the resultset from the SELECT AND get a count

  • How to Increase the retreving size of instances using PAPI filters.

    Hi, How to Increase the retreving size of instances using PAPI filters. In my engine database instance size exceeds 2500 then we are getting following exception. If we login in to user workspace able to see the instances but while trying to retrieve

  • T61 display replacement instructions

    Hi, recently the display of my trusty T61 (7661-A58) has broken and I amconsidering to replace it with just the LCD. Is there any site with detailed instructions? or can anybody send some? thanks in advance George Solved! Go to Solution.