Questions tagged [boolean-logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
7answers
2k views

Can I use boolean algebra to reduce the number of lines in my code?

I am recently studying computer science and I was introduced into boolean algebra. It seems that boolean algebra is used to simplify logic gates in hardware in order to make the circuit design minimal ...
3
votes
2answers
2k views

Understanding LSB and MSB

In reference to one interface control document, I found difficulty in understanding this concept. There is one parameter having LSB of 0.0625 and MSB of 2048 that should be transmitted from one piece ...
0
votes
5answers
522 views

Anti-idiom? Chained equality operators

I got a headscratcher: someone submitted code to test whether all of some checkboxes were unchecked, and it indicated True when an even number were checked. The code looked something like: if (box1....
1
vote
1answer
47 views

Eliminate areas of binary space and increment through result efficiently

The goal is to take a binary space, say 64 bits, and make certain parts of it "valid" and certain parts "invalid", then increment, starting at 0, through that space, avoiding the invalid areas. Space ...
1
vote
1answer
169 views

Need to match database tags using a boolean expression

I have a table, let's call it Widgets, a Tags table with about 30 tags, a WidgetsTags table that joins each widget with any number of tags, and a table called LandingPages, the landing pages are for ...