Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- entity ALU_Driver is
- Port ( clk : in STD_LOGIC;
- A : out STD_LOGIC_VECTOR (15 downto 0);
- B : out STD_LOGIC_VECTOR (15 downto 0);
- opCode : out STD_LOGIC_VECTOR (2 downto 0));
- end ALU_Driver;
- architecture Behavioral of ALU_Driver is
- -- signals
- signal tempA : STD_LOGIC_VECTOR (15 downto 0) := x"0000";
- signal tempB : STD_LOGIC_VECTOR (15 downto 0) := x"0000";
- signal tempCode : STD_LOGIC_VECTOR (2 downto 0) := "000";
- type typeA is array (0 to 7) of STD_LOGIC_VECTOR (15 downto 0); -- 1st number
- signal As : typeA := (x"000A", x"FFFF", x"DDDD", x"DDDD", x"DDDD", x"F10C", x"F0F0", x"AAAA");
- type typeB is array (0 to 7) of STD_LOGIC_VECTOR (15 downto 0); -- 2nd number
- signal Bs : typeB := (x"0003", x"FFFF", x"DDDD", x"DDDD", x"DDDD", x"FEB3", x"0F0F", x"AA55");
- type typeCode is array (0 to 7) of STD_LOGIC_VECTOR (2 downto 0); -- opration
- signal opCodes : typeCode := (000, 001, 010, 011, 100, 101, 110, 111);
- begin
- process(clk)
- -- variables
- variable i : INTEGER range 0 to 10 := 0;
- begin
- if(rising_edge(clk)) then
- if (i < 8)
- tempA <= As(i);
- tempB <= Bs(i);
- tempCode <= opCodes(i);
- i = i + 1;
- end if;
- end if;
- A <= tempA;
- B <= tempB;
- opCode <= tempCode;
- end process;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement