funnnnny6674 2018-11-26 04:27
浏览 287
已结题

菜鸟编程,Verilog语言编程中仿真没有计算,代码是这样的,不知道哪里出了问题

module xs(
clk,
en,
rst,
rect,
new,
xy,
ratioX,
ratioY,
Index00,
Index01,
Index10,
Index11,
IntY,
IntX,
SrcY,
SrcX
);
input[25:0] rect,new,xy;
input clk,en,rst;
output[25:0] Index00,Index01,Index10,Index11;
output [12:0] IntY,IntX,SrcY,SrcX,ratioY,ratioX;
reg [25:0] Index00,Index01,Index10,Index11;
reg [12:0] IntY,IntX,SrcY,SrcX,ratioY,ratioX;
reg[1:0] i;
always @(posedge clk)
begin
if(!rst)
begin
Index00<=13'd0;
Index01<=13'd0;
Index10<=13'd0;
Index11<=13'd0;
IntY <= 13'd0;
IntX <= 13'd0;
SrcX <= 13'd0;
SrcY <= 13'd0;
ratioX <=13'd0;
ratioY <=13'd0;
end
else
if(!en)
begin
ratioY <=13'd100*(rect[12:0]-1) / (new[12:0]-1);
ratioX <=13'd100*(rect[25:13]-1) / (new[25:13]-1);
IntY <= xy[12:0]*13'd100*ratioY>>13'd100;
IntX <= xy[25:13]* 13'd100*ratioX>>13'd100;
SrcY <= IntY + 13'd1;
SrcX <= IntX + 13'd1;
Index00 <= {IntX,IntY};
Index01 <= {IntX,SrcY};
Index10 <= {SrcX,IntY};
Index11 <= {SrcX,SrcY};
end
end
endmodule

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题