always@(posedge clk or negedge rst) begin if(!rst) begin cnt<=0; dataout<=8'b1110_0111;//0->Led on, 1->Led off end else begin cnt<=cnt+1; if(cnt==23'h7fffff) begin dataout[2:0]<=dataout[3:1]; dataout[3]<=dataout[0]; dataout[6:4]<=dataout[7:5]; dataout[7]<=dataout[4]; end end end endmodule
PIN脚下配置的约束文件如下: #PACE: Start of PACE I/O Pin Assignments NET "clk" LOC = "P80" | IOSTANDARD = LVCMOS33 | IOBDELAY = NONE ; NET "dataout[0]" LOC = "P15" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[1]" LOC = "P16" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[2]" LOC = "P18" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[3]" LOC = "P19" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[4]" LOC = "P20" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[5]" LOC = "P21" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[6]" LOC = "P22" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "dataout[7]" LOC = "P24" | IOSTANDARD = LVCMOS33 | SLEW = SLOW ; NET "rst" LOC = "P161" | IOSTANDARD = LVCMOS33 | IOBDELAY = NONE ;
if(cnt==23'h7fffff) begin
dataout[2:0]<=dataout[3:1];
dataout[3]<=dataout[0];
dataout[6:4]<=dataout[7:5];
dataout[7]<=dataout[4];
end
这段程序好像没有移位???....
要移位应该用拼接运算号吧......
初学者,我感到挺困惑的..
用户203017 2009-7-7 00:53
walnutcy_696810119 2008-8-2 00:48
ilove314_323192455 2008-8-2 00:01