作者lazyox (毅)
看板KS94-312
标题借放
时间Fri Dec 7 11:56:04 2007
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
entity COW is
port(clk: in std_logic;
eoc:in std_logic;
sta:out std_logic;
ale:out std_logic;
mode:in std_logic;
reset:in std_logic;
d:in std_logic_vector(7 downto 0);
out_y:out std_logic_vector(7 downto 0);
out_x:out std_logic_vector(7 downto 0);
con:out std_logic_vector(4 downto 0)
);
end COW;
architecture stru of COW is
signal counter:std_logic_vector(4 downto 0);
signal temp,tempQ:std_logic;
signal x,y:std_logic_vector(7 downto 0);
begin
process(clk)
begin
if reset='0' then
sta<='0';
ale<='0';
out_x<="00000000";
out_y<="00000000";
con<="00000";
else
if eoc'event and eoc='1' then
if mode='1' then
x<=d;
y<=y;
else
y<=d;
x<=x;
end if;
end if;
if eoc='1' then
if clk'event and clk='1' then
counter<=counter+1;
if counter="01111" then
temp<='1'; --temp=ale
--counter<="00000";
else
temp<='0';
end if;
if temp='1' then
tempQ<='1'; --tempQ=sta
else
tempQ<='0';
end if;
end if;
else
counter<="00000";
if clk'event and clk='1' then
tempQ<='0';
end if;
end if;
end if;
ale<=temp;
sta<=tempQ;
out_x<=x;
out_y<=y;
con<=counter;
end process;
end stru;
--
★hugoFF 好人~~~!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.166.161
1F:推 rangerx:VHDL ....我们现在也在学 一整个搞不懂 12/07 16:13
2F:→ lazyox:哈 我们感觉只是粗浅的学 你们应该厉害许多吧= = 12/07 16:46
3F:推 Liuboy17:天书... 12/07 17:18
4F:推 acquarious:天ㄚ 这是什麽? 12/07 19:31
5F:推 aeolus1215:硬体描述语言 还有verilog = = 12/08 02:44
6F:推 hugoFF:谢刚是那种搞不懂 还是交得出作业的人 干! 12/08 18:04
7F:推 ert0700: 刚是那种搞不懂 还是交得出作业的人 干! 12/10 09:28
8F:推 Calaglin:刚是那种搞不懂 还是交得出作业的人 干! 再补一刀 12/10 23:49
※ 编辑: lazyox 来自: 61.223.210.220 (01/10 00:26)