About the NOR Calculator
NOR answers a narrow question: which bit positions are 0 in every operand? Those columns come back as 1 and all others as 0, which makes NOR the operator for finding the bits nobody has claimed. Combine two allocation bitmaps with NOR and the set bits in the answer are the free slots.
Because the result is an inverted word, the bit width is part of the answer rather than a display preference. Auto picks the narrowest of 8, 16, 32 or 64 bits that holds the operands, so a teaching example with two byte sized values stays a byte wide instead of growing 24 leading ones. Pin 32-bit when you are reproducing what a C expression would do on an unsigned int.
Values can be written in decimal or prefixed with 0x, 0b or 0o, and a pinned input base lets a whole pasted column be read one way. Extra lines act as extra operands, folded left to right. Alongside the decimal, binary, hex and octal readings the page prints the signed value for the chosen width, which is how the same bits look when a language reinterprets them as a two’s complement integer. NOR shares the universal gate property with NAND and is the gate behind the classic set reset latch. The uninverted version lives on the OR Calculator, and single operand inversion on the NOT Calculator.
How to use
- Enter the first bitmap or value in the Operand A pane.
- Enter the value you want to compare it with in the Operand B pane.
- Choose a bit width that matches the register or bitmap you are modelling.
- Look at the set bit list under the result for the free positions the operands share.
Common questions
- What does 0b11001100 NOR 0b10101010 give?
- The OR of the two is 0b11101110, and inverting that inside eight bits gives 0b00010001, which is 17 in decimal.
- When would I actually use NOR?
- Whenever you need the positions that are clear in every input, such as finding unused slots after merging two allocation bitmaps.
- Why is the signed value negative?
- Inversion sets the top bit whenever the operands leave it clear, and a set top bit is what makes a two’s complement number negative for that width.
- Can I mix bases between the two panes?
- Yes, as long as Auto detect is selected. Operand A can be hex and operand B binary, because each line is read by its own prefix.