请来查一下,错在哪儿?关键词:verilog 滤波
- UID
- 84263
- 性别
- 男
|
请来查一下,错在哪儿?关键词:verilog 滤波
module phaphb1(seg , pha , phb , clock); //定义模块结构
output [7:0] seg; //定义数码管段输出引脚
input clock; //定义输入时钟引脚
input pha,phb; //定义输入相位
reg [3:0] sl_reg; //定义数码管选择输出寄存器
reg [1:0] prestate;
reg [3:0] disp_dat; //定义显示数据寄存器
reg [5:0] count; //定义计数器寄存器
reg [7:0] countPos;
reg [1:0] nvbocnt;
reg phabk,phbbk;
reg phaa,phbb;
reg [1:0] ph;
reg bit_nb;
always @(pha or phb)
begin
phaa=pha;
phbb=phb;
end
always @(posedge clock)
begin
if(phaa==phabk && phbb==phbbk)
nvbocnt = nvbocnt + 1;
else
phabk=phaa;
phbbk=phbb;
nvbocnt = 0;
if(nvbocnt > 2)
begin
ph[0]=phaa;
ph[1]=phbb;
nvbocnt=0;
end
end
always @(ph)
begin
case(ph)
2'b00:
begin
case(prestate)
2'h3: countPos = countPos + 1;
2'h1: countPos = countPos - 1;
endcase
prestate = 0;
end
2'b10:
begin
case(prestate)
2'h0: countPos = countPos + 1;
2'h2: countPos = countPos - 1;
endcase
prestate = 1;
end
2'b11:
begin
case(prestate)
2'h1: countPos = countPos + 1;
2'h3: countPos = countPos - 1;
endcase
prestate = 1;
end
2'b01:
begin
case(prestate)
2'h2: countPos = countPos + 1;
2'h0: countPos = countPos - 1;
endcase
prestate = 3;
end
endcase
end
always @(posedge clock) //定义clock信号下降沿触发
begin
count=count+1; //计数器值加1
if (count[5:0]==6'b011111)
bit_nb=1;
else
bit_nb=0;
end
assign seg=countPos; //输出数码管译码结果
endmodule
----------------------------------------------------------------------------------
这是我写的一个相差90度的正交信号检测,用到滤波,计数
这个程序编译以后出现警告如下
Warning:Ignored unnecessary INPUT pin 'pha'
Warning:Ignored unnecessary INPUT pin 'phb'
编译也通过了,却居然将我的两个最主要的输入脚忽略了,请高手指点,错在何处 |
|
|
|
|
|
- UID
- 84263
- 性别
- 男
|
|
|
|
|
|