forked from 19ob1/ELEC374Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCONFF.vhd
More file actions
50 lines (43 loc) · 1.53 KB
/
CONFF.vhd
File metadata and controls
50 lines (43 loc) · 1.53 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
46
47
48
49
50
library ieee;
use ieee.std_logic_1164.all;
entity CONFF is
port(
IRinput : in std_logic_vector(31 downto 0);
BusMuxOut : in std_logic_vector(31 downto 0);
CONFFinput : in std_logic;
CONFFoutput : out std_logic
);
end entity CONFF;
architecture behaviour of conFF is
signal decodeOut : std_logic_vector(3 downto 0);
signal C2 : std_logic_vector(1 downto 0);
signal busOR : std_logic;
signal conDIN : std_logic;
begin
process(C2, IRinput, BusMuxOut, decodeOut, busOR, CONFFinput, conDIN)
begin
C2 <= IRinput(20 downto 19);
busOR <= (BusMuxOut(31) or BusMuxOut(30) or BusMuxOut(29) or BusMuxOut(28) or BusMuxOut(27)
or BusMuxOut(26) or BusMuxOut(25) or BusMuxOut(24) or BusMuxOut(23) or BusMuxOut(22) or BusMuxOut(21)
or BusMuxOut(20) or BusMuxOut(19) or BusMuxOut(18) or BusMuxOut(17) or BusMuxOut(16) or BusMuxOut(15)
or BusMuxOut(14) or BusMuxOut(13) or BusMuxOut(12) or BusMuxOut(11) or BusMuxOut(10) or BusMuxOut(9)
or BusMuxOut(8) or BusMuxOut(7) or BusMuxOut(6) or BusMuxOut(5) or BusMuxOut(4) or BusMuxOut(3)
or BusMuxOut(2) or BusMuxOut(1) or BusMuxOut(0));
case(C2) is
when "00" =>
decodeOut <= "0001";
when "01" =>
decodeOut <= "0010";
when "10" =>
decodeOut <= "0100";
when "11" =>
decodeOut <= "1000";
when others =>
decodeOut <= "0000";
end case;
conDIN <= ((not busOR and decodeOut(0)) or (busOR and decodeOut(1)) or (not BusMuxOut(31) and decodeOut(2)) or (BusMuxOut(31) and decodeOut(3)));
if(CONFFinput ='1') then
CONFFoutput <= conDIN;
end if;
end process;
end architecture behaviour;