打印

菜鸟向大家请教一个VHDL问题

[复制链接]
1972|10
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
sdnd2000|  楼主 | 2007-5-3 15:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我用VHDL写个4选1多路选择器,用MAX+PLUS的,老是报错,大家帮我看看呀。谢谢大家。

library  ieee;
use ieee.std_logic_1164.all;
entity mux41 is
port ( s1,s0,a,b,c,d: in std_logic;
       y: out std_logic);
end entity mux41;
architecture one of mux41 is
 signal H1,H0: std_logic_vector(1 to 0);
begin 
 process (H1,H0)
begin
if H1='0' and H0='0' then y <= a;
end if;
if H1='0' and H0='1' then y <= b;
end if;
if H1='1' and H0='0' then y <= c;
end if;
if H1='1' and H0='1' then y <= d;
end if ;
end process;
end architecture one;

 

相关帖子

沙发
强仔| | 2007-5-3 17:48 | 只看该作者

菜鸟向大家请教一个VHDL问题

signal H1,H0: std_logic_vector(1 to 0);
改成:signal H1,H0: std_logic;

使用特权

评论回复
板凳
sdnd2000|  楼主 | 2007-5-3 19:17 | 只看该作者

不能改这个数据类型呀

忘了说了,题目要求是这样的,选择控制信号s1和s0的数据类型为 std_logic_vector,当s1='0',s0='0';s1='0',s0='1';s1='1',s0='0';s1='1',s0='1';时,分别执行y<=a,y<=b,y<=c,y<=d.

使用特权

评论回复
地板
buqibushe| | 2007-5-6 19:02 | 只看该作者

这句有语法错误

signal H1,H0: std_logic_vector(1 to 0);
 

使用特权

评论回复
5
xqhe| | 2007-5-7 10:46 | 只看该作者

随便说说

      你定义的S0,S1好象根本没用哦,却用了H0,H1.而且H0,H1是2位的向量,你判断时对其一位判断,不知是不是这样

使用特权

评论回复
6
heartsease| | 2007-5-15 10:32 | 只看该作者

这样就对了

library  ieee;
use ieee.std_logic_1164.all;
entity eda2 is
port ( s1,s0,a,b,c,d : in std_logic;
       y             : out std_logic);
end entity eda2;
architecture a of eda2 is
begin 
process 
 begin
  IF (s1='0' and s0='0')  THEN
     y <= a;
ELSIF  (s1='0' and s0='1' ) THEN
    y <= b;

ELSIF (s1='1' and s0='0' ) THEN
    y <= c;

ELSE
    y <= d;
END IF;

 END PROCESS;
END  a;

使用特权

评论回复
7
zhanghao35| | 2007-5-20 15:38 | 只看该作者

小错误,我有新的方法.

library  ieee;
use ieee.std_logic_1164.all;

entity mux41 is
port ( s1,s0,a,b,c,d: in std_logic;
       y: out std_logic);
end entity mux41;
architecture one of mux41 is
signal sel:std_logic_vector(1 downto 0);
begin
    sel<=s0&s1;
process(sel)
begin
    case sel  is
        when "00" => y<=a;
        when "01" => y<=b;
        when "10" => y<=c;
        when "11" => y<=d;
        when others => null;
    end case;
end process;
end one;

使用特权

评论回复
8
frily| | 2007-6-2 19:29 | 只看该作者

fgsfg

fgsdfgsdf

使用特权

评论回复
9
dspjs| | 2007-6-26 18:58 | 只看该作者

你的敏感信号表里面不应该是H吧.太牛了.

使用特权

评论回复
10
paypc| | 2007-7-16 21:02 | 只看该作者

慢慢就好

我刚学EDA时也常犯这种低级错误,不过慢慢就好了,多花点时间吧

使用特权

评论回复
11
dspjs| | 2007-7-17 11:33 | 只看该作者

慢慢来吧,我也刚学EDA,这次课程设计把人弄坏了.细心点,有些耐心吧.

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

13

主题

17

帖子

0

粉丝