Professional Documents
Culture Documents
DE SAN MARCOS
Universidad del Perú, DECANA DE AMERICA
2019 – 2
PROBLEMA 1
Codigo 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 ( A: in std_logic;
B: in std_logic;
S: in bit_vector (3 downto 0);
F: out std_logic);
end problema1;
architecture solucion of problema1 is
begin
with S select
F<= (NOT A) when "0000",
(Not (A and B)) when "0001",
((Not A) or B) when "0010",
'1' when "0011",
(A xnor B) when "0100",
(Not B) when "0101",
(A xor B) when "0110",
(A or Not B) when "0111",
(A and B) or A when "1000",
A xor B when "1001",
B when "1010",
A or B when "1011",
'0' when "1100",
A and (B xor A) when "1101",
A and B when "1110",
A when "1111";
end solucion;
Waveform Editor
use IEEE.STD_LOGIC_1164.ALL;
entity pregunta2 is
x2:in STD_LOGIC;
x3:in STD_LOGIC;
x4:in STD_LOGIC;
f1,f2:OUT STD_LOGIC);
end pregunta2;
begin
end dataflow;
b) Use simulación funcional para probar que f 1=f 2
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);
use IEEE.STD_LOGIC_1164.ALL;
entity pregunta248 is
x2:in STD_LOGIC;
x3:in STD_LOGIC;
x4:in STD_LOGIC;
F1,F2:OUT STD_LOGIC);
end pregunta248;
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);
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity problema438 is
end problema438 ;
begin
with x select F<="1" when "0000",
end solucion;
4.39. Escriba el codigo VHDL para implementar la siguiente función
f ( x 1 … x 4 )=∑ m ( 1,4,7,14,15 ) + D(0,5,9)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity problema439 is
x2:in STD_LOGIC;
x3:in STD_LOGIC;
x4:in STD_LOGIC;
F1:OUT STD_LOGIC);
end problema439;
beginF1<=((not x1) and (not x3))or( x2 and x3 and x4)or(x1 and x2 and x3)
end solucion;
4.40 Escriba el codigo VHDL para implementar la siguiente función
f ( x 1 … x 4 )=∏ M (6,8,9,12,13)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity problema440 is
end problema440 ;
begin
end solucion;
4.41. Escriba el codigo VHDL para implementar la siguiente función
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity problema441 is
x2:in STD_LOGIC;
x3:in STD_LOGIC;
x4:in STD_LOGIC;
F1:OUT STD_LOGIC);
end problema441;
begin
F1<=(x2 and (not x3)) or ( (not x1) and (not x2) and x4);
end solucion;