以下是代码片段: reg [5:0] unsignedRegA; reg signed [5:0] signedRegA; initial begin unsignedRegA <= 6'b110000; signedRegA <= 6'b110000; unsignedRegA <= unsignedRegA>>>2; signedRegA <= signedRegA>>>2; end |
以下是代码片段: reg [5:0] unsignedRegA; reg [5:0] unsignedRegB; reg [6:0] unsignedRegS; reg signed [5:0] signedRegA; reg signed [5:0] signedRegB; reg signed [6:0] signedRegS; initial begin unsignedRegA <= 6'b111000; unsignedRegB <= 6'b000110; signedRegA <= 6'b111000; signedRegB <= 6'b000110; unsignedRegS <= unsignedRegA-unsignedRegB; signedRegS <= signedRegA-signedRegB; end |
以下是代码片段: reg [5:0] unsignedRegA; reg [5:0] unsignedRegB; reg signed [5:0] signedRegA; reg signed [5:0] signedRegB; reg unsignedCompare; reg signedCompare; initial begin unsignedRegA <= 6'b111000; unsignedRegB <= 6'b000110; signedRegA <= 6'b111000; signedRegB <= 6'b000110; unsignedCompare <= (unsignedRegA>unsignedRegB) ? 1'b1 : 1'b0; signedCompare <= (signedRegA>signedRegB) ? 1'b1 : 1'b0; end |
文章评论(0条评论)
登录后参与讨论