当前位置:   article > 正文

FPGA有符号数输入signed的类型设置_input signed

input signed

FPGA有符号数输入signed的类型设置

src & tb :input signed的情况

module signed_verify (out_add,out_minus,out_mult,out_divide,out_compare,a,b);
output wire signed[15:0]out_add;
output wire signed[15:0]out_minus;
output wire signed[15:0]out_mult;
output wire signed[15:0]out_divide;
output wire signed[15:0]out_compare;
input signed [7:0] a;
input signed [7:0] b;

assign out_add = a+b;
assign out_minus = a-b;
assign out_mult = a*b;
assign out_divide = a/b;
assign out_compare =(a>b)?a:b;
endmodule

`timescale 1ns/1ps
module signed_tb;
reg [7:0] a=0;
reg [7:0] b=0;
wire[15:0] out_add,out_minus,out_mult,out_divide,out_compare;

signed_verify U0(
.out_add (out_add),
.out_minus (out_minus),
.out_mult (out_mult),
.out_divide (o

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/808533
推荐阅读
相关标签
  

闽ICP备14008679号