Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

parameterized MUX implementation

rrucha

Member level 3
Joined
Jul 17, 2019
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
675
Hello

I want to implement a fully parameterized multiplexer. The minimum inputs that it has is 2. Both of them are 16 bit.
What needs to be configurable is the additional number of inputs that can come to the MUX and also, these are all of different widths. I get that the output width of the MUX will be fixed but these input widths need to be variable and also the number of these inputs need to be variable.
Is there any SystemVerilog implementation to realize this logic?

Thanks in advance.
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,562
Helped
1,768
Reputation
3,542
Reaction score
1,710
Trophy points
113
Location
USA
Activity points
55,755
Hello

I want to implement a fully parameterized multiplexer. The minimum inputs that it has is 2. Both of them are 16 bit. What needs to be configurable is the additional number of inputs that can come to the MUX
This is possible using a packed array for the inputs and a parameter to define the number of input ports. Synthesis will work with such an array (at least Vivado synthesis and the newer version of Synplify do).

and also, these are all of different widths. I get that the output width of the MUX will be fixed but these input widths need to be variable and also the number of these inputs need to be variable.
Is there any SystemVerilog implementation to realize this logic?
Thanks in advance.
The requirement for different widths is not possible in any HDL language. HDLs are not some sort of dynamically typed language. Your requirement would need a language that can have an array that is non-

Like I've told you before you use the maximum width input and all inputs are that wide. You will need another parameter (an array) that defines the actual width of each input, which you can then use to slice the bit vectors.
 

rrucha

Member level 3
Joined
Jul 17, 2019
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
675
I understand. I figured out the way to do that.
Can I use the same way to create a parameterized DEMUX as well?
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,562
Helped
1,768
Reputation
3,542
Reaction score
1,710
Trophy points
113
Location
USA
Activity points
55,755
Same way as a mux, if you implemented it with max width buses and index the packed array output to select where the input is routed.
 
  • Like
Reactions: rrucha

    rrucha

    points: 2
    Helpful Answer Positive Rating
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top