-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAC.vhd
More file actions
46 lines (36 loc) · 1.17 KB
/
Copy pathAC.vhd
File metadata and controls
46 lines (36 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
----------------------------------------------------------------------------------
-- Company: Benha Faculty of Engineering
-- Engineer: Mariam El-Shakafi
-- Create Date: 18:32:09 05/03/2020
-- Module Name: AC - Behavioral
-- Project Name: SAP1-VHDL
-- Description: This is an implementation of accumulator register
-- Dependencies: None
-- Version: 1.0
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity AC is
Port ( clk : in STD_LOGIC;
La : in STD_LOGIC;
Ea : in STD_LOGIC;
datain : in STD_LOGIC_VECTOR (7 downto 0);
dataout_bus : out STD_LOGIC_VECTOR (7 downto 0);
dataout_alu : out STD_LOGIC_VECTOR (7 downto 0));
end AC;
architecture Behavioral of AC is
signal AC_content : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
begin
process (clk)
begin
if rising_edge(clk) then
if La = '1' then
AC_content <= datain;
end if;
end if;
end process;
dataout_alu <= AC_content;
dataout_bus <= AC_content when Ea = '1' else (others => 'Z');
end Behavioral;