Question: Write a Verilog model for an N-bit comparator using an iterative circuit. In the module, use the parameter N to define the length of the
Write a Verilog model for an N-bit comparator using an iterative circuit. In the module, use the parameter N to define the length of the input bit vectors A and B. The comparator outputs should be EQ = 1 if A = B, and GT = 1 if A > B. Use a for loop to do the comparison on a bit-by-bit basis, starting with the high-order bits. Even though the comparison is done on a bit-by-bit basis, the final values of EQ and GT apply to A and B as a whole.
Step by Step Solution
3.54 Rating (164 Votes )
There are 3 Steps involved in it
module CMP A B EQ GT parameter N 8 N is the length of the bit vectors in... View full answer
Get step-by-step solutions from verified subject matter experts
