Presentation is loading. Please wait.

Presentation is loading. Please wait.

Generic Multiplexers: Parameters Discussion D7.5 Example 8.

Similar presentations


Presentation on theme: "Generic Multiplexers: Parameters Discussion D7.5 Example 8."— Presentation transcript:

1 Generic Multiplexers: Parameters Discussion D7.5 Example 8

2 A Generic 2-to-1 MUX // Example 8a: Generic 2-to-1 MUX using a parameter module mux2g #(parameter N = 4) (input wire [N-1:0] a, input wire [N-1:0] b, input wire s, output reg [N-1:0] y ); always @(*) if(s == 0) y = a; else y = b; endmodule

3 // Example 8b: 8-line 2-to-1 MUX using a parameter module mux28( input wire [7:0] a, input wire [7:0] b, input wire s, output wire [7:0] y ); defparam M8.N = 8; mux2g M8 (.a(a),.b(b),.s(s),.y(y) ); endmodule N = 8

4 Aldec Active-HDL Simulation


Download ppt "Generic Multiplexers: Parameters Discussion D7.5 Example 8."

Similar presentations


Ads by Google