0% found this document useful (0 votes)
48 views10 pages

Universidad Nacional Mayor de San Marcos: Trabajovhdl

The document describes VHDL code implementations for logic functions based on problems from a digital circuits course. It includes VHDL code to describe logic functions f1 and f2 from problems 2.47 and 2.48, and logic functions from mapping tables for problems 4.38 and 4.39. Simulation waveforms are shown to verify the VHDL implementations are correct based on the given logic function descriptions and mapping tables.

Uploaded by

Carlo Ramirez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views10 pages

Universidad Nacional Mayor de San Marcos: Trabajovhdl

The document describes VHDL code implementations for logic functions based on problems from a digital circuits course. It includes VHDL code to describe logic functions f1 and f2 from problems 2.47 and 2.48, and logic functions from mapping tables for problems 4.38 and 4.39. Simulation waveforms are shown to verify the VHDL implementations are correct based on the given logic function descriptions and mapping tables.

Uploaded by

Carlo Ramirez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIVERSIDAD NACIONAL MAYOR DE

SAN MARCOS
Universidad del Perú - Decana de América

FACULTAD DE INGENIERÍA ELECTRÓNICA Y ELÉCTRICA

E.P de INGENIERÍA ELECTRÓNICA

TrabajoVHDL

PROFESOR: ALARCÓN MATUTTI RUBÉN

ALUMNO: HUAMANI AUCCASI ROY

CÓDIGO: 14190014

CURSO: CIRCUITOS DIGITALES I

HORARIO: JUEVES (4 – 6 PM)

LIMA – PERÚ

2019
Problema 2.47

a. Escriba el código VHDL para describir las funciones siguientes:

f 1=x 1. x´3+ x 2. x´3+ x´3 . x´4 + x 1. x 2+ x 1 x´4

1era forma
ENTITY ejercicio247a IS
PORT(x1,x2,x3,x4 :IN BIT;
F :OUT BIT);
END ejercicio247a;
ARCHITECTURE Funcionlogica OF ejercicio247a IS
BEGIN
F<= (x1 AND NOT x3)OR(x2 AND NOT x3)OR(NOT x3 AND NOT x4)OR(x1 AND x2)OR(x1 AND NOT x4);
END Funcionlogica ;
2da forma

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

ENTITY pregunta247a IS

PORT(

x1 : in std_logic;

x2 : in std_logic;

x3 : in std_logic;

x4 : in std_logic;

F1 : out std_logic);

END pregunta247a;

architecture FuncLogic of pregunta247a is

signal aux1 : std_logic;

signal aux2 : std_logic;

signal aux3 : std_logic;

signal aux4 : std_logic;

signal aux5 : std_logic;

begin

aux1<= x1 and not x3;

aux2<= x2 and not x3;

aux3<= not x3 and not x4;

aux4<= x1 and x2;

aux5<= x1 and not x4;

F1<= aux1 or aux2 or aux3 or aux4 or aux5;

end FuncLogic;
f 2=( x 1+ x´3 )( x 1+ x 2+ x´4 ) . ¿

library ieee;

use ieee.std_logic_1164.all;

ENTITY pregunta247b IS

PORT(

x1 : in std_logic;

x2 : in std_logic;

x3 : in std_logic;

x4 : in std_logic;

F2 : out std_logic);

END pregunta247b;

architecture FuncLogic of pregunta247b is

signal aux1 : std_logic;

signal aux2 : std_logic;

signal aux3 : std_logic;

begin

aux1<= x1 or not x3;

aux2<= x1 or x2 or not x4;

aux3<= x2 or not x3 or not x4;

F2<= aux1 and aux2 and aux3;

end FuncLogic;

b. Use la simulación funcional para


comprobar que f1=f2
f1

f2

Podemos observar en las 2 graficas que si cumple que f1=f2

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 )∨¿
( x 1∧NOT x 2∧NOT x 3∧x 4 ) ∨( NOT x 1∧x 2∧x 3∧NOT x 4 ) ;

a) Escriba el código de VHDL completo para implementar f1 y f2

ENTITY ejercicio248 IS

PORT(x1,x2,x3,x4 :IN BIT;

f1,f2 :OUT BIT);

END ejercicio248;

ARCHITECTURE Funcionlogica OF ejercicio248 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 Funcionlogica ;

b) Use simulación funcional para comprobar que f 1=f ´2


Y nuestra gráfica nos queda:

Como podemos verificar f 1=f ´2 si se cumple.

Problema 4.38
1. Escriba el código de VHDL para implementar la función

f ( x 1+ x 2+ x 3+ x 4 )=∑ m ( 0,1,2,4,5,7,8,9,11,12,14,15 )

X1 X2 X3 X4 F
m0 0 0 0 0 1
m1 0 0 0 1 1
m2 0 0 1 0 1
m3 0 0 1 1 0
m4 0 1 0 0 1
m5 0 1 0 1 1
m6 0 1 1 0 0
m7 0 1 1 1 1
m8 1 0 0 0 1
m9 1 0 0 1 1
m10 1 0 1 0 0
m11 1 0 1 1 1
m12 1 1 0 0 1
m13 1 1 0 1 0
m14 1 1 1 0 1
m15 1 1 1 1 1

Mapa K

f = x´1 . x´2. x´4+ x 1. x 2. x´4+ x 2. x 3. x 4 + x 1. x 3. x 4 + x´1 . x´3+ x´2. x´3

Código
ENTITY ejercicio438 IS
PORT(x1,x2,x3,x4 :IN BIT;
f1 :OUT BIT);
END ejercicio438;
ARCHITECTURE Funcion OF ejercicio438 IS
BEGIN
f1 <= (not x1 and not x2 and not x4) or (x1 and x2 and not x4)or( x2 and x3 and x4)or(x1 and x3 and x4)
or( not x1 and not x3 )or(not x2 and not x3);

END Funcion ;

Forma de Onda

Problema 4.39

Escriba el código de VHDL para implementar la función

f ( x 1, … .. , x 4 )=∏ M ( 6,8,9,12,13 )
X1 X2 X3 X4 F
M0 0 0 0 0 1
M1 0 0 0 1 1
M2 0 0 1 0 1
M3 0 0 1 1 1
M4 0 1 0 0 1
M5 0 1 0 1 1
M6 0 1 1 0 0
M7 0 1 1 1 1
M8 1 0 0 0 0
M9 1 0 0 1 0
M10 1 0 1 0 1
M11 1 0 1 1 1
M12 1 1 0 0 0
M13 1 1 0 1 0
M14 1 1 1 0 1
M15 1 1 1 1 1

Mapa K

f =( x´1+ x 3 ) .( x 1+ x´2+ x´3+ x 4)

Código

ENTITY ejercicio439 IS
PORT(x1,x2,x3,x4 :IN BIT;
f1 :OUT BIT);
END ejercicio439;
ARCHITECTURE Funcion OF ejercicio439 IS
BEGIN
f1 <= (not x1 or x3) and (x1 or not x2 or not x3 or x4);

END Funcion ;

Forma de Onda

You might also like