Draft preview. Lessons are being written and reviewed.

Verilog practice / Problem 14

MediumArithmetic

4-bit magnitude comparator

Compare two unsigned 4-bit numbers. Exactly one output is 1: eq when a = b, gt when a > b, lt when a < b.

Ports

NameDirectionBits
ainput4
binput4
eqoutput1
gtoutput1
ltoutput1

How it's checked

The test tries the input combinations and checks every output for each one.

Stuck? Read the lesson Subtractors, comparators and an ALU.

compare4.vCtrl + Enter runs