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

/*Write your code here*/
module signed_thresh(
    input [7:0]sample,thresh,
    output gt_unsigned,gt_signed
);
  wire w1,w2;
  //assign w1 = $signed(sample);
  //assign w2 = $signed(thresh);
 assign gt_unsigned = (sample > thresh)? 1'b1 : 1'b0;
 assign gt_signed = $signed(sample) > $signed(thresh) ? 1'b1 : 1'b0;
endmodule

 

Was this helpful?
Upvote
Downvote