Escolar Documentos
Profissional Documentos
Cultura Documentos
VHDL
PROGRAMACIÓN DE IDENTIDADES INDIVIDUALES
El siguiente circuito lógico está formado por subsistemas: teclado, codificador, registro,
decodificador de 7 segmentos activo en bajo y display de siete segmentos.
La finalidad es observar en el display el numero decimal equivalente al de la tecla presionada.
library ieee;
process (clk,A,D) begin
use ieee.std_logic_1164.all:
entity display is port ( if (clk’event and clk =‘1’) then
clk, x: in std_logic; Q<=A;
tecla: in std_logic_vector (0 to 8); D <= Q;
C: inout std_logic_vector (3 downto 0); end if;
A: inout std_logic_vector(3 downto 0); case D is
Q: inout std_logic_vector(3 downto 0); when “0000” => seg <= “0000001”;
D: inout std_logic_vector(3 downto 0); when “0001” => seg <= “1001111”;
seg: out std_logic_vector(0 to 6)); when “0010” => seg <= “0010010”;
end display;
when “0011” => seg <= “0000110”;
architecture arq_disp of display is
begin when “0100” => seg <= “1001100”;
C <= “0001” when tecla = “100000000” else when “0101” => seg <= “0100100”;
“0010” when tecla = “010000000” else when “0110” => seg <= “0100000”;
“0011” when tecla = “001000000” else when “0111” => seg <= “0001110”;
“0100” when tecla = “000100000” else when “1000” => seg <= “0000000”;
“0101” when tecla = “000010000” else when others => seg <= “0001100”;
“0110” when tecla = “000001000” else end case;
“0111” when tecla = “000000100” else end process;
“1000” when tecla = “000000010” else
End arq_disp.;
“1001”;
A <= C;
PROGRAMACIÓN DE ENTIDADES INDIVIDUALES
MEDIANTE ASIGNACIÓN DE SEÑALES
Este tipo de programación es posible solo cuando los bloques individuales se
relaciones mediante señales internas.
El circuito solo recibe como entradas las líneas provenientes del teclado y como
salidas las 7 terminales del decodificador.
library ieee;
use ieee.std_logic_1164.all; elsif (tecla = “000001000”) then
entity display is port ( C<=“0110”;
clk, x: in std_logic; elsif (tecla = “000000100”) then
tecla: in std_logic_vector (0 to 8); C<=“0111”;
seg: out std_logic_vector(0 to 6)); elsif (tecla = “000000010”) then
end display; C<=“1000”
architecture arq_disp of display is else
signal C: std_logic_vector (3 downto 0); C<= “1001”;
signal Q: std_logic_vector(3 downto 0); end if;
begin
process (clk,tecla,C,Q) begin
case Q is
if (clk’event and clk =‘1’) then when “0000” => seg <= “0000001”;
Q<=C; when “0001” => seg <= “1001111”;
end if; when “0010” => seg <= “0010010”;
if (tecla = “100000000”) then when “0011” => seg <= “0000110”;
C <= “0001”; when “0100” => seg <= “1001100”;
elsif (tecla = “010000000”) then when “0101” => seg <= “0100100”;
C <= “0010”; when “0110” => seg <= “0100000”;
elsif (tecla = “001000000”) then when “0111” => seg <= “0001110”;
C <= “0011”; when “1000” => seg <= “0000000”;
elsif (tecla = “000100000”) then when others => seg <= “0001100”;
C<=“0100”; end case;
elsif (tecla = “000010000”) then end process;
C<=“0101” ; end arq_disp.;
EJEMPLO
Realice la programación en
VHDL para integrar los
diferentes bloques lógicos
mostrados en el circuito.
DESCRIPCIÓN DEL PROBLEMA
El circuito se utiliza para automatizar el proceso de empaquetado de muñecas de porcelana.
Considere que las muñecas se pueden empaquetar en forma individual o con un máximo de
nueve unidades por paquete.