打印

有人能帮我仿真一下这个VERILOG程序吗,非常级

[复制链接]
1778|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
shenfm|  楼主 | 2010-3-27 14:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
是一个5级CIC的程序,我因为第一次用QUARTUS2,所以仿真有些问题,有人能帮忙仿真一下波形给我参考吗
module CIC5(clk,x_in,clk2,y_out);
input clk;
input [7:0] x_in;
output[9:0]y_out;
output clk2;
reg clk2;
parameter hold=1'b0,sample=1'b1;
reg [1:0]state;
reg [4:0] counter;
reg [7:0]x;
wire [31:0]sxtx;
reg [31:0]int0,int1,int2,int3,int4;
reg[31:0]int2d1,int2d2, comb1,comb0;
reg[31:0]comb1d1,comb1d2,comb2;
reg[31:0]comb2d1,comb2d2,comb3;
reg[31:0]comb3d1,comb3d2,comb4;
reg[31:0]comb4d1,comb4d2,comb5;
always @(posedge clk)
begin:FSM
if (counter==24) begin
counter<=0;
state<=sample;
clk2<=1;
end
else begin
counter<=counter+1;
state<=hold;
clk2<=0;
end
end
assign sxtx = {{24{x[7]}},x};
always@(posedge clk)
begin:Int
x<=x_in;
int0<=int0+sxtx;
int1<=int1+int0;
int2<=int2+int1;
int3<=int3+int2;
int4<=int4+int3;
end
always@(posedge clk)
begin:comb
if (state == sample) begin
comb0 <= int4;
int2d1 <= comb0;
int2d2 <= int2d1;
comb1 <= comb0 - int2d2;
comb1d1 <= comb1;
comb1d2 <= comb1d1;
comb2 <= comb1 - comb1d2;
comb2d1 <= comb2;
comb2d2 <= comb2d1;
comb3 <= comb2 - comb2d2;
comb3d1<=comb3;
comb3d2<=comb3d1;
comb4<=comb3-comb3d2;
comb4d1<=comb4;
comb4d2<=comb4d1;
comb5<=comb4-comb4d2;
end
end
assign y_out=comb5[31:22];
如果有人弄好的话可以把波形发过来给我看一下,输入信号是幅值为127的阶跃信号
真的很急,谢谢了

相关帖子

沙发
可木| | 2010-3-28 14:49 | 只看该作者
仿真最好用MODELSIM啊。。。。

使用特权

评论回复
板凳
ilove314| | 2010-3-28 16:49 | 只看该作者
Active-HDL也很强大

使用特权

评论回复
地板
wycawyc| | 2010-3-29 11:39 | 只看该作者
用quartus仿真慢死你。用modelsim吧。大家都这么干的吧?

使用特权

评论回复
5
tianya_langzhe| | 2010-4-8 13:03 | 只看该作者
请问下什么是“幅值为127的阶跃信号”啊?我们只用过高低电平和无符号整形数作为输入,你说的输入我不知道额

使用特权

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

本版积分规则

0

主题

1

帖子

0

粉丝