Está en la página 1de 8

CP - SISTEMAS DIGITALES

PRÁCTICA N°10
1. TEMA
Arquitectura Flujo de Datos en VHDL

2. OBJETIVOS
2.1. Familiarizar al estudiante con la sintaxis y funcionamiento de las sentencias
concurrentes para el control de flujo de datos en VHDL.
2.2. Codificar programas utilizando sentencias concurrentes de control de flujo para la
resolución de circuitos combinacionales básicos escritos en VHDL.
2.3. Relacionar conceptos de sistemas digitales con el funcionamiento de dispositivos
lógicos programables.

3. INFORME
3.1. Realizar un programa que permita convertir de BCD (1 digito) a 7 segmentos
utilizando ecuaciones booleanas. Presentar la tabla de verdad del circuito a
implementarse, así como los mapas K empleados para encontrar cada uno de los
segmentos. Presentar el código implementado y la simulación del correcto
funcionamiento utilizando el Universal Program VWF.

Tabla 1 BCD a 7 segmentos

Term ABCD a b c d e f g
.
0 0000 1 1 1 1 1 1 0
1 0001 0 1 1 0 0 0 0
2 0010 1 1 0 1 1 0 1
3 0011 1 1 1 1 0 0 1
4 0100 0 1 1 0 0 1 1
5 0101 1 0 1 1 0 1 1
6 0110 1 0 1 1 1 1 1
7 0111 1 1 1 0 0 0 0
8 1000 1 1 1 1 1 1 1
9 1001 1 1 1 0 0 1 1
10 1010 1 1 1 0 1 1 1
11 1011 0 0 1 1 1 1 1
12 1100 1 0 0 1 1 1 0
13 1101 0 1 1 1 1 0 1
14 1110 1 0 0 1 1 1 1
15 1111 1 0 0 0 1 1 1

Mapas de Karnaugh:
a:
CP - SISTEMAS DIGITALES

b:

c:
CP - SISTEMAS DIGITALES

d:

e:
CP - SISTEMAS DIGITALES

f:

g:
CP - SISTEMAS DIGITALES

Código Implementado:
-- Decodificador BCD a Display 7 segmentos con circuitos combinacionales.

library IEEE;

use IEEE.std_logic_1164.all;

entity dedBCD4t_7segCOM is

port (

a, b, c, d, e, f, g : out std_logic;

x3, x2, x1, x0 : in std_logic

);

end dedBCD4t_7segCOM;

architecture arch of dedBCD4t_7segCOM is

begin

-- Se expresan las salidas como funciones logicas.

a <= (x3 and not x2 and not x1) or (not x3 and x2 and x0) or (not x2 and not x0) or (not x3 and x1) or (x3
and not x0) or (x2 and x1);
CP - SISTEMAS DIGITALES

b <= (not x3 and not x1 and not x0) or (not x3 and x1 and x0) or (x3 and not x1 and x0) or (not x2 and not
x1) or (not x2 and not x0);

c <= (not x3 and not x1) or (not x3 and x0) or (not x1 and x0) or (not x3 and x2) or (x3 and not x2);

d <= (not x2 and not x1 and not x0) or (not x3 and x1 and not x0) or (not x2 and x1 and x0) or (x2 and not x1
and x0) or (x3 and x2 and not x0);

e <= (not x2 and not x0) or (x1 and not x0) or (x3 and x1) or (x3 and x2);

f <= (not x3 and x2 and not x1) or (not x1 and not x0) or (x2 and not x0) or (x3 and not x2) or (x3 and x1);

g <= (not x3 and x2 and not x1) or (not x2 and x1) or (x1 and not x0) or (x3 and not x2) or (x3 and x0);

end arch;

Simulación:

Figura 1 Funcionamiento del código con lógica combinacional.

3.2. Realizar un programa que permita convertir de BCD (1 digito) a 7 segmentos


utilizando sentencias concurrentes. Presentar el código implementado y la
simulación del correcto funcionamiento utilizando el Universal Program VWF.

-- Decodificador BCD a Display 7 segmentos con sentencias concurrentes.


library IEEE;
use IEEE.std_logic_1164.all;

entity decBCD4t_7seg is
port (
a, b, c, d, e, f, g : out std_logic;
x3, x2, x1, x0 : in std_logic
);
end entity;

architecture arch of decBCD4t_7seg is


begin
CP - SISTEMAS DIGITALES

-- Decodificación
process (x3, x2, x1, x0)
variable auxVectOut : std_logic_vector (6 downto 0);
variable auxVectIn : std_logic_vector (3 downto 0);
begin

-- Se cargan entradas al vector auxiliar.


auxVectIn(3) := x3;
auxVectIn(2) := x2;
auxVectIn(1) := x1;
auxVectIn(0) := x0;

if auxVectIn = "0000" then auxVectOut := "1111110"; -- 0


elsif auxVectIn = "0001" then auxVectOut := "0110000"; -- 1
elsif auxVectIn = "0010" then auxVectOut := "1101101"; -- 2
elsif auxVectIn = "0011" then auxVectOut := "1111001"; -- 3
elsif auxVectIn = "0100" then auxVectOut := "0110011"; -- 4
elsif auxVectIn = "0101" then auxVectOut := "1011011"; -- 5
elsif auxVectIn = "0110" then auxVectOut := "1011111"; -- 6
elsif auxVectIn = "0111" then auxVectOut := "1110000"; -- 7
elsif auxVectIn = "1000" then auxVectOut := "1111111"; -- 8
elsif auxVectIn = "1001" then auxVectOut := "1110011"; -- 9
elsif auxVectIn = "1010" then auxVectOut := "1110111"; -- 10 A
elsif auxVectIn = "1011" then auxVectOut := "0011111"; -- 11 b
elsif auxVectIn = "1100" then auxVectOut := "1001110"; -- 12 C
elsif auxVectIn = "1101" then auxVectOut := "0111101"; -- 13 d
elsif auxVectIn = "1110" then auxVectOut := "1001111"; -- 14 E
elsif auxVectIn = "1111" then auxVectOut := "1000111"; -- 15 F
else auxVectOut := "UUUUUUU";
end if;

-- Se cargan salidas al vector auxiliar.


a <= auxVectOut(6);
b <= auxVectOut(5);
c <= auxVectOut(4);
d <= auxVectOut(3);
e <= auxVectOut(2);
f <= auxVectOut(1);
g <= auxVectOut(0);

end process;
end architecture;

Simulación:
CP - SISTEMAS DIGITALES

Figura 2 Funcionamiento del código con sentencias concurrentes.

3.3. Compara el uso de ecuaciones booleanas con el uso de sentencias concurrentes


para la solución de circuitos combinacionales. ¿En qué casos se recomendaría el
uso de las ecuaciones y en qué caso el uso de sentencias?
A pesar de un ahorro en líneas de código, en ocasiones, la complejidad de las
funciones lógicas puede ocasionar errores, mientras que las sentencias en
relación con la lógica de programación resultan mayormente intuitiva y en
ocasiones más simple.
En conclusión, siempre que las ecuaciones lógicas sean más simples, se puede
emplear sobre las sentencias concurrentes.

3.4. Conclusiones.
Se observó que la lógica secuencial agilita la obtención de las funciones
requeridas por un determinado HW.
Se corroboró que el uso de ecuaciones lógicas puede ser contraproducente
cuando se posee múltiples funciones lógicas de varias variables.

3.5. Recomendaciones.
Se recomienda el verificar las ecuaciones lógicas, debido a que los resultados
pueden ser incorrectos si la ecuación se encuentra mal implementada o se tiene
un error en las líneas.
Al corregir simulaciones VWF se debe volver a abrir la forma de onda, en lugar de
generar un nuevo archivo VWF.

También podría gustarte