作者sasako (微笑待人)
站内Electronics
标题Re: [问题]"乘法"与电路和成(design vision)
时间Wed May 28 09:40:33 2008
※ 引述《hisanick (外村尼克)》之铭言:
: 小弟我最近想打个乘法出来
: module time1(in3,in4,out3); //作in3和in4的相乘
: input [13:0]in3;
: input [13:0]in4;
: output reg [13:0]out3 ;
: reg [27:0]cc ;
: always@( *)
: begin
: cc <= in3*in4 ;
: out3 <= cc[27:14];
: end
帮你debug...
你这两行写得相当奇怪...是非常奇怪
完全看不懂...
input clk , n_rst ;
input [13:0]in3 ;
input [13:0]in4 ;
output [13:0]out3 ;
wire [27:0]cc ;
reg [13:0]out3 ;
assign cc = in3*in4 ;
always @ (posedge clk or negedge n_rst) begin
if(!n_rst)begin
out3 <= 'b0 ;
end
else begin
out3 <= cc[27 : 14] ;
end
end
<= 是用在 sequencial 电路...
不要用在combinational 电路...
ouput port可以描述成sequencial...
让他合出DFF..
你的coding style还要再加油...
尤其是语法、合成的观念...
然後名字取好一点,不要乱取...(那cc也取好一点 cc鬼才知道是什麽东西)
: endmodule
: 并且利用这种写法来写四次方程式,在ISE模拟时出来的值都是对的
: 但是我把它丢到design vision去做合成gate level
: compile後要存v档时,她跑出两种warning..
: 1 . Information: Design 'outadder' has multiply instantiated designs. (check
: design跑出来的)
: 2 指令 change_names -rule verilog -hierarchy 时
: warning :
: testLS_DW_mult_uns_4, net 'b[2]' is connecting multiple ports.
: (testLS 是我更大的module)
: .
: .
: .
: ...很多
: 3. 存v档时
: Verilog writer has added 14 nets to module time1 using SYNOPSYS_UNCONNECTED_
: as prefix. Please use the change_names command to make the correct changes
: before invoking the verilog writer.
: 我想问的是是不是在写verilog 而且作合成电路时
: 不可以使用 * 当作乘法
: 而是得自己写乘法器??
: 有经验的大大能帮我指导一下吗??
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.144.169
※ 编辑: sasako 来自: 220.132.144.169 (05/28 09:56)
1F:推 hisanick:哈哈 感谢,我是临时出师的新手~~^^ 05/28 17:02