作者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)