作者c137596 (神手的同学)
看板Electronics
标题Re: [请益] FPGA(VHDL)实现双输入单输出开关
时间Thu Dec 15 16:07:48 2011
大家好~
我後来尝试采用下列的语法来实现电路,
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
1F:→ Aquatics:VHDL检查比较严谨. 不影响的. 12/15 17:05
2F:→ c137596:请问是否只要不出现ERROR基本上都是OK的呢?谢谢 12/15 17:09
3F:→ mmonkeyboyy:不是 但你这一个应该没问题 12/15 22:02
4F:→ mmonkeyboyy:但其实你直接查MUX要怎麽用就好了 XD 12/15 22:02
5F:→ mmonkeyboyy:我不太懂你 CASE 132 13为什麽要这样写 12/15 22:03
6F:→ mmonkeyboyy:这不就是一个inverter的罗辑 ? 如果要实现功能 12/15 22:03
7F:→ mmonkeyboyy:其实这些线都不用写 12/15 22:03
8F:→ c137596:原来这个就是MUX阿@@~~哈哈~ 12/15 22:12
9F:→ c137596:您是说用 CK13 和 not CK13吗?? 12/15 22:12
10F:→ c137596:不好意思~~都没有碰过VHDL@@~~ 12/15 22:13
11F:推 mmonkeyboyy:不是啊 在判断句 ...不用input not ck13 12/15 23:31
12F:→ mmonkeyboyy:你只要一个input就可以决定谁开谁关了是吧 12/15 23:32
13F:→ mmonkeyboyy:1 是一种 0是另一种 12/15 23:32
14F:→ c137596:对耶!!!!!~~我都没发现XDD~谢谢罗!^^ 12/16 00:01