Bitwise Operations Calculator
Perform bitwise operations (AND, OR, XOR, NOT, NAND, NOR) on binary, decimal, and hexadecimal numbers with detailed step-by-step calculations.
About Bitwise Operations
Bitwise operations are fundamental operations in digital logic and computer science that work directly on the binary representation of numbers. These operations manipulate individual bits and are essential for low-level programming, digital circuit design, and computer architecture.
Supported Operations
Basic Operations
- AND (&): Returns 1 if both bits are 1
- OR (|): Returns 1 if at least one bit is 1
- XOR (^): Returns 1 if bits are different
- NOT (~): Inverts all bits (1→0, 0→1)
Compound Operations
- NAND: NOT AND (complement of AND)
- NOR: NOT OR (complement of OR)
Input Formats
The calculator supports three number formats:
- Binary: Base-2 numbers using only 0 and 1 (e.g., 1010, 1111)
- Decimal: Base-10 numbers (e.g., 10, 15)
- Hexadecimal: Base-16 numbers using 0-9 and A-F (e.g., A, F)
Truth Tables
AND Operation
| A | B | A & B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR Operation
| A | B | A | B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
XOR Operation
| A | B | A ^ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Applications
- Digital Circuit Design: Logic gates implementation and analysis
- Computer Programming: Bit manipulation, flags, and optimization
- Cryptography: Encryption algorithms and hash functions
- Computer Graphics: Pixel manipulation and color operations
- Embedded Systems: Hardware control and register manipulation
Examples
Example Calculations
1010 AND 1100 = 1000(10 & 12 = 8)1010 OR 1100 = 1110(10 | 12 = 14)1010 XOR 1100 = 0110(10 ^ 12 = 6)NOT 1010 = 0101(~10 = 5 for 4-bit)