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

Subversion Repositories v6502

[/] [v6502/] [trunk/] [dmux.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 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 dmux is
8
  port(  sel:  in STD_LOGIC_VECTOR(1 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
           y: out STD_LOGIC_VECTOR(7 downto 0)
13
      );
14
end dmux;
15
 
16
architecture comb of dmux is
17
constant NOP_D: STD_LOGIC_VECTOR(1 downto 0) := "00";
18
constant ORD_D: STD_LOGIC_VECTOR(1 downto 0) := "01";
19
constant EXT_D: STD_LOGIC_VECTOR(1 downto 0) := "10";
20
constant BCD_D: STD_LOGIC_VECTOR(1 downto 0) := "11";
21
begin
22
  process(sel,a,b,c)
23
  begin
24
    case sel is
25
      when ORD_D    => y <= a;
26
      when EXT_D    => y <= b;
27
      when BCD_D    => y <= c;
28
      when others   => y <= "00000000";
29
    end case;
30
  end process;
31
end comb;
32
 
33
 

powered by: WebSVN 2.1.0

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