- UID
- 109333
- 性别
- 男
|
我刚刚学习这个语言,碰到以下问题.请指教
1.这个程序错误在第四行:我已经将错误标出.实在是不明白!
module sequential_signal_gen(clk,in1,in2,d_out,g);
input in1,in2,clk;
output d_out,g;
reg d_out,g;//"Node 'd_out' missing source" "Node 'd_out' missing source"
initial
begin
g=0;
case({clk,in1,in2})
3'b100: d_out=0;
3'b101: d_out=1;
3'b110: d_out=0;
3'b111: d_out=1;
default:g=1;
endcase
end
endmodule
2.同时有两个时钟沿控制的8位移位寄存器
module 8bit_shift_register(d_in,d_out,clk1,clk2);
input clk1,d_in,clk2;
output d_out;
reg d_out;
reg[1:7] data;
reg[1:4] i;
always@(posedge clk1 or negedge clk2)
begin
d_out=data[1];
for(i=1;i<7;i=i+1)
data=data[i+1];
data[7]=d_in;
end
endmodule
编译提示错误:"Always Construct error:more than one register in theEvent Control of an Always Construct is not used in the rest of the always construct |
|