diff options
author | crupest <crupest@outlook.com> | 2021-12-24 19:35:16 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-12-24 19:35:16 +0800 |
commit | c17673ea6b100f7b8766c6acccfb38e356a9c286 (patch) | |
tree | ff9d67846a2c419b081ba6294aefa8e3cbd95743 /computer-organization-experiment/register.vhdl | |
parent | 660bf1353a1711112cdf486bb45bc1b3333df9b4 (diff) | |
download | life-c17673ea6b100f7b8766c6acccfb38e356a9c286.tar.gz life-c17673ea6b100f7b8766c6acccfb38e356a9c286.tar.bz2 life-c17673ea6b100f7b8766c6acccfb38e356a9c286.zip |
...
Diffstat (limited to 'computer-organization-experiment/register.vhdl')
-rw-r--r-- | computer-organization-experiment/register.vhdl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/computer-organization-experiment/register.vhdl b/computer-organization-experiment/register.vhdl new file mode 100644 index 0000000..8d24bd6 --- /dev/null +++ b/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; |