Advertisement
Guest User

PCMCIA SRAM CPLD ctrl

a guest
Jan 8th, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.29 KB | None | 0 0
  1. LIBRARY IEEE;
  2. USE IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. ENTITY main IS
  5.     PORT ( ce1 : IN  STD_LOGIC;
  6.            ce2 : IN  STD_LOGIC;
  7.            reg : IN  STD_LOGIC;
  8.            a0 : IN  STD_LOGIC;
  9.            oe_even : OUT  STD_LOGIC;    -- OE for even byte
  10.            oe_odd : OUT  STD_LOGIC; -- OE for odd byte
  11.            oe_oddlow : OUT  STD_LOGIC;  -- OE odd byte on d0-d7
  12.            ce_attr : OUT  STD_LOGIC;    -- CE for attribute memory
  13.            ce_upp : OUT  STD_LOGIC; -- CE for upper SRAM
  14.            ce_low : OUT  STD_LOGIC);    -- CE for lower SRAM
  15. END main;
  16.  
  17. ARCHITECTURE behavioral OF main IS
  18.  
  19. BEGIN
  20.  
  21.     ce_low <= '0' WHEN reg='1' AND ce1='0' ELSE '1';
  22.     ce_upp <= '0' WHEN reg='1' AND ce2='0' ELSE '1';
  23.  
  24.     oe_even <= '0' WHEN reg='1' AND ce1='0' AND ce2='0' ELSE -- x16
  25.            '0' WHEN reg='1' AND ce1='0' AND ce2='1' AND a0='0' ELSE -- x8
  26.            '1';
  27.            
  28.     oe_odd <= '0' WHEN reg='1' AND ce1='0' AND ce2='0' ELSE -- x16
  29.           '0' WHEN reg='1' AND ce1='1' AND ce2='0' ELSE -- x8
  30.           '1';
  31.                      
  32.     -- separate output enable for odd byte on d7-d0
  33.     oe_oddlow <= '0' WHEN reg='1' AND ce1='0' AND ce2='1' AND a0='1' ELSE -- x8
  34.              '1';
  35.                          
  36.     ce_attr <= '0' WHEN reg='0' AND ce1='0' AND ce2='0' ELSE
  37.            '0' WHEN reg='0' AND ce1='0' AND ce2='1' AND a0='0' ELSE
  38.            '1';
  39.                        
  40. END behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement