begin
count<=count+1'b1;
clk_4hz<=0;
end
else
begin
count<=0;
clk_4hz<=1;
end
end
endmodule
生成模块:
(2)扫描,控制速度:
modulesudu(clk,cnt);
inputclk;
outputcnt;
regcnt;
reg[15:
0]p;
always(posedgeclk)
begin
if(p==16'b1111111111111111)
begin
cnt<=1'b1;
p<=16'b0000000000000000;
end
else
begin
p<=p+16'b1;
cnt<=1'b0;
end
end
endmodule
生成模块:
(3)显示汉字模块:
modulexianshi(clk2,clk3,row,con,k);
inputclk2,clk3,k;
output[15:
0]row;
output[15:
0]con;
reg[15:
0]row;
reg[15:
0]con;
integercnt,b;
reg[15:
0]r[111:
0];
initial
begin
//中
r[0]<=16'b1111111111111111;
r[1]<=16'b1111111111111111;
r[2]<=16'b1111100000011111;
r[3]<=16'b1111101111011111;
r[4]<=16'b1111101111011111;
r[5]<=16'b1111101111011111;
r[6]<=16'b1111101111011111;
r[7]<=16'b1000000000000001;
r[8]<=16'b1111101111011111;
r[9]<=16'b1111101111011111;
r[10]<=16'b1111101111011111;
r[11]<=16'b1111101111011111;
r[12]<=16'b1111100000011111;
r[13]<=16'b1111111111111111;
r[14]<=16'b1111111111111111;
r[15]<=16'b1111111111111111;
//国
r[16]<=16'b1111111111111111;
r[17]<=16'b1111111111111111;
r[18]<=16'b1100000000000111;
r[19]<=16'b1101111111110111;
r[20]<=16'b1101011011010111;
r[21]<=16'b1101011011010111;
r[22]<=16'b1101011011010111;
r[23]<=16'b1101000000010111;
r[24]<=16'b1101011011010111;
r[25]<=16'b1101011011010111;
r[26]<=16'b1101001011010111;
r[27]<=16'b1101011011010111;
r[28]<=16'b1101111111110111;
r[29]<=16'b1100000000000111;
r[30]<=16'b1111111111111111;
r[31]<=16'b1111111111111111;
//石
r[32]<=16'b1111111111111111;
r[33]<=16'b1111111111111111;
r[34]<=16'b1110111111110111;
r[35]<=16'b1111011111110111;
r[36]<=16'b1111101111110111;
r[37]<=16'b1111110111110111;
r[38]<=16'b1110100001110111;
r[39]<=16'b1110111100110111;
r[40]<=16'b1110111101010111;
r[41]<=16'b1110111101100111;
r[42]<=16'b1110111101100111;
r[43]<=16'b1110000001110111;
r[44]<=16'b1111111111110111;
r[45]<=16'b1111111111110111;
r[46]<=16'b1111111111111111;
r[47]<=16'b1111111111111111;
//油
r[48]<=16'b1111111111111111;
r[49]<=16'b1111111111111111;
r[50]<=16'b1111111011101111;
r[51]<=16'b1000000111011111;
r[52]<=16'b1111101110111111;
r[53]<=16'b1111111111111111;
r[54]<=16'b1100000001111111;
r[55]<=16'b1101101101111111;
r[56]<=16'b1101101101111111;
r[57]<=16'b1100000000000111;
r[58]<=16'b1101101101111111;
r[59]<=16'b1101101101111111;
r[60]<=16'b1100000001111111;
r[61]<=16'b1111111111111111;
r[62]<=16'b1111111111111111;
r[63]<=16'b1111111111111111;
//大
r[64]<=16'b1111111111111111;
r[65]<=16'b1101111111111111;
r[66]<=16'b1110111111111111;
r[67]<=16'b1110111110111111;
r[68]<=16'b1111011110111111;
r[69]<=16'b1111101110111111;
r[70]<=16'b1111110010111111;
r[71]<=16'b1111111100001111;
r[72]<=16'b1111110010111111;
r[73]<=16'b1111101110111111;
r[74]<=16'b1111011110111111;
r[75]<=16'b1110111110111111;
r[76]<=16'b1110111111111111;
r[77]<=16'b1101111111111111;
r[78]<=16'b1111111111111111;
r[79]<=16'b1111111111111111;
//学
r[80]<=16'b1111111111111111;
r[81]<=16'b1111111111111111;
r[82]<=16'b1111111101111111;
r[83]<=16'b1111011110111111;
r[84]<=16'b1111011111011101;
r[85]<=16'b1111011011010011;
r[86]<=16'b1011011011011101;
r[87]<=16'b1000001011010011;
r[88]<=16'b1111010011011111;
r[89]<=16'b1111011011000111;
r[90]<=16'b1111011111011001;
r[91]<=16'b1111011101011111;
r[92]<=16'b1111111110011111;
r[93]<=16'b1111111111111111;
r[94]<=16'b1111111111111111;
r[95]<=16'b1111111111111111;
//中
r[96]<=16'b1111111111111111;
r[97]<=16'b1111111111111111;
r[98]<=16'b1111100000011111;
r[99]<=16'b1111101111011111;
r[100]<=16'b1111101111011111;
r[101]<=16'b1111101111011111;
r[102]<=16'b1111101111011111;
r[103]<=16'b1000000000000001;
r[104]<=16'b1111101111011111;
r[105]<=16'b1111101111011111;
r[106]<=16'b1111101111011111;
r[107]<=16'b1111101111011111;
r[108]<=16'b1111100000011111;
r[109]<=16'b1111111111111111;
r[110]<=16'b1111111111111