OpenCores
URL https://opencores.org/ocsvn/v65c816/v65c816/trunk

Subversion Repositories v65c816

[/] [v65c816/] [trunk/] [data_mux.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 Valerio63
library IEEE;
2
use IEEE.std_logic_1164.all;  -- defines std_logic types
3
use IEEE.STD_LOGIC_unsigned.all;
4
use IEEE.STD_LOGIC_arith.all;
5
 
6
-- 8 bit three-way multiplexer
7
entity data_mux is
8
  port(    s:  in STD_LOGIC_VECTOR(3 downto 0);
9
           a:  in STD_LOGIC_VECTOR(7 downto 0);
10
           b:  in STD_LOGIC_VECTOR(7 downto 0);
11
           c:  in STD_LOGIC_VECTOR(7 downto 0);
12
           d:  in STD_LOGIC_VECTOR(7 downto 0);
13
           y: out STD_LOGIC_VECTOR(7 downto 0)
14
      );
15
end data_mux;
16
 
17
architecture comb of data_mux is
18
 
19
begin
20
  process(s,a,b,c,d)
21
  begin
22
    case s is
23
      when "1110"  => y <= a;
24
      when "1101"  => y <= b;
25
      when "1011"  => y <= c;
26
      when "0111"  => y <= d;
27
      when others  => y <= a;
28
    end case;
29
  end process;
30
end comb;
31
 
32
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.