BitFlow

XOR Gate

beginner · combinational · 25 XP

Sign in to write your solution, run it in the simulator and submit it for grading.

Sign in or create a free account →

Problem

XOR Gate Implement a 2-input XOR gate. Output is high when inputs are **different** — "one or the other, not both." **Truth Table** | a | b | y | |---|---|---| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | **Notes** — XOR is the foundation of parity generators, adders, and cryptographic operations.

Constraints

  • Use the ^ operator.

Examples

Input: a=0, b=1

Output: y=1

Input: a=1, b=1

Output: y=0

Common questions

What does the XOR Gate problem ask you to build?
XOR Gate Implement a 2-input XOR gate. Output is high when inputs are **different** — "one or the other, not both." **Truth Table** | a | b | y | |---|---|---| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | **Notes** — XOR is the foundation of parity generators, adders, and cryptographic op…
What constraints does XOR Gate have?
Use the ^ operator.
What is an example input and output for XOR Gate?
Input a=0, b=1 gives output y=1.
Which Verilog concepts does XOR Gate practise?
combinational, gates.