个人的实验,但是程序方面做不下去了,请大侠们多多指教呀...
此程序是关于三个点阵在电梯方面的显示.即电梯到了那一层就显示那一层.这里为三层的模块.这个程序不完整.中间部分给做不出来了.程序如下.
开始一些部分给省略了..................
Process (clk)
Begin
If (clk’event and clk=’1’) then
If(location=0) then ------------display1
Col1<=”00000001”;
Col2<=”00100001”;
Col3<=”01111111”;
Col4<=”11111111”;
Col5<=”00000001”;
Col6<=”00000001”;
Elsif(location=1) then -----------display2
Col1<=”01100011”;
Col2<=”11100111”;
Col3<=”10001101”;
Col4<=”10011001”;
Col5<=”11110011”;
Col6<=”01100111”;
Elsif(location=2) then -----------display3
Col1<=”01000010”;
Col2<=”11011011”;
Col3<=”10011001”;
Col4<=”10011001”;
Col5<=”11111111”;
Col6<=”01100110”;
End if;
End if;
End process;
Process(clk) -------------accumulate dcount
Begin
If(clk’event and clk=’1’) then
Dcount<=dcount+1;
End if;
End process;
Process(clk)
Begin
If(clk’event and clk=’1’) then
Sa<=dcount(0);
Sb<=dcount(1);
Sc<=dcount(2);
Case dcount is
When “111”=>display<=”00000000”;
........................(此处搞不出来,谁给补充完整呀,万分感谢!!!!!)
when others=>display<="00000000";
end case;
end if;
end process;
process(clk) ------------in this process,a,b,c,e,f,g and dot will output
begin
if(clk'event and clk='1') then
r0<=display(7);
r1<=display(6);
r2<=display(5);
r3<=display(4);
r4<=display(3);
r5<=display(2);
r6<=display(1);
r7<=display(0);
end if;
end process;
end behave;