Help with Mux Truth Table & Wave Form

Discussion in 'Homework Help' started by gammaman, Feb 19, 2009.

  1. gammaman

    Thread Starter Member

    Feb 14, 2009
    29
    0
    I have to following code for a Mux and it complies. When I go to the wave form it simulates perfectly. Thing is, I do not know what I am looking for, to see if it is correct.

    Here is the code

    Code ( (Unknown Language)):
    1.  
    2. [FONT=Arial]Library ieee;
    3. Use ieee.std_logic_1164.all;
    4.  
    5. Library ieee;
    6. Use ieee.std_logic_1164.all;
    7.  
    8. Entity Mux is
    9. Port(
    10. D : in std_logic_vector(3 downto 0);
    11. S : in std_logic_vector(1 downto 0);
    12. Y : out std_logic);
    13. End Mux;
    14.  
    15. Architecture Joe_Structure of Mux is
    16. Begin
    17. with S select
    18. Y<= D(0) when "00",
    19. D(1) when "01",
    20. D(2) when "10",
    21. D(3) when "11";
    22. End Joe_Structure;[/FONT]
    23. [FONT=Arial][/FONT]

     
  2. mentaaal

    Senior Member

    Oct 17, 2005
    451
    0
    Do you understand how a MUX works? If you do then you should be able to see from the timing waveforms if the operation is working properly or not.
     
  3. veritas

    Active Member

    Feb 7, 2008
    167
    0
    You're look for:
    Code ( (Unknown Language)):
    1.  
    2. Y = D(0) when S = "00",
    3.     D(1) when S = "01",
    4.     D(2) when S = "10",
    5.     D(3) when S = "11";
     
  4. tuborggg

    Active Member

    Jan 3, 2009
    37
    0
    what you're missing is a TEST-BENCH -
    Another code which has your MUX as a component, and generates clock and reset (you can skip it because it's an Asynchronous module, your mux), and changes the inputs to your mux, and checks its outputs....(that's why you DO need clock and reset, for the changing it time)
    Have fun.
     
Loading...