-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththree_to_eight_decoder.vhd
executable file
·55 lines (44 loc) · 1.39 KB
/
three_to_eight_decoder.vhd
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
51
52
53
54
55
----------------------------------------------------------------------------------
-- 3 to 8 decoder 16 bits
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity three_to_eight_decoder is
port(
a0: in std_logic;
a1: in std_logic;
a2: in std_logic;
a3: in std_logic;
q0: out std_logic;
q1: out std_logic;
q2: out std_logic;
q3: out std_logic;
q4: out std_logic;
q5: out std_logic;
q6: out std_logic;
q7: out std_logic;
q8: out std_logic
);
end three_to_eight_decoder;
architecture behvOfDecoder of three_to_eight_decoder is
begin
--q0<= not a0 and not a1 and not a2;
--q1<= not a0 and not a1 and a2;
--q2<= not a0 and a1 and not a2;
--q3<= not a0 and a1 and a2;
--q4<= a0 and not a1 and not a2;
--q5<= a0 and not a1 and a2;
--q6<= a0 and a1 and not a2;
--q7<= a0 and a1 and a2;
q0<= not a0 and not a1 and not a2 and not a3;
q1<= not a0 and not a1 and not a2 and a3;
q2<= not a0 and not a1 and a2 and not a3;
q3<= not a0 and not a1 and a2 and a3;
q4<= not a0 and a1 and not a2 and not a3;
q5<= not a0 and a1 and not a2 and a3;
q6<= not a0 and a1 and a2 and not a3;
q7<= not a0 and a1 and a2 and a3;
q8<= a0 and not a1 and not a2 and not a3;
end behvOfDecoder;