Sei sulla pagina 1di 3

UNIVERSIDAD NACIONAL MAYOR DE

SAN MARCOSCiclo Académico 2017 - I


FACULTAD DE INGENIERÍA
ELÉCTRONICA Y ELECTRICA
Fecha: 06-06-2017
ESCUELAS ACADEMICO
PROFESIONALES Duración:
2 Horas

CURSO: ________DISEÑO
DIGITAL__________________________________
COD. CURSO:

TIPO DE PRUEBA: PRACTICA No. Ex.


PARCIAL X EX. FINAL
EX. SUST.

PREGUNTA 1: Implemente el circuito que genere la siguiente señal de salida (5 puntos):

PREGUNTA 2: Implementar el siguiente contador (5 puntos):

◦ La señal MIN sirve para establecer el valor inicial (si no se activa por defecto es 0).
◦ La señal MAX sirve para establecer el valor final (si no se activa por defecto es F).
◦ La entrada A (4 bits) determina el valor inicial sólo cuando se activa MIN.
◦ La entrada B (4 bits) determina el valor final sólo cuando se activa MAX.

PREGUNTA 3: Implementar el siguiente circuito en VHDL (6 puntos):

Cuando no se presiona ningún botón (las entradas por defecto son 0s) deben estar apagados los 4
display. Cuando se presiona HALT se muestra en los display (mientras se mantenga pulsado). Lo mismo
pasa con las otras entradas. La entrada con mayor prioridad es HALT y la de menor es FULL.

PREGUNTA 4: (4 puntos) Implementar un comparador de dos números de 4 bits teniendo en cuenta el


bit de signo. Las salidas de este circuito debe indicar si:

• MAY = 1 si (A > B).


• IGUAL = 1 si (A = B).

• MEN = 1 ( A < B).

EL PROFESOR
Solucion No1:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity pregunta1 is
port(clk : in std_logic;
z: out std_logic);
end pregunta1;

architecture solucion of pregunta1 is


signal contador: std_logic_vector(3 downto 0);
begin
process(clk)
begin
if rising_edge(clk) then
contador <= contador + 1;
if contador = 13 then
contador <= (others=>'0');
end if;
end if;
end process;

z <= '0' when contador=4 else


'0' when contador=8 else
'0' when contador=11 else
'0' when contador=13 else '1';
end solucion;

Solucion No2:

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity pregunta2 is
port(clk,min,max: in std_logic;
A,B: in std_logic_vector(3 downto 0);
Q: out std_logic_vector(3 downto 0));
end pregunta2;

architecture solucion of pregunta2 is


begin
process(clk)
variable CONTADOR,MINIMO,MAXIMO:
std_logic_vector(3 downto 0);
begin
if rising_edge(clk) then
if min = '1' then
MINIMO := A;
end if;
if max = '1' then
MAXIMO := B+1;
end if;
CONTADOR := CONTADOR + 1;
if CONTADOR = MAXIMO then
CONTADOR := MINIMO;
end if;
end if;
Q <= CONTADOR;
end process;
end solucion;

Solucion No3:

Potrebbero piacerti anche