Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Práctica1 VLSI
Práctica1 VLSI
Facultad de Ingeniería
Grupo: 3
1
Contenido
Parte básica. ........................................................................................................................................................................ 3
Código: ........................................................................................................................................................................... 3
Parte complementaria. ........................................................................................................................................................ 7
Primera actividad complementaria: ................................................................................................................................ 7
Código: ........................................................................................................................................................................... 7
Segunda actividad complementaria: ............................................................................................................................. 11
Conclusión. ....................................................................................................................................................................... 11
2
Parte básica.
El código que se nos presenta en la práctica funciona de manera correcta en las tarjetas con
los displays de 7 segmentos conectados de forma multiplexada, se nos dio la tarea de realizar
las modificaciones al mismo ya que en mi caso tengo la tarjeta DE10 lite y esta tarjeta
presenta los displays con conexión directa. Lo que se hizo fue quitar la parte del multiplexor
y agregar la sentencia “with” con la que se le pasaba la información directamente a los
displays. Todo el código se corre de manera paralela y secuencial utilizando “process”, esto
hace que trabajen en conjunto y las condicionales funcionen correctamente.
Código:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity Practica1 is
Port( reloj : in std_logic;
disp1 : out std_logic_vector(6 downto 0);
disp2 : out std_logic_vector(6 downto 0);
disp3 : out std_logic_vector(6 downto 0);
disp4 : out std_logic_vector(6 downto 0);
seAlarm : in std_logic);
end Practica1;
begin
divisor : process(reloj)
3
variable CUENTA: STD_logic_vector(27 downto 0) := X"0000000";
begin
if rising_edge (reloj) then
if CUENTA =X"48009E0" then
CUENTA := X"0000000";
else
CUENTA := CUENTA+1;
end if;
end if;
segundo <= CUENTA(22);
end process;
4
HoraU: Process(E,reset)
variable cuenta : std_logic_vector(3 downto 0):="0000";
begin
if rising_edge(E) then
if cuenta="1001" then
cuenta:= "0000";
Z<='1';
else
cuenta := cuenta+1;
Z<='0';
end if;
end if;
if reset='1' then
cuenta:="0000";
end if;
Quh <= cuenta;
U<=cuenta(2);
end Process;
HORAD: Process(Z,reset)
variable cuenta: std_logic_vector(3 downto 0):="0000";
begin
if rising_edge(Z) then
if cuenta="0010" then
cuenta:= "0000";
else
cuenta := cuenta + 1;
end if;
end if;
if reset = '1' then
cuenta:="0000";
end if;
Qdh <= cuenta;
D <= cuenta(1);
end Process;
inicia: process(U,D)
begin
reset <= (U and D);
end process;
5
with Qum SELECT
disp1 <= "1000000" when "0000",
"1111001" when "0001",
"0100100" when "0010",
"0110000" when "0011",
"0011001" when "0100",
"0010010" when "0101",
"0000010" when "0110",
"1111000" when "0111",
"0000000" when "1000",
"0010000" when "1001",
"1111111" when others;
with Qdm SELECT
disp2 <= "1000000" when "0000",
"1111001" when "0001",
"0100100" when "0010",
"0110000" when "0011",
"0011001" when "0100",
"0010010" when "0101",
"0000010" when "0110",
"1111000" when "0111",
"0000000" when "1000",
"0010000" when "1001",
"1111111" when others;
with Quh SELECT
disp3 <= "1000000" when "0000",
"1111001" when "0001",
"0100100" when "0010",
"0110000" when "0011",
"0011001" when "0100",
"0010010" when "0101",
"0000010" when "0110",
"1111000" when "0111",
"0000000" when "1000",
"0010000" when "1001",
"1111111" when others;
with Qdh SELECT
disp4 <= "1000000" when "0000",
"1111001" when "0001",
"0100100" when "0010",
"0110000" when "0011",
"0011001" when "0100",
"0010010" when "0101",
6
"0000010" when "0110",
"1111000" when "0111",
"0000000" when "1000",
"0010000" when "1001",
"1111111" when others;
end Behavioral;
Lo que vemos en la tarjeta es la simulación de un reloj lógico en donde se muestran las horas
y los minutos en un formato de 24 hrs. Una vez alcanzada esa cifra se reinicia desde cero.
Parte complementaria.
Código:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity MuxDec4disp is
Port (
clk : in std_logic;
D0: in std_logic_vector(3 downto 0);
D1: in std_logic_vector(3 downto 0);
D2: in std_logic_vector(3 downto 0);
D3: in std_logic_vector(3 downto 0);
A: out std_logic_vector(3 downto 0);
HEX0, HEX1, HEX2, HEX3: out std_logic_vector(6 downto 0));
end MuxDec4disp;
begin
divisor: process (clk)
variable CUENTA: std_logic_vector(27 downto 0) := X"0000000";
begin
if rising_edge (clk) then
if CUENTA = X"48009E0" then
CUENTA := X"0000000";
else
CUENTA := CUENTA + 1;
end if;
end if;
begin
if rising_edge (rapido) then
CUENTA := CUENTA + 1;
end if;
Qr <= CUENTA;
end process;
begin
if Qr = "00" then
Qs <= D0;
elsif Qr = "01" then
Qs <= D1;
elsif Qr = "10" then
Qs <= D2;
elsif Qr = "11" then
Qs <= D3;
end if;
end process;
8
decoBCDa7seg: process (Qs)
begin
case Qs is
when "0000" => segmentos <= "1000000"; --0
when "0001" => segmentos <= "1111001"; --1
when "0010" => segmentos <= "0100100"; --2
when "0011" => segmentos <= "0110000"; --3
when "0100" => segmentos <= "0011001"; --4
when "0101" => segmentos <= "0010010"; --5
when "0110" => segmentos <= "0000010"; --6
when "0111" => segmentos <= "1111000"; --7
when "1000" => segmentos <= "0000000"; --8
when "1001" => segmentos <= "0010000"; --9
when others => segmentos <= "1111111";
end case;
end process;
begin
case Qr is
when "00" =>
A <= "0001";
HEX0 <= segmentos;
when "01" =>
A <= "0010";
HEX1 <= segmentos;
when "10" =>
A <= "0100";
HEX2 <= segmentos;
when "11" =>
A <= "1000";
HEX3 <= segmentos;
end case;
end process;
end bhv;
9
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity UsandoMuxDec4disp is
Port ( clk : in std_logic;
A: inout std_logic_vector(3 downto 0);
HEX0, HEX1, HEX2, HEX3: out std_logic_vector(6 downto 0)
);
end UsandoMuxDec4disp;
component MuxDec4Disp is
Port(
clk : in std_logic;
D0: in std_logic_vector(3 downto 0);
D1: in std_logic_vector(3 downto 0);
D2: in std_logic_vector(3 downto 0);
D3: in std_logic_vector(3 downto 0);
A: out std_logic_vector(3 downto 0);
HEX0, HEX1, HEX2, HEX3: out std_logic_vector(6 downto 0));
end component;
begin
MuxDec: MuxDec4Disp port map (
D0 => "0000",
D1 => "0001",
D2 => "0010",
D3 => "0011",
A => A,
end bhv;
10
Segunda actividad complementaria:
Finalmente, se nos pide la modificación del código base (el reloj digital) para que simulara
una alarma, es decir, seleccionada una hora los displays deberían quedarse parpadeando con
la hora establecida. Esta parte no se logró realizar ya que al intentar detener de alguna manera
mediante ciclos while, interrupciones con wait, etc. los procesos el compilador no lo permitía.
Conclusión.
Esta primera práctica funciona muy bien como la introducción a la materia ya que varios
conceptos vistos en la materia pasada se retoman aquí y las actividades van acorde a ello.
Otra actividad que se mostró interesante de hacer es la modificación del programa base
dependiendo de la tarjeta con la que contábamos. Personalmente, encuentro varios problemas
con las bases que tengo del lenguaje y la realización de la práctica fue hasta cierto punto
compleja ya que, como se observó, la actividad complementaria número 2 no se obtuvo, hay
varios conceptos que son nuevos para mí.
11