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(sample,thresh,gt_signed,gt_unsigned);
input [7:0]sample,thresh;
output reg gt_unsigned=0,gt_signed=0;
reg signed [7:0]si_sample,si_thresh;
always@(*)begin
        gt_unsigned=sample>thresh?1:0;
        si_sample=sample;
        si_thresh=thresh;
        gt_signed=si_sample>si_thresh?1:0;

    end

endmodule

 

Was this helpful?
Upvote
Downvote