Prev Problem
Next Problem

45. Signed vs Unsigned Compare

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 

 

Code

module signed_thresh(sample,thresh,gt_unsigned,gt_signed);
input [7:0] sample,thresh;
output gt_signed,gt_unsigned ;

assign gt_unsigned = (sample > thresh) ? 1:0;
assign gt_signed = ($signed(sample)>$signed(thresh))?1:0;
endmodule

 

Was this helpful?
Upvote
Downvote