Universidad Nacional Mayor de San Marcos Facultad de Ingeniería Electrónica y Eléctrica
Apellidos y Nombres:
N° de Matricula:
Romero de la Cruz Julio Cesar
16190144
Curso:
Tema:
Circuitos Digitales
VHDL
Trabajo:
Tarea
Fechas:
Nota:
Realización:
Entrega:
07/10/18
08/10/18
Numero:
1 Grupo: Numero:
2
Horario: Lunes: 14-16 Hrs Martes: 16-18 Hrs
Profesor:
Alarcón Matutti, Rubén
UNIVERSIDAD NACIONAL MAYOR DE SAN MARCOS Facultad de Ingeniería Electrónica y Eléctrica
PR OBL E MA 2.47:
a) Escriba código de VHDL para describir las funciones siguientes:
= ̅ + ̅ + ̅ ̅ + + ̅ = + ̅ . + + ̅ . + ̅ + ̅ Código VHDL: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity problema1 is port( x1
: in std_logic; x2
: in std_logic;
x3
: in std_logic;
x4
: in std_logic;
f1,f2
: out std_logic);
end problema1; architecture solucion1 of problema1 is begin f1<= (x1 and(not x3))or(x2 and(not x3))or((not x3)and(not x4))or(x1 and x2)or(x1 and(not x4)); f2<= (x1 or(not x3))and(x1 or x2 or(not x4))and(x2 or(not x3)or(not x4)); end
solucion1;
Use simulación funcional para comprobar que 1
= 2.
Y nuestra gráfica nos queda
Logramos verificar que ambas funciones tienen los mismos valores Usamos RTL viewer, para ver la conexión de las compuertas:
PR OB LE MA 2.48:
Considere las instrucciones siguientes de asignación en VHDL
< = ( ) ( ); < = ;
a) Escriba el código de VHDL completo para implementar f1 y f2 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity probema2 is port ( -- input ports x1,x2,x3,x4 : in bit; -- output ports f1,f2 : out bit ); end problema2 ;
architecture solucion2 of problema2 is begin f1<=((x1 and x3)or(not x1 and not x3 )) or ((x2 and x4) or (not x2 and not x4)); f2<=((x1 and x2 and not x3 and not x4) or (not x1 and not x2 and x3 and x4) or (x1 and not x2 and not x3 and x4) or (not x1 and x2 and x3 and not x4)); end solucion2 ;
b) Use simulación funcional para comprobar que 1
= ̅2
Y nuestra gráfica nos queda:
Como podemos verificar 1
= ̅2 si se cumple.
c) Usamos RTL viewer, para ver la conexión de las compuertas:
PR OBL E MA 4.38:
Escriba el código de VHDL para implementar la función
, … , = ∑ ,,,,,,,,,,, Pasamos los datos de minterminos a un mapa de Karnaugh y poder hacer l a simplificación respectiva para poder hallar nuestra función
\
00
01
00
1
1
01
1
1
11
1
10
1
11
1 1 1
1
10
1
1
Lo que obtendríamos sería:
= ̅ ̅ + ̅ ̅ + ̅ ̅ + + + + ̅ ̅ ̅ Escribiendo el código VHDL de la función entity problema3 is port (a,b,c,d: in bit; z: out bit); end problema3 ;
architecture solucion3 of problea3 is begin z <= (not a and not c) or (not c and not d) or (not b and not c) or (a and c and d) or (b and c and d) or (a and b and c) or (not a and not b and not d); end solucion3;
Luego el testbench para poder simular
entity testbench3 is end entity testbench3;
architecture testbench of testbench3 is signal x1,x2,x3,x4,f: bit;
begin x1 <= not x1 after 400 ns; x2 <= not x2 after 200 ns; x3 <= not x3 after 100 ns; x4 <= not x4 after 50 ns;
conec: entity work.prob4_38(arch) port map (x1,x2,x3,x4,f); end architecture testbench;
La simulación fue la siguiente:
Y logramos verificar que cumple con los mintérminos
PR OBL E MA 4.39:
Escriba el código de VHDL para implementar la función
, … , = ∑ ,,,, +,, Pasamos los datos de minterminos a un mapa de Karnaugh y poder hacer l a simplificación respectiva para poder hallar nuestra función
\
00
01
00
1
1
01
1
X
11
1 1
11
10
1
X
10
Lo que obtendríamos sería:
= ̅ ̅ + + Escrbiendo el código VHDL de la función
entity problema4 is port (a,b,c,d: in bit; z: out bit); end entity problema4; architecture solucion4 of problema4 is begin z <= (not a and not c) or (b and c and d) or (a and b and c); end solucion4;
Luego el testbench para poder simular: entity testbench4 is end entity testbench4; architecture testbench of testbench4 is signal x1,x2,x3,x4,f: bit;
begin x1 <= not x1 after 400 ns; x2 <= not x2 after 200 ns; x3 <= not x3 after 100 ns; x4 <= not x4 after 50 ns; conec: entity work.prob4_39(arch) port map (x1,x2,x3,x4,f); end architecture testbench;
La simulación fue la siguiente:
PR OBL E MA 4.40:
Escriba el código de VHDL para implementar la función
, … , = ∏ ,,,, Pasamos los datos de maxterminos a un mapa de Karnaugh y poder hacer la simplificación respectiva para poder hallar nuestra función
\
00
01
11
10
00
0
01 11
0
0
10
0
0
Lo que obtendríamos sería:
= ̅ + . + ̅ + ̅ + Escrbiendo el código VHDL de la función entity problema5 is port (a,b,c,d: in bit; z: out bit); end problema5;
architecture solucion5 of problema5 is begin z <= (not a or c) and (a or not b or not c or d); end arch;
Luego el testbench para poder simular:
entity testbench5 is end entity testbench5; architecture testbench of testbench5 is signal x1,x2,x3,x4,f: bit; begin
x1 <= not x1 after 400 ns; x2 <= not x2 after 200 ns; x3 <= not x3 after 100 ns; x4 <= not x4 after 50 ns;
conec: entity work.prob4_40(arch) port map (x1,x2,x3,x4,f); end architecture testbench;
La simulación fue la siguiente:
PR OBL E MA 4.41:
Escriba el código de VHDL para implementar la función
, … , = ∏ ,, + , ,, Pasamos los datos de maxtérminos a un mapa de Karnaugh y poder hacer la simplificación respectiva para poder hallar nuestra función
\
00
00
X
01
11
10
0
X
01
X
11
0 0
10
X
Lo que obtendríamos sería:
= + ̅3 . ̅ + ̅ + 4
Escrbiendo el código VHDL de la función:
entity problema6 is port (a,b,c,d: in bit; z: out bit); end entity problema6;
architecture solucion6 of problema6 is begin z <= (b or not c) and (not a or not b or d); end solucion6;
Luego el testbench para poder simular
entity testbench6 is end entity testbench6;
architecture testbench of testbench6 is signal x1,x2,x3,x4,f: bit; begin x1 <= not x1 after 400 ns; x2 <= not x2 after 200 ns; x3 <= not x3 after 100 ns; x4 <= not x4 after 50 ns;
conec: entity work.prob4_41(arch) port map (x1,x2,x3,x4,f); end architecture testbench;
La simulación fue la siguiente:
Como podemos ver, la función incluye todos los maxtérminos.