|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
大家好 我是一個才接觸FPGA的新手
朋友給了我一個4X4鍵盤的VERILOG來測試我新買的開發版
以下為內容
module key4x4scan (clock, kin, scansignal, KEY_num, LED);
input clock;
input[3:0] kin;
output[3:0] scansignal;
reg[3:0] scansignal;
output[3:0] KEY_num;
reg[3:0] KEY_num;
output[7:0] LED;
wire[7:0] LED;
reg[7:0] scans;
reg[3:0] scn;
reg[1:0] counter;
reg[0:7] LED_t;
reg[3:0] num;
always @(posedge clock)
begin
if (counter == 3)
begin
counter <= 0 ;
end
else
begin
counter <= counter + 1 ;
end
case (counter)
0 :
begin
scn <= 4'b1000 ;
end
1 :
begin
scn <= 4'b0100 ;
end
2 :
begin
scn <= 4'b0010 ;
end
3 :
begin
scn <= 4'b0001 ;
end
endcase
end
always @(negedge clock)
begin
case (scans)
8'b10000001 :
begin
num <= 0 ;
end
8'b10000010 :
begin
num <= 1 ;
end
8'b10000100 :
begin
num <= 2 ;
end
8'b10001000 :
begin
num <= 3 ;
end
8'b01000001 :
begin
num <= 4 ;
end
8'b01000010 :
begin
num <= 5 ;
end
8'b01000100 :
begin
num <= 6 ;
end
8'b01001000 :
begin
num <= 7 ;
end
8'b00100001 :
begin
num <= 8 ;
end
8'b00100010 :
begin
num <= 9 ;
end
8'b00100100 :
begin
num <= 10 ;
end
8'b00101000 :
begin
num <= 11 ;
end
8'b00010001 :
begin
num <= 12 ;
end
8'b00010010 :
begin
num <= 13 ;
end
8'b00010100 :
begin
num <= 14 ;
end
8'b00011000 :
begin
num <= 15 ;
end
default :
begin
end
endcase
scans <= {scn, kin} ;
scansignal <= scn ;
KEY_num <= num ;
LED_t <= 8'b00000000 ;
case (num)
0 :
begin
LED_t <= 8'b11111110 ;
end
1 :
begin
LED_t <= 8'b11111100 ;
end
2 :
begin
LED_t <= 8'b11111000 ;
end
3 :
begin
LED_t <= 8'b11110000 ;
end
4 :
begin
LED_t <= 8'b11100000 ;
end
5 :
begin
LED_t <= 8'b11000000 ;
end
6 :
begin
LED_t <= 8'b10000000 ;
end
7 :
begin
LED_t <= 8'b11110011 ;
end
default :
begin
LED_t <= 8'b11110011 ;
end
endcase
end
assign LED = LED_t ;
endmodule
可是我用了synthesize - XST功能旁邊都會有個黃色的警告標誌
會出現以下的字句
Partition Implementation Status
-------------------------------
No Partitions were found in this design.
-------------------------------
好像是說沒有分區塊?不太明白
但是還是能用Generate Programming File來生成jed文件燒錄
當然燒出來不能用...煩請各位大哥大姐幫忙解決問題!!!
感謝大家 |
|