Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Which method is better ? (about mux)

Thread Tools

Which method is better ? (about mux)

Posts: n/a
HI, all
I've encounter to write a multiplexer many times , for example, a
four-bit mux:

library ieee;
use ieee.std_logic_1164.all;

entity mux4 is
port (X,Y : in std_ulogic_vector(3 downto 0);
Sel : in std_ulogic;
Z : out std_ulogic_vector(3 downto 0));
end entity;

and I found out there would be two method to implement it:
Z <= X when Sel = '0' else Y;

Z <= X when Sel = '0' else
Y when Sel = '1' else
(others => '-');

I know that if the signal's type is 'bit'/'bit_vector" , there would
not be much to discuss, but now the
signal is a multiple value logic....
Are those two method equivalent ? which one is better? I mean which
one would require less
resource or/and operate fast when it 's synthesized? Is there any
method other than those
two more better?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which coding style is better? public API or private method insideclass definition Inyeol Python 7 01-13-2011 01:15 AM
Which is better -- method option or multiple methods? Trans Ruby 18 03-12-2008 01:43 AM
Which programming method is better? Amandil C Programming 10 03-10-2008 01:38 AM
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM
Windows App deployment - which method is better? ASP .Net 0 02-09-2005 09:49 PM