Re: [請益] FPGA(VHDL)實現雙輸入單輸出開關
大家好~
我後來嘗試採用下列的語法來實現電路,
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mul is
port
(
sig1, sig2, ck13, ck132 : in std_logic;
Output : out std_logic
);
end entity mul;
architecture Behavioral of mul is
signal temp : std_logic_vector(1 downto 0);
begin
temp<= ck13 & ck132;
process(temp) is
begin
case temp is
when "10" => Output <= sig1;
when "01" => Output <= sig2;
when others => Output <= '0';
end case;
end process;
end architecture Behavioral;
不過會出現下面的錯誤:
Warning (10492): VHDL Process Statement warning at mul.vhd(20): signal "sig1"
is read inside the Process Statement but isn't in the Process Statement's
sensitivity list
Warning (10492): VHDL Process Statement warning at mul.vhd(21): signal "sig2"
is read inside the Process Statement but isn't in the Process Statement's
sensitivity list
請問大家有什麼建議嗎??~謝謝大家!!!!
※ 引述《c137596 (神手的同學)》之銘言:
: 大家好~
: 小弟第一次接觸FPGA,所以很多地方不懂
: 需要實現的電路圖如下面的網址:
: http://imageshack.us/photo/my-images/828/ck13.jpg/
: SIGNAL1 和SIGNAL2是輸入的訊號,兩顆MOS是用來當作開關
: CK13 和 CK13-是用開控制開關的訊號,目的是要讓SINGAL1.2
: 分別在CK13 和CK13-輸出到VOUT,
: 是使用QUARTUS II作模擬,本來以為用內建的BLOCK就可以兜出來
: 不過後來這個部分沒有 MODEL可以叫,因此要採用VHDL來實現
: 目前我打得語法是:
: library ieee;
: use ieee.std_logic_1164.all;
: entity swich2 is
: port(sig1 : in std_logic;
: sig2 : in std_logic;
: ck13 : in std_logic;
: ck132 : in std_logic;
: vout : out std_logic);
: end swich2;
: architecture sig2 of swich2 is
: begin
: if ck13='1' then
: vout<= sig1;
: elsif ck132='1' then
: vout<= sig2;
: else
: vout<='0';
: end if;
: end sig2;
: 請問是否有哪邊有問題呢?
: 沒有學過VHDL相關的課程= =~只能對著講義照感覺打@@
: 謝謝囉!!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.23.67
→
12/15 17:05, , 1F
12/15 17:05, 1F
→
12/15 17:09, , 2F
12/15 17:09, 2F
→
12/15 22:02, , 3F
12/15 22:02, 3F
→
12/15 22:02, , 4F
12/15 22:02, 4F
→
12/15 22:03, , 5F
12/15 22:03, 5F
→
12/15 22:03, , 6F
12/15 22:03, 6F
→
12/15 22:03, , 7F
12/15 22:03, 7F
→
12/15 22:12, , 8F
12/15 22:12, 8F
→
12/15 22:12, , 9F
12/15 22:12, 9F
→
12/15 22:13, , 10F
12/15 22:13, 10F
推
12/15 23:31, , 11F
12/15 23:31, 11F
→
12/15 23:32, , 12F
12/15 23:32, 12F
→
12/15 23:32, , 13F
12/15 23:32, 13F
→
12/16 00:01, , 14F
12/16 00:01, 14F
→
08/13 19:20, , 15F
08/13 19:20, 15F
→
09/17 23:14, , 16F
09/17 23:14, 16F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):