Question: (a) A and B are bit vectors that represent unsigned binary numbers. Write a Verilog function that returns TRUE (1) if A > B. The

(a) A and B are bit vectors that represent unsigned binary numbers. Write a Verilog function that returns TRUE (1) if A > B. The function call should be of the form GT(A, B, N), where N is the length of the bit vectors. Start comparing the most significant bits of A and B first and proceed from left to right. As soon as you find a pair of unequal bits, you can determine whether A > B. For example, if A = 1011010 and B = 1010110, you can determine that A > B when you make the fourth comparison. You may declare N as a global parameter in the calling module.
(b) Write a Verilog module that will call the function in part (a).

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a function GT input N 1 0 num1 num2 input 31 0 size integer i beg... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Digital Systems Design Questions!