module yunsuan1(input clk,rst_n,output reg  [7:0]a,b,b1,b2,b3,c,d,count);
always @(posedge clk)
begin
count=count+1;
if(count==10) a=-25;
if(count==11) a=-26;
if(count==12) a=25;
if(count==13) a=2;
b=~a+1;
b1=b>>1;
b2=~b1+1;
if(a[0])b3=~b1;else b3=~b1+1;
end
endmodule

FPGA负数的右移 计算

可以看出负数补码分为奇数和偶数表示:-25和-26的补码都为-13.

 

FPGA负数的右移 计算

相关文章:

  • 2021-11-29
  • 2021-11-29
  • 2022-01-02
  • 2022-02-09
  • 2021-07-08
  • 2021-04-27
  • 2021-11-29
  • 2021-11-29
猜你喜欢
  • 2021-11-01
  • 2022-02-09
  • 2021-11-17
  • 2022-12-23
  • 2022-02-02
  • 2022-02-10
  • 2021-11-20
相关资源
相似解决方案