aboutsummaryrefslogtreecommitdiff
path: root/works/life
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-24 19:36:03 +0800
committercrupest <crupest@outlook.com>2021-12-24 19:36:03 +0800
commit8b5598a275b0b0bad61feb1d2afabd42c2e38daf (patch)
tree48b8d4f2d81033fc847934eada3d89c236970780 /works/life
parent38b764b69b3789b4391e9c5a0a6d59c73752c708 (diff)
downloadcrupest-8b5598a275b0b0bad61feb1d2afabd42c2e38daf.tar.gz
crupest-8b5598a275b0b0bad61feb1d2afabd42c2e38daf.tar.bz2
crupest-8b5598a275b0b0bad61feb1d2afabd42c2e38daf.zip
import(life): ...
Diffstat (limited to 'works/life')
-rw-r--r--works/life/computer-organization-experiment/alu.vhdl25
-rw-r--r--works/life/computer-organization-experiment/register.vhdl21
-rw-r--r--works/life/computer-organization-experiment/register_file.vhdl28
3 files changed, 0 insertions, 74 deletions
diff --git a/works/life/computer-organization-experiment/alu.vhdl b/works/life/computer-organization-experiment/alu.vhdl
deleted file mode 100644
index 5eed3df..0000000
--- a/works/life/computer-organization-experiment/alu.vhdl
+++ /dev/null
@@ -1,25 +0,0 @@
-LIBRARY IEEE;
-USE IEEE.STD_LOGIC_1164.ALL;
-use ieee.numeric_std.all;
-
-entity alu is
- port (
- A, B: in std_logic_vector(31 downto 0);
- ALUC: in std_logic_vector(3 downto 0);
- S: out std_logic_vector(31 downto 0);
- Z: out std_logic);
-end entity;
-
-architecture Behavioral of alu is
-begin
- S <= A + B when ALUC(2 downto 0) = B"000"
- else A - B when ALUC(2 downto 0) ?= B"001"
- else A and B when ALUC(2 downto 0) ?= B"100"
- else A or B when ALUC(2 downto 0) ?= B"101"
- else A xor B when ALUC(2 downto 0) ?= B"010"
- else std_logic_vector(signed(A) sll 16) and H"FFFF0000" when ALUC(2 downto 0) ?= B"110"
- else std_logic_vector(signed(A) sll to_integer(unsigned(B))) when ALUC ?= B"0011"
- else std_logic_vector(signed(A) srl to_integer(unsigned(B))) when ALUC ?= B"0111"
- else std_logic_vector(signed(A) sra to_integer(unsigned(B))) when ALUC ?= B"1111";
- Z <= S ?= H"00000000";
-end architecture;
diff --git a/works/life/computer-organization-experiment/register.vhdl b/works/life/computer-organization-experiment/register.vhdl
deleted file mode 100644
index 8d24bd6..0000000
--- a/works/life/computer-organization-experiment/register.vhdl
+++ /dev/null
@@ -1,21 +0,0 @@
-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;
diff --git a/works/life/computer-organization-experiment/register_file.vhdl b/works/life/computer-organization-experiment/register_file.vhdl
deleted file mode 100644
index ab1056f..0000000
--- a/works/life/computer-organization-experiment/register_file.vhdl
+++ /dev/null
@@ -1,28 +0,0 @@
-library ieee;
-
-entity register_file is
- port (
- CLK: in std_logic;
- WRITE: in std_logic;
- R1, R2, W: in std_logic_vector(4 downto 0);
- WD: in std_logic_vector(31 downto 0);
- RD1, RD2: out std_logic_vector(31 downto 0);
- )
-end entity;
-
-architecture Behavioral of register_file is
- type reg_file_type is array (0 to 31) of std_logic_vector(31 downto 0);
- signal reg_file: reg_file_type := (others => '0');
-begin
- process (CLK)
- begin
- if rising_edge(CLK) then
- begin
- if WRITE then
- reg_file(W) <= WD;
- end;
- RD1 <= reg_file(R1);
- RD2 <= reg_file(R2);
- end;
- end;
-end architecture;