Codiode

Equality versus Case Equality

HardLogic CircuitAnalyze

Verification testbenches rely on precise comparisons to identify uninitialized states or high-impedance drivers.

The scenario presents two 4-bit vectors, A and B, compared using both the standard logical equality operator (==) and the case equality operator (===). Vector A is driven with the value 4'b10x1. Vector B is driven with the exact same value 4'b10x1. The results of these comparisons drive two single-bit outputs: Y_logical captures the result of A == B, and Y_case captures the result of A === B.

Determine the exact bit values evaluated at Y_logical and Y_case. Analyze how each operator handles unknown bits during simulation and synthesis.

Constraints

  • Standard equality evaluates to an unknown state if any bit in either operand is unknown or high-impedance.
  • Case equality treats unknown and high-impedance states as literal values to match perfectly.
  • Synthesizable RTL must only rely on standard logical operators.

Topics

verilogsimulationoperatorsx-states

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Part of Gate-Level Logic

Problem 54 of 62 in the Gate-Level Logic track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.