-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegB.vhd
43 lines (35 loc) · 1.03 KB
/
RegB.vhd
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
----------------------------------------------------------------------------------
-- Company: Benha Faculty of Engineering
-- Engineer: Mariam El-Shakafi
-- Create Date: 18:27:02 05/03/2020
-- Module Name: RegB - Behavioral
-- Project Name: SAP1-VHDL
-- Description: This is an implementation of secondary data register (Register B).
--
-- 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 RegB is
Port ( Lb : in STD_LOGIC;
clk : in STD_LOGIC;
datain : in STD_LOGIC_VECTOR (7 downto 0);
dataout : out STD_LOGIC_VECTOR (7 downto 0));
end RegB;
architecture Behavioral of RegB is
signal B_content : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
begin
process (clk)
begin
if rising_edge(clk) then
if Lb = '1' then
B_content <= datain;
end if;
end if;
end process;
dataout <= B_content;
end Behavioral;