-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmy74151.vhd
More file actions
39 lines (34 loc) · 869 Bytes
/
Copy pathmy74151.vhd
File metadata and controls
39 lines (34 loc) · 869 Bytes
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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY my74151 IS
PORT (
which : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
A0, A1, A2, A3, A4, A5, A6, A7 : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
Dout : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END my74151;
ARCHITECTURE rtl OF my74151 IS
BEGIN
PROCESS (which, A0, A1, A2, A3, A4, A5, A6, A7)
BEGIN
CASE(which) IS
WHEN "000" =>
Dout <= A0;
WHEN "001" =>
Dout <= A1;
WHEN "010" =>
Dout <= A2;
WHEN "011" =>
Dout <= A3;
WHEN "100" =>
Dout <= A4;
WHEN "101" =>
Dout <= A5;
WHEN "110" =>
Dout <= A6;
WHEN "111" =>
Dout <= A7;
END CASE;
END PROCESS;
END ARCHITECTURE;