DigiFlop

Same idea, scaled up to a real bus width.

Verilog Coding Exercise · Combinational I
4-bit Magnitude Comparator
Same idea, scaled up to a real bus width.

Compares two 4-bit numbers using ordinary relational operators — this is where behavioral Verilog (if/else on vectors) starts to earn its keep over gate-by-gate logic.

Good exerciseRewrite this using only bitwise operators (no >, <, ==) to see how much simpler behavioral modeling really is.
▶ Try the interactive version