打印
[Actel FPGA]

求助,高手来看,编程问题

[复制链接]
923|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
LPC300|  楼主 | 2010-5-14 12:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我做的毕设题目是基于fpga的数字滤波器设计
以下是我从辅导书上面找的有关程序设计
首先是直接型fir数字滤波器
module FIR1(out,x,clk);
output[10:0] out;
input[3:0] x;
input clk;
reg[3:0] xfirst,xsecond,xthird,xfourth,xfifth,xsixth,xseventh,xeighth;
wire[7:0] yfirst,ysecond,ythird,yfourth,yfifth,ysixth,yseventh,yeighth;
reg[10:0] out;
reg[8:0] out1,out2,out3,out4;
// 定义滤波器系数
   parameter
   h1 = 4'b0110,   h2 = 4'b0010
   h3 = 4'b0011,   h4 = 4'b0100
   h5 = 4'b0100,   h6 = 4'b0011
   h7 = 4'b0010,   h8 = 4'b0110;

always @(posedge clk)
  begin
    xfirst < = x;
    xsecond < = xfirst;
    xthird < = xsecond;
    xfourth < = xthird;
    xfifth < = xfourth;
    xsixth < = xfifth;
    xseventh < = xsixth;
    xeighth < = xseventh;
  end

add_tree    r1(yfirst,xfirst,h1,clk),   //乘法器操作采用加法树实现
            r2(ysecond,xsecond,h2,clk),
            r3(ythird,xthird,h3,clk),
            r4(yfourth,xfourth,h4,clk),
            r5(yfifth,xfifth,h5,clk),
            r6(ysixth,xsixth,h6,clk),
            r7(yseventh,xseventh,h7,clk),
            r8(yeighth,xeighth,h8,clk);

always @(posedge clk)
   begin
     out1 = yfirst + ysecond;
     out2 = ythird + yfourth;
     out3 = yfifth + ysixth;
     out4 = yseventh + yeighth;
     out = out1 + out2 + out3+ out4;
   end
endmodule


结果我在想使用waveform看波形时就发生了错误,希望有高手来指点一下

相关帖子

沙发
LPC300|  楼主 | 2010-5-14 12:22 | 只看该作者
希望懂得人来教教我,我们毕设时间比较紧,非常感谢

使用特权

评论回复
板凳
S3C2440| | 2010-5-14 12:23 | 只看该作者
工程文件请不要出现中文路径

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:30——驱动高手、流利的英语

107

主题

525

帖子

0

粉丝