aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-organization-experiment/register.vhdl
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-24 19:35:16 +0800
committercrupest <crupest@outlook.com>2021-12-24 19:35:16 +0800
commit496f67d0c03a1b61153b565f67ffbfcc9f6ed3a6 (patch)
tree211679b30c1d2dd393ba4e7a549dc997cc814bfc /works/life/computer-organization-experiment/register.vhdl
parent246028dd6c23b5fc1efb3dc53c2fddd79ba865de (diff)
downloadcrupest-496f67d0c03a1b61153b565f67ffbfcc9f6ed3a6.tar.gz
crupest-496f67d0c03a1b61153b565f67ffbfcc9f6ed3a6.tar.bz2
crupest-496f67d0c03a1b61153b565f67ffbfcc9f6ed3a6.zip
import(life): ...
Diffstat (limited to 'works/life/computer-organization-experiment/register.vhdl')
-rw-r--r--works/life/computer-organization-experiment/register.vhdl21
1 files changed, 21 insertions, 0 deletions
diff --git a/works/life/computer-organization-experiment/register.vhdl b/works/life/computer-organization-experiment/register.vhdl
new file mode 100644
index 0000000..8d24bd6
--- /dev/null
+++ b/works/life/computer-organization-experiment/register.vhdl
@@ -0,0 +1,21 @@
+library ieee;
+
+entity register is
+ port (
+ D : in std_logic_vector(31 downto 0);
+ CLK, EN, CLRN: in std_logic;
+ Q: out std_logic_vector(31 downto 0)
+ )
+end register;
+
+architecture Behavioral of register is
+begin
+ storage: process is
+ begin
+ if CLRN = '0' then
+ Q <= H"00000000";
+ elsif rising_edge(CLK) and EN = '1' then
+ Q <= D;
+ end if;
+ end process;
+end Behavioral;