+/EE316
digital logic
git clone https://git.julia.blue/+/EE316
91885ad
master
1`timescale1 ns/ 1 ps 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 ( 24input e , 25input a , 26input b , 27input c , 28output reg d0 , 29output reg d1 , 30output reg d2 , 31output reg d3 , 32output reg d4 , 33output reg d5 , 34output reg d6 , 35output reg d7 36); 37always @( e , a , b , c ) 38begin 39d0 = 1'b0 ; d1 = 1'b0 ; d2 = 1'b0 ; d3 = 1'b0 ; d4 = 1'b0 ; d5 = 1'b0 ; d6 = 1'b0 ; d7 = 1'b0 ; 40if ( e == 1'b1 ) 41case ({ a , b , c }) 423'b000 : d0 = 1'b1 ; 433'b001 : d1 = 1'b1 ; 443'b010 : d2 = 1'b1 ; 453'b011 : d3 = 1'b1 ; 463'b100 : d4 = 1'b1 ; 473'b101 : d5 = 1'b1 ; 483'b110 : d6 = 1'b1 ; 493'b111 : d7 = 1'b1 ; 50default : begin 51d0 = 1'b0 ; d1 = 1'b0 ; d2 = 1'b0 ; d3 = 1'b0 ; d4 = 1'b0 ; d5 = 1'b0 ; d6 = 1'b0 ; d7 = 1'b0 ; 52end 53endcase 54end 55 56endmodule