noshare.vhd

来自「几个简单数字逻辑电路的VHDL代码」· VHDL 代码 · 共 30 行

VHD
30
字号
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity ForceShare is port (
  a,b,c,d,e,f: in std_logic_vector (7 downto 0);
  result: out std_logic_vector(7 downto 0)
  );
end ForceShare;

architecture behaviour of ForceShare is

begin

  sum: process (a,c,b,d,e,f)
  begin

    if (a + b = "10011010") then
      result <= c;
    elsif (a + b = "01011001") then
          result <= d;
    elsif (a + b = "10111011") then
      result <= e;
    else
      result <= f;
    end if;
  end process;

end behaviour;

⌨️ 快捷键说明

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