Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.85 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. entity busint is
  5. port
  6. (
  7.         ADR : in signed(31 downto 0);
  8.         DO : in signed(31 downto 0);
  9.         Smar, Smbr, WRin, RDin : in bit;
  10.         AD : out signed (31 downto 0);
  11.         D : inout signed (31 downto 0);
  12.         DI : out signed(31 downto 0);
  13.         WR, RD : out bit
  14. );
  15. end entity;
  16.  
  17. architecture rtl of busint is
  18. begin
  19. process(Smar, ADR, Smbr, DO, D, WRin, RDin)
  20.     variable MBRin, MBRout: signed(31 downto 0);
  21.     variable MAR : signed(31 downto 0);
  22. begin
  23.     if(Smar='1') then MAR := ADR; end if;
  24.     if(Smbr='1') then MBRout := DO; end if;
  25.     if (RDin='1') then MBRin := D; end if;
  26.     if (WRin='1') then D <= MBRout;
  27.     else D <= "ZZZZZZZZZZZZZZZZ";
  28.     end if;
  29.     DI <= MBRin;
  30.     AD <= MAR;
  31.     WR <= WRin;
  32.     RD <= RDin;
  33. end process;
  34. end rtl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement