Which method is better ? (about mux)

Discussion in 'VHDL' started by Fano, Jul 30, 2003.

  1. Fano

    Fano Guest

    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:
    ONE:
    Z <= X when Sel = '0' else Y;

    THE OTHER:
    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?

    Thanks
    //Fano
     
    Fano, Jul 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. salman sheikh

    Best way to mux addresses

    salman sheikh, Jan 30, 2004, in forum: VHDL
    Replies:
    0
    Views:
    526
    salman sheikh
    Jan 30, 2004
  2. Oleg
    Replies:
    1
    Views:
    761
    Francisco Rodriguez
    Feb 18, 2004
  3. Oleg
    Replies:
    4
    Views:
    6,820
    Ray Andraka
    Apr 6, 2004
  4. transformer
    Replies:
    1
    Views:
    2,787
    Lorenzo Di Gregorio
    Aug 2, 2004
  5. valentin tihomirov

    Feedback mux created for signal data

    valentin tihomirov, Aug 31, 2004, in forum: VHDL
    Replies:
    2
    Views:
    3,841
    Thomas Stanka
    Sep 1, 2004
Loading...

Share This Page