boolean-logic

Boolean Logic Simplification Issue

I hate this stuff. Just to note. + means OR * means AND ! means NOT. (A+B) * (A+C) * (!B + !C) (A | B) & (A | C) & (!B | !C) // more conventnal The answer is A(!B + !C) I'm trying to get there. So I start off with using Distributive rule which gets me here (A + B) * C * (!B + !C) and that's where I'm stuck. I know I some how hav...

Bool issue - changing value

Morning all. I have the following method that I use to to try and bring back a bool: public static bool GetShowCatSubProdStatus(string memberid, string username) { MyEnts showcatsubprodstatus = new MyEnts.PDC_VDSOREntities35(); var r = from p in showcatsubprodstatus.tblKeyAccountInfoes where p.Membe...

How do I check for presence of a bit in C# using AND?

How to I use logical operators to determine if a bit is set, or is bit-shifting the only way? I found this question that uses bit shifting, but I would think I can just AND out my value. For some context, I'm reading a value from Active Directory and trying to determine if it a Schema Base Object. I think my problem is a syntax issue...

LED Quix Buzzer Circuit With Logic Gates

I want to Make Simple a Quiz Buzzer Circuit With LED. e.g. I need LED instead of Buzzer. I don't need any reset Switch. I want to maximize the Use of Logic Gates in this Circuit. and Obviously no Capacitors are Allowed.and obviously no microcontroller. I am trying to do this for 2 days. But Cannot Make it Out. I think The Basic Idea sh...

Boolean Simplification

Hi, I have a boolean simplification problem that's already been solved.. but I'm having a hard time understanding one basic thing about it.. the order in which it was solved. The problem is simplifying this equation: Y = ¬A¬B¬C + ¬AB¬C + A¬B¬C + A¬BC + ABC The solution is: Y = ¬A¬B¬C + ¬AB¬C + A¬B¬C + A¬BC + ABC = ¬A¬B¬C + ¬AB¬C ...

Python: False or None vs. None or False

In [20]: print None or False -------> print(None or False) False In [21]: print False or None -------> print(False or None) None This behaviour confuses me. Could someone explain to me why is this happening like this? I expected them to both behave the same. ...

Logic to find states in an Enum

I have a method that brings in an Enum value as an argument. enum { UITableViewCellStateDefaultMask = 0, UITableViewCellStateShowingEditControlMask = 1 << 0, UITableViewCellStateShowingDeleteConfirmationMask = 1 << 1 }; There are four possible values: Only UITableViewCellStateDefaultMask is t...

Can someone please help me with some basic boolean minimization ?

Hey guys, Sorry to be annoying, but I am doing a little bit of work at the moment, and am trying to simplify the following piece of boolean algebra so that I can construct the circuit : A'.B'.C.D + A'.B.C.D' + A'.B.C.D + A.B'.C'.D + A.B'.C.D + A.B.C'.D + A.B.C.D' + A.B.C.D So far I have gotten it to : (C.D) + (B.C) + (A....

boolean algebra - build a OR gate as an NAND gate

I am trying to wrap my mind around how to do this. For what i understand is that a set of logic gates is called "functionally complete" if some combination of the gates can be used to do each of the basic logic operations AND, OR, and NOT. The claim is the NAND gate is functionally complete. What i dont understand is how to build a OR g...

Digital Logic - truth tables

I am trying to solve these problems with truth tables using the formulas below. I am having a problem with the NOT to NAND I think i got the first 2 problems correct using: AND is equivalent to NOR, AND is equivalent to NAND The equations for AND, OR and NOT using the NAND operator are: X + Y = x' NAND y' ?? X * Y = X' = X NAND 1 ...

Does the compiler continue evaluating an expression where all must be true if the first is false?

I'm sure this question has probably been answered before, so I apologize, but I wasn't able to find the proper search terms to find the answer. Given the following code example, does db.GetRecords().Any() get executed? string s = "Z"; bool x = s.IndexOfAny(new[] { 'A', 'B' }) > 0 && db.GetRecords().Any(); ...

In C++, why does true && true || false && false = true?

I'd like to know if someone knows the way a compiler would interpret the following code: #include <iostream> using namespace std; int main() { cout << (true && true || false && false) << endl; // true } Is this true because && has a higher precedence than || or because || is a short-circuit operator (in other words, does a short cir...