half_1.vhd

来自「大家一定要看 哦 程序在与多看多练 我找了好久才找到呢」· VHDL 代码 · 共 42 行

VHD
42
字号

--block------
--***************************
library ieee;
use ieee.std_logic_1164.all;   --库定义                                 
--*************************--
ENTITY half_1 IS
  PORT(a,b: in bit;
        s,c:out bit);
END  ;                             --端口定义     
--************************************
ARCHITECTURE addr1 OF half_1  IS
BEGIN
   s<=a xor b;
   c<=a and b;
end addr1;
ARCHITECTURE addr2 OF half_1  IS
BEGIN
  example:block
     PORT(a,b: in bit;
        s,c:out bit);
    port map(a,b,s,c);
  begin
   p1:process(a,b)
    begin
      s<=a or b;
   end process p1;
   p2:process(a,b)
    begin
      c<=a and b;
    end process p2;
   end block example;
 end addr2;


configuration and2xor of half_1 is
for addr2
end for;
end and2xor;


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?