Skip to main content

Multiplexor ( codigo ) vhdl

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Multiplexor is
    Port ( a : in  STD_LOGIC;
           b : in  STD_LOGIC;
           c : in  STD_LOGIC;
           d : in  STD_LOGIC;
           sel : in  STD_LOGIC_VECTOR (1 downto 0);
           x : inout  STD_LOGIC);
end Multiplexor;

architecture Behavioral of Multiplexor is
signal g:std_logic;
begin

process (a,b,c,d,sel)
begin

if sel = "00" then
x<=a;

elsif sel = "01" then
x<=b;

elsif sel = "10" then
x<=c;
else
x<=d;

end if;
end process;
end Behavioral;

Comments

Popular posts from this blog

Multimetro ( codigo ) vhdl

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity Multimetro is port( clk: in std_logic; tst: inout std_logic_vector (3 downto 0); display: out std_logic_vector (7 downto 0):="00000000"; leds, anodos: out std_logic_vector (3 downto 0):="0000"); end Multimetro; architecture Behavioral of Multimetro is signal barrido: std_logic_vector (1 downto 0):="00"; signal anodo: std_logic_vector (3 downto 0):="0000"; signal contador: std_logic_vector (3 downto 0):="0000"; signal disp,disp1,disp2,disp3: std_logic_vector (7 downto 0):="00000010"; signal x,y,z,w: std_logic_vector (3 downto 0):="0000"; begin process(clk) begin if(clk'event and clk='1') then barrido<=barrido+'1'; if contador contador<=contador+'1'; elsif contador>tst then contador<="0000...

boleta, cliente, nombre en Java

import java.util.ArrayList; public class Cliente { private String nombre; private ArrayList boletas; public Cliente(String nombre) { this.nombre = nombre; this.boletas = new ArrayList(); } public String getNombre() { return this.nombre; } public void agregarBoleta(Boleta boleta) { boletas.add(boleta); } public void imprimirHistorial() { Boleta b; System.out.println("Nombre: " + nombre); for (int i=0; i b = (Boleta)boletas.get(i); b.imprimir(); } } } public class Articulo { private String descripcion; private int stock; private int precio; public Articulo(String descripcion,int stock,int precio){ this.descripcion = descripcion; this.stock = stock; this.precio = precio; } public String getDescripcion() { return this.descripcion; } public int getStock() { return this.stock; } public int getPrecio() { return this.precio; } } import java.util.ArrayList; public class Boleta { private String fecha; private int total; private ArrayList ar...

Voltimetro en VHDL

library IEEE; use IEEE.std_logic_1164.all; library work; use work.Estructuras_de_Datos.all; entity Voltimetro is         port (  clock: in std_logic;                         d : in std_logic;                         not_q: out std_logic;                                                  hs,vs: out std_logic;                         r,g,b: out std_logic                                                                      );           ...