+/EE316

digital logic

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

Joseph RyanUpload whole semester91885ad

master
1.2 KiB56 linesraw
1`timescale 1ns / 1ps
2//////////////////////////////////////////////////////////////////////////////////
3// Company: 
4// Engineer: 
5// 
6// Create Date: 02/13/2019 10:05:23 AM
7// Design Name: 
8// Module Name: Decoder_behavioral
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 Decoder_behavioral(
24    input e,
25    input a,
26    input b,
27    input c,
28    output reg d0,
29    output reg d1,
30    output reg d2,
31    output reg d3,
32    output reg d4,
33    output reg d5,
34    output reg d6,
35    output reg d7
36    );
37    always @(e,a,b,c)
38begin
39    d0=1'b0; d1=1'b0; d2=1'b0; d3=1'b0; d4=1'b0; d5=1'b0; d6=1'b0; d7=1'b0;
40    if (e==1'b1)
41        case ({a,b,c})
42        3'b000 : d0 = 1'b1;
43        3'b001 : d1 = 1'b1;
44        3'b010 : d2 = 1'b1;
45        3'b011 : d3 = 1'b1;
46        3'b100 : d4 = 1'b1;
47        3'b101 : d5 = 1'b1;
48        3'b110 : d6 = 1'b1;
49        3'b111 : d7 = 1'b1;
50        default: begin
51            d0=1'b0; d1=1'b0; d2=1'b0; d3=1'b0; d4=1'b0; d5=1'b0; d6=1'b0; d7=1'b0;
52            end
53        endcase
54end
55
56endmodule