Skip to main content

All Questions

10 votes
2 answers
3k views

Is it possible to define all bitwise operators using a 'bitwise nand' similar to how all boolean logic can be built using just 'boolean nand'?

Nand is known as a 'universal' logic gate, because it allows you define all other boolean logic gates: not(x) = nand(x,x) and(x, y) = not(nand(x, y)) or(x, y) = nand(not(x), not(y)) nor(x, y) = not(...
0 votes
2 answers
4k views

boolean operations in C using bitfields

I am trying to implement boolean data type in C. Basically, I am working with sets. The following code can be used to access each bit but I am unsure whether I can represent sets using this method. ...