d3_8l.vhd

来自「xilinx xc9572 cpld 实现的伺服电机控制器」· VHDL 代码 · 共 85 行

VHD
85
字号
--------------------------------------------------------------------------------
-- Copyright (c) 1995-2003 Xilinx, Inc.
-- All Right Reserved.
--------------------------------------------------------------------------------
--   ____  ____ 
--  /   /\/   / 
-- /___/  \  /    Vendor: Xilinx 
-- \   \   \/     Version : 6.3i
--  \   \         Application : 
--  /   /         Filename : xil_1076_5
-- /___/   /\     Timestamp : 04/03/2006 09:13:06
-- \   \  /  \ 
--  \___\/\___\ 
--
--Command: 
--Design Name: d3_8l
--

library ieee;
use ieee.std_logic_1164.ALL;
use ieee.numeric_std.ALL;
-- synopsys translate_off
library UNISIM;
use UNISIM.Vcomponents.ALL;
-- synopsys translate_on

entity d3_8l is
   port ( A0 : in    std_logic; 
          A1 : in    std_logic; 
          A2 : in    std_logic; 
          E  : in    std_logic; 
          D0 : out   std_logic; 
          D1 : out   std_logic; 
          D2 : out   std_logic; 
          D3 : out   std_logic; 
          D4 : out   std_logic; 
          D5 : out   std_logic; 
          D6 : out   std_logic; 
          D7 : out   std_logic);
end d3_8l;

architecture BEHAVIORAL of d3_8l is
signal  addr: std_logic_vector (2 downto 0);
signal  Dout: std_logic_vector (7 downto 0);
begin
  addr<=A2 & A1 & A0;
  process(addr,E) 
  begin
  if(E='1') then
    Dout<="11111111";
  else
    case addr  is
	  
	    when  "000"=> Dout<="11111110"; 
	    when  "001"=> Dout<="11111101";
	    when  "010"=> Dout<="11111011";
	    when  "011"=> Dout<="11110111";
	    when  "100"=> Dout<="11101111";
	    when  "101"=> Dout<="11011111";
	    when  "110"=> Dout<="10111111";
	    when  "111"=> Dout<="01111111";
       when others=> Dout<="11111111";
	 end case; 
  end if;
  end  process;
 
 D0<=Dout(0);
 D1<=Dout(1);
 D2<=Dout(2);
 D3<=Dout(3);
 D4<=Dout(4);
 D5<=Dout(5);
 D6<=Dout(6);
 D7<=Dout(7);

end BEHAVIORAL;

-- synopsys translate_off
configuration CFG_d3_8l of  d3_8l is
   for BEHAVIORAL
   end for;
end CFG_d3_8l;
-- synopsys translate_on

⌨️ 快捷键说明

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