Tarea VHDL
Tarea VHDL
Tarea VHDL
Marcos
Facultad de Ingeniería Electrónica y Eléctrica
Curso: Tema:
Numero:
07/10/18 08/10/18
1
Grupo: Profesor:
Numero: Horario:
Lunes:
14-16 Hrs Alarcón Matutti, Rubén
2
Martes:
16-18 Hrs
UNIVERSIDAD NACIONAL MAYOR DE
SAN MARCOS
Facultad de Ingeniería Electrónica y Eléctrica
PROBLEMA 2.47:
a) Escriba código de VHDL para describir las funciones siguientes:
f 1=x 1 x́3 + x 2 x´3 + x́ 3 x́ 4 + x 1 x2 + x 1 x´4
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 f 1=f 2.
PROBLEMA 2.48:
Considere las instrucciones siguientes de asignación en VHDL
f 1<¿ ( ( x 1∧x 3 )∨( NOT x 1∧NOT x 3 ) )∨( ( x 2∧x 4 )∨( NOT x 2∧NOT x 4 ) ) ;
f 2<¿ ( x 1∧x 2∧NOT x 3∧NOT x 4 )∨( NOT x 1∧NOT x 2∧x 3∧x 4 )∨¿
entity probema2 is
port
(
-- input ports
x1,x2,x3,x4 : in bit;
-- output ports
f1,f2 : out bit );
end problema2 ;
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 ;
PROBLEMA 4.38:
Escriba el código de VHDL para implementar la función
f ( x 1 , … , x 4 ) =∑ m(0,1,2,4,5,7,8,9,11,12,14,15)
x1 x2 \ 00 01 11 10
x3 x4
00 1 1 1
01 1 1 1
11 1 1 1
10 1 1 1
entity testbench3 is
end entity testbench3;
PROBLEMA 4.39:
Escriba el código de VHDL para implementar la función
f ( x 1 , … , x 4 ) =∑ m ( 1,4,7,14,15 )+ D (0,5,9)
x1 x2 \ 00 01 11 10
x3 x4
00 1 1
01 1 X 1
11 1 1
10 X
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;
PROBLEMA 4.40:
Escriba el código de VHDL para implementar la función
f ( x 1 , … , x 4 ) =∏ M ( 6,8,9,12,13)
x1 x2 \ 00 01 11 10
x3 x4
00
01 0
11 0 0
10 0 0
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;
f ( x 1 , … , x 4 ) =∏ M ( 3, 11,14 )+ D (0,2,10,12)
x1 x2 \ 00 01 11 10
x3 x4
00 X 0 X
01
11 X 0
10 0 X
entity problema6 is
port (a,b,c,d: in bit; z: out bit);
end entity problema6;
entity testbench6 is
end entity testbench6;