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

Subversion Repositories idea

[/] [idea/] [trunk/] [behavioral/] [key_regulator/] [mux8to4x.vbe] - Rev 6

Go to most recent revision | Compare with Previous | Blame | View Log

--Nama file : mux8to4x.vbe
--Deskripsi : mux 8 to 4 16 bit
--Author    : Mas Adit
--Tanggal  : 27 Agustus 2001


entity mux8to4x is
port (
         i1 : in bit_vector(15 downto 0);
        i2 : in bit_vector(15 downto 0);
        i3 : in bit_vector(15 downto 0);
        i4 : in bit_vector(15 downto 0);
        i5 : in bit_vector(15 downto 0);
        i6 : in bit_vector(15 downto 0);
        i7 : in bit_vector(15 downto 0);
        i8 : in bit_vector(15 downto 0);
        en  : in bit;
        clr  : in bit;
        sel  : in bit;
        o1 : out bit_vector(15 downto 0);
        o2 : out bit_vector(15 downto 0);
        o3 : out bit_vector(15 downto 0);
        o4 : out bit_vector(15 downto 0);
        vdd : in bit;
        vss : in bit
);
end mux8to4x;

architecture vbe of mux8to4x is

constant nol : bit_vector(15 downto 0) := "0000000000000000";

signal temp1 : bit_vector(15 downto 0);
signal temp2 : bit_vector(15 downto 0);
signal temp3 : bit_vector(15 downto 0);
signal temp4 : bit_vector(15 downto 0);

signal tempx1 : bit_vector(15 downto 0);
signal tempx2 : bit_vector(15 downto 0);
signal tempx3 : bit_vector(15 downto 0);
signal tempx4 : bit_vector(15 downto 0);

signal reg1 : reg_vector(15 downto 0) register;
signal reg2 : reg_vector(15 downto 0) register;
signal reg3 : reg_vector(15 downto 0) register;
signal reg4 : reg_vector(15 downto 0) register;

begin

--proses o1
with sel select
temp1 <= i1 when '1',
              i5 when '0',
              nol when others;
flip_flop1 : block ((en = '1') and not(en'STABLE))
begin
        reg1 <= guarded temp1;
end block;
tempx1 <= nol when (clr = '1')
               else reg1;
o1 <= tempx1;

--proses o2
with sel select
temp2 <= i2 when '1',
              i6 when '0',
              nol when others;
flip_flop2 : block ((en = '1') and not(en'STABLE))
begin
        reg2 <= guarded temp2;
end block;
tempx2 <= nol when (clr = '1')
               else reg2;
o2 <= tempx2;

--proses o3
with sel select
temp3 <= i3 when '1',
              i7 when '0',
              nol when others;
flip_flop3 : block ((en = '1') and not(en'STABLE))
begin
        reg3 <= guarded temp3;
end block;
tempx3 <= nol when (clr = '1')
               else reg3;
o3 <= tempx3;

--proses o4
with sel select
temp4 <= i4 when '1',
              i8 when '0',
              nol when others;
flip_flop4 : block ((en = '1') and not(en'STABLE))
begin
        reg4 <= guarded temp4;
end block;
tempx4 <= nol when (clr = '1')
               else reg4;
o4 <= tempx4;

--check power supply
assert ((vdd = '1') and (vss = '0'))
report "power supply is missing on mux8to4x"
severity warning;

end vbe;

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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