Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
Hola jaimepsantos, estuve probando el codigo que me sugeriste sobre BCD a BCD3 (el primero de ellos).... en la parte "0000000" ; me sale un error en el ISE xilinx.... y no me compila.... le hace falta algo alli???...graciasHay dos formas de hacerlo. aqui te las pongo ambas:
Código:Library IEEE; use ieee.std_logic_1164.all; Entity BCD_EX3 is port ( BCD: in std_logic_vector (3 downto 0); BCD_3 : out std_logic_vector (3 downto 0) ); end BCD_EX3; Architecture flujo of BCD_EX3 is begin BCD_3<= "0011" when (BCD="0000")else--0 "0100" when (BCD="0001")else--1 "0101" when (BCD="0010")else--2 "0110" when (BCD="0011")else--3 "0111" when (BCD="0100")else--4 "1000" when (BCD="0101")else--5 "1001" when (BCD="0110")else--6 "1010" when (BCD="0111")else--7 "1011" when (BCD="1000")else--8 "1100" when (BCD="1001")else--9 "0000000" ; end flujo;
Código:Library IEEE; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; Entity BCD_EX3 is port ( BCD: in std_logic_vector (3 downto 0); BCD_3 : out std_logic_vector (3 downto 0) ); end BCD_EX3; Architecture flujo of BCD_EX3 is begin BCD_3<= BCD + "11"; end flujo;
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
Entity dado is
port
(
clk_50, env_data: in std_logic;--al cristal de 50MHZ y env data es el boton
salida7s: out std_logic_vector(6 downto 0)
);
end dado;
Architecture special of dado is
signal conteo: std_logic_vector(2 downto 0);
signal conteo_deco: std_logic_vector(6 downto 0);
begin
process(clk_50)
begin
if(clk_50' event and clk_50='1')then
conteo<=conteo+'1';
if(conteo="110")then
conteo<=0;
end if;
end if;
end process;
conteo_deco <=
"1111110" when (conteo="000")else--0
"0110000" when (conteo="001")else--1
"1101101" when (conteo="010")else--2
"1111001" when (conteo="011")else--3
"0110011" when (conteo="100")else--4
"1011011" when (conteo="101")else--5
"1011111" when (conteo="110")else--6
"0000000" ;
salida7s = conteo_deco when (env_data='1')else
"ZZZZZZZ";
end special;
Library IEEE;
use ieee.std_logic_1164.all;
Entity BCD_EX3 is
port
(
BCD: in std_logic_vector (3 downto 0);
BCD_3 : out std_logic_vector (3 downto 0)
);
end BCD_EX3;
Architecture flujo of BCD_EX3 is
begin
BCD_3<= "0011" when (BCD="0000")else--0
"0100" when (BCD="0001")else--1
"0101" when (BCD="0010")else--2
"0110" when (BCD="0011")else--3
"0111" when (BCD="0100")else--4
"1000" when (BCD="0101")else--5
"1001" when (BCD="0110")else--6
"1010" when (BCD="0111")else--7
"1011" when (BCD="1000")else--8
"1100" when (BCD="1001")else--9
"0000000" ;
end flujo;
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
Entity dado is
port
(
clk_50, env_data: in std_logic;--al cristal de 50MHZ y env data es el boton
salida7s: out std_logic_vector(6 downto 0)
);
end dado;
Architecture special of dado is
signal conteo: std_logic_vector(2 downto 0);
signal conteo_deco: std_logic_vector(6 downto 0);
begin
process(clk_50)
begin
if(clk_50' event and clk_50='1')then
[COLOR="Red"]if (env_data='0') then
conteo<=conteo+'1';
elsif (env_data='1') then
conteo<=conteo;
end if;[/COLOR]
if(conteo="110")then
conteo<="001";
end if;
end if;
end process;
conteo_deco <=
"0110000" when (conteo="001")else--1
"1101101" when (conteo="010")else--2
"1111001" when (conteo="011")else--3
"0110011" when (conteo="100")else--4
"1011011" when (conteo="101")else--5
"1011111" when (conteo="110")else--6
"0000000" ;
salida7s <= conteo_deco when (env_data='1') else
"ZZZZZZZ";
end special;
Hola tengo que hacer en la spartan 3E un circuito de detección de flanco descendente podeis ayudarme?? no se ni por donde empeza.
gracias y un saludo
Library ieee;
use ieee.std_logic_1164.all;
entity FFD_8 is
port(
oe,clk : in std_logic;
data_in : in std_logic_vector (7 downto 0);
data_out: out std_logic_vector (7 downto 0)
);
end FFD_8;
Architecture func of FFD_8 is
begin
process(clk,oe)
begin
if (oe ='0') then
data_out <= "ZZZZZZZZ";
elsif(clk' event and clk='0') then--deteccion del flanco con cero es bajada
data_out <= data_in;--con un 1 es subida
end if;
end process;
end func;