Logic Gate Truth Tables & Definitions

·

1 min read

Logic Gate Truth Tables

Java Code

!A // NOT
A&B // AND
~(A&B) // NAND
A|B // OR
~(A|B) // XOR
A^B // XOR
~(A^B) // XNOR
~A // Inverts 0 to 1 and 1 to 0

A << 1  // Shift A's bits 1 position to the left. (Empty positions are filled with 0)
A >> 1  // Shift A's bits 1 position to the right. (Empty positions are filled with the leftmost sign bit's value)
A <<< 1 // Shift A's bits 1 position to the left. (Empty positions are filled with 0)
A >>> 1 // Shift A's bits 1 position to the right. (Empty positions are filled with 0)

NOT gate

AND gate

NAND gate

OR gate

NOR gate

XOR gate

XNOR gate