Skip to main content

Command Palette

Search for a command to run...

Logic Gate Truth Tables & Definitions

Published
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

More from this blog

Eunhan's blog

140 posts