Sign in

username:

password:



Not a member?

Search Comp.Arch.FPGA



Search tips

fpga by Keywords

Altera | ASIC | CPLD | Cyclone | DCM | DDR | DSP | Ethernet | ISE | JTAG | Linux | LVDS | Microblaze | ML310 | Modelsim | NIOS | OPB | PCI | Quartus | RocketIO | SDRAM | Spartan | Spartan3 | SRAM | Stratix | Verilog | VHDL | Virtex | Virtex-4 | Virtex-II | Xilinx | XST

Ads

See Also

DSPEmbedded SystemsElectronics

Comp.Arch.FPGA | verilog multiplexer


There are 6 messages in this thread.

You are currently looking at messages 0 to 6.

verilog multiplexer - maxascent - 2010-01-01 04:51:00

I would like to create a generic multiplexer in Verilog were I can set the
number of inputs and data bits. I can create something using 2 input
multiplexers cascaded but this produces a priority structure which uses
more logic resources. If anyone can give me a clue as to if it is possible
that would be great.

Jon	   
					
---------------------------------------		
This message was sent using the comp.arch.fpga web interface on
http://www.FPGARelated.com



Re: verilog multiplexer - glen herrmannsfeldt - 2010-01-01 06:36:00

maxascent <m...@yahoo.co.uk> wrote:

> I would like to create a generic multiplexer in Verilog were I can set the
> number of inputs and data bits. I can create something using 2 input
> multiplexers cascaded but this produces a priority structure which uses
> more logic resources. If anyone can give me a clue as to if it is possible
> that would be great.

The synthesis tools that I know of will easily optimize out any
difference that you might be thinging about, at least for FPGA
targets.  (You did post to comp.arch.fpga.)

That is especially true for LUT4 architecture FPGAs.  I believe
the usual generated form is more like an N to 2**N decoder,
followed by AND/OR logic.  That is especially true if it is
more than one bit wide, which requires only one decoder.

-- glen

Re: verilog multiplexer - maxascent - 2010-01-01 07:16:00

I did a quick experiment using Synplify were I created 2 multiplexers of 4
inputs with 64-bit data, one using my cascaded 2 input mux and another
using a case statement. The one with the case statement used less resorces.
So either I have coded the first incorrectly or Synplify is interpreting
the code differently.

Jon	   
					
---------------------------------------		
This message was sent using the comp.arch.fpga web interface on
http://www.FPGARelated.com
______________________________
Newest Blog by Chris Felton: "The Spartans". Click here to read.

Re: verilog multiplexer - Benjamin Krill - 2010-01-01 08:05:00

On Fri, 2010-01-01 at 06:16 -0600, maxascent wrote:=20
> I did a quick experiment using Synplify were I created 2 multiplexers of =
4
> inputs with 64-bit data, one using my cascaded 2 input mux and another
> using a case statement. The one with the case statement used less resorce=
s.
> So either I have coded the first incorrectly or Synplify is interpreting
> the code differently.

I did the experience that is depends on the FPGA type (Lut type, ...)
and vendor (maybe tools). So, I think it is a good practice to test
it for the different factors.

cheers
ben

______________________________
Newest Blog by Chris Felton: "The Spartans". Click here to read.

Re: verilog multiplexer - John_H - 2010-01-01 17:57:00

On Jan 1, 4:51=A0am, "maxascent" <maxasc...@yahoo.co.uk> wrote:
> I would like to create a generic multiplexer in Verilog were I can set th=
e
> number of inputs and data bits. I can create something using 2 input
> multiplexers cascaded but this produces a priority structure which uses
> more logic resources. If anyone can give me a clue as to if it is possibl=
e
> that would be great.
>
> Jon =A0 =A0 =A0 =A0
>
> --------------------------------------- =A0 =A0 =A0 =A0
> This message was sent using the comp.arch.fpga web interface onhttp://www=
.FPGARelated.com

One of the simplest and most consistent multiplexers I've used is with
arrays of registers or wires.

wire [p:0] my_sel;
wire [n:0] my_array [m:0];  // assign m+1 my_array values to the
desired inputs
reg [n:0] my_output;
//
always @(posedge clk)  my_output <=3D my_array[my_sel];
______________________________
Newest Blog by Chris Felton: "The Spartans". Click here to read.

Re: verilog multiplexer - maxascent - 2010-01-02 05:27:00

>One of the simplest and most consistent multiplexers I've used is with
>arrays of registers or wires.
>
>wire [p:0] my_sel;
>wire [n:0] my_array [m:0];  // assign m+1 my_array values to the
>desired inputs
>reg [n:0] my_output;
>//
>always @(posedge clk)  my_output <=3D my_array[my_sel];
>
Thanks John that works great.

Jon	   
					
---------------------------------------		
This message was sent using the comp.arch.fpga web interface on
http://www.FPGARelated.com
______________________________
Newest Blog by Chris Felton: "The Spartans". Click here to read.