Skip to main content

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";
x<="0000";
y<="0000";
z<="0000";
w<="0000";
else
leds<=not(contador);
end if;

if x="1001" then
y<=y+'1';
x<="0000";
end if;

if y="1010" then
z<=z+'1';
y<="0000";
end if;

if z="1010" then
w<=w+'1';
z<="0000";
end if;

if w="1010" then
w<="0000";
end if;

case x is
when "0000" => disp <= "00000010";
when "0001" => disp <= "10011110";
when "0010" => disp <= "00100100";
when "0011" => disp <= "00001100";
when "0100" => disp <= "10011000";
when "0101" => disp <= "01001000";
when "0110" => disp <= "01000000";
when "0111" => disp <= "00011110";
when "1000" => disp <= "00000000";
when "1001" => disp <= "00011000";
when others => disp <= "00000000";
end case;

case y is
when "0000" => disp1 <= "00000010";
when "0001" => disp1 <= "10011110";
when "0010" => disp1 <= "00100100";
when "0011" => disp1 <= "00001100";
when "0100" => disp1 <= "10011000";
when "0101" => disp1 <= "01001000";
when "0110" => disp1 <= "01000000";
when "0111" => disp1 <= "00011110";
when "1000" => disp1 <= "00000000";
when "1001" => disp1 <= "00011000";
when others => disp1 <= "00000010";
end case;

case z is
when "0000" => disp2 <= "00000010";
when "0001" => disp2 <= "10011110";
when "0010" => disp2 <= "00100100";
when "0011" => disp2 <= "00001100";
when "0100" => disp2 <= "10011000";
when "0101" => disp2 <= "01001000";
when "0110" => disp2 <= "01000000";
when "0111" => disp2 <= "00011110";
when "1000" => disp2 <= "00000000";
when "1001" => disp2 <= "00011000";
when others => disp2 <= "00000010";
end case;

case w is
when "0000" => disp3 <= "00000010";
when "0001" => disp3 <= "10011110";
when "0010" => disp3 <= "00100100";
when "0011" => disp3 <= "00001100";
when "0100" => disp3 <= "10011000";
when "0101" => disp3 <= "01001000";
when "0110" => disp3 <= "01000000";
when "0111" => disp3 <= "00011110";
when "1000" => disp3 <= "00000000";
when "1001" => disp3 <= "00011000";
when others => disp3 <= "00000010";
end case;

case barrido is
when "00" => display<=disp;
anodos<="1110";
when "01" => display<=disp1;
anodos<="1101";
when "10" => display<=disp2;
anodos<="1011";
when others => display<=disp3;
anodos<="0111";
end case;
end if;
end process;


end Behavioral;

Comments

Popular posts from this blog

Te quiero… pero como amigo

Hasta ahora pensaba que la peor frase que te puede decir una chica es: -’Tenemos que hablar…’. Pero no, nada que ver, la peor frase que te pueden decir es: -’Yo tambien te quiero… pero solo como amigo’. Eso significa que para ella sos el tipo mas simpático del mundo, el que mejor la escucha, el que mas sabe de su vida y sus mas íntimos secretos, el ser humano más extraordinario de la tierra… pero que no va a salir con vos NUNCA. Va a salir con un impresentable, un hijo de puta, un pelotudo que solo quiere culear con ella y cagarla permanentemente. Eso si, cuando el otro se mande una cagada, ella te va a llamar para pedirte consejo. Es como si vas a buscar trabajo y te dicen: -”Señor, es usted la persona idónea para el puesto, el que mejor currículum tiene, el mas preparado… pero no lo vamos a contratar. Vamos a tomar a un incompetente que no sepa hacer nada y se mande una cagada a cada rato. Eso si, cuando se mande una cagada ¿lo podríamos llamar a usted para que nos saque del quilombo...

10 commands you should master when working with the Cisco IOS

The Cisco IOS provides thousands of commands, and configuring it can be challenging. Here are 10 commands you need to know, inside and out, when using the Cisco IOS. #1: The “?” It may seem entirely too obvious that you should know how to type  ?  to ask for help when using the Cisco IOS. However, the Cisco IOS is completely different from other operating systems when it comes to using the question mark (help key). As the IOS is a command-line operating system with thousands of possible commands and parameters, using the ? can save your day. You can use the command in many ways. First, use it when you don’t know what command to type. For example, type  ?  at the command line for a list of all possible commands. You can also use ? when you don’t know what a command’s next parameter should be. For example, you might type show ip ?  If the router requires no other parameters for the command, the router will offer CR as the only option. Finally, use ? to se...

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...