+/EE316

digital logic

git clone https://git.julia.blue/+/EE316

Joseph RyanUpload whole semester91885ad

master
1.2 KiB57 linesraw
1`timescale 1ns / 1ps
2//////////////////////////////////////////////////////////////////////////////////
3// Company: 
4// Engineer: 
5// 
6// Create Date: 03/01/2019 03:53:18 PM
7// Design Name: 
8// Module Name: four_bit_decoder
9// Project Name: 
10// Target Devices: 
11// Tool Versions: 
12// Description: 
13// 
14// Dependencies: 
15// 
16// Revision:
17// Revision 0.01 - File Created
18// Additional Comments:
19// 
20//////////////////////////////////////////////////////////////////////////////////
21
22
23module four_bit_decoder(
24    input a,
25    input b,
26    input c,
27    input d,
28    output dec0,
29    output dec1,
30    output dec2,
31    output dec3,
32    output dec4,
33    output dec5,
34    output dec6,
35    output dec7,
36    output dec8,
37    output dec9
38    );
39    wire a_not, b_not, c_not, d_not;
40    
41    not n0(a_not, a);
42    not n1(b_not, b);
43    not n2(c_not, c);
44    not n3(d_not, d);
45    
46and g0(dec0, a_not, b_not, c_not, d_not);
47and g1(dec1, a_not, b_not, c_not, d);
48and g2(dec2, a_not, b_not, c, d_not);
49and g3(dec3, a_not, b_not, c, d);
50and g4(dec4, a_not, b, c_not, d_not);
51and g5(dec5, a_not, b, c_not, d);
52and g6(dec6, a_not, b, c, d_not);
53and g7(dec7, a_not, b, c, d);
54and g8(dec8, a, b_not, c_not, d_not);
55and g9(dec9, a, b_not, c_not, d);
56
57endmodule