这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » 请网友们 帮帮忙啊!~

共5条 1/1 1 跳转至

请网友们 帮帮忙啊!~

菜鸟
2009-08-07 17:51:30     打赏

    library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
entity h_adder2 is
  port(a,b:in std_logic;
       so,co:out std_logic);
end;
architecture bhv of h_adder2 is
  signal ab:std_logic_vector(1 downto 0);
  begin
  ab<=a&b;
  process(ab)
  begin
  case ab is
  when "00"=>so<='0';co<='0';
  when "01"=>so<='1';co<='0';
  when "10"=>so<='1';co<='0';
  when "11"=>so<='0';co<='1';
  end case;
  end process;
end;
 
library ieee;
use ieee.std_logic_1164.all;
entity or2a is
  port(a,b:in std_logic;
         c:out std_logic);
end;
architecture bhv of or2a is
  begin
  c<=a or b;
end;          

library ieee;
use ieee.std_logic_1164.all;
entity f_adder is
  port(ain,bin,cin:in std_logic;
          sum,count:out std_logic);
end;
architecture bhv of f_adder is
  component h_adder
      port(a,b:in std_logic;
           co,so:out std_logic);
   end component;
 
  component or2a
      port(a,b:in std_logic;
             c:out std_logic);
    end component;
   signal d,e,f:std_logic;
   begin
   u1:h_adder port map(a=>ain,b=>bin,co=>d,so=>e);
   u2:h_adder port map(a=>e,b=cin,co=>f,so=>sum);
   u3:or2a port map(a=>d,b=>f,c=>count);
   end;          

    这个程序编译时倒数第三行出错  错误提示为Error (10437): VHDL Association List error at f_adder.vhd(53): positional associations must be listed before named associations

    麻烦各位网友帮忙解释一下撒!!!




关键词: 网友     帮帮忙     logic    

院士
2009-08-07 17:57:13     打赏
2楼
我晕~

菜鸟
2009-08-08 18:15:45     打赏
3楼
    晕啥子!~

菜鸟
2010-08-13 22:22:12     打赏
4楼
u2:h_adder port map(a=>e,b=cin,co=>f,so=>sum);
此行错了,应该是b=>cin,少了一个大于号。

助工
2010-08-27 12:33:02     打赏
5楼
dd

共5条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]