You are on page 1of 19

PRACTICA # 4

BARBOSA BARRERA JULIAN


CHAPARRO JIMENEZ ALIX
CASTILLO BASTIDAS JOSE
NIETO USTARIZ MIGUEL

ING. ILIANA RUMBO

UNIVERSIDAD POPULAR DEL


CESAR
VALLEDUPAR CESAR
2014-11-07

PRCTICA NMERO 4
CIRCUITOS COMBINACIONALES
BSICOS
OBJETIVOS:
Reforzar las habilidades adquiridas en el manejo de los entornos de
simulacin, descripciny sntesis cubiertos en prcticas anteriores
mediante la realizacin del proceso completo dediseo de varios
circuitos combinacionales bsicos.

DESARROLLO
1. Codificador BCD a 7 segmentos
Realice la descripcin y simulacin VHDL de un codificador BCD a 7
segmentos. Revise el manual del usuario de la tarjeta y determine
las terminales adecuadas para el uso de los exhibidores, asigne las
entradas a los interruptores. Obtenga el mapa de interconectividad y
muestre sus resultados al instructor. Realice la programacin del
FPGA. Reporte el procedimiento. Nota: el desplegado se llevara a
cabo en un solo exhibidor.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity DECO7SEGM is
Port ( BCD : in STD_LOGIC_VECTOR (3 downto 0);
SEG : out STD_LOGIC_VECTOR (6 downto 0));
end DECO7SEGM;
architecture Behavioral of DECO7SEGM is
begin
PROCESS (BCD)
BEGIN
CASE BCD IS
SEG <= "1111110" WHEN BCD <= "0000";
"0110000" WHEN BCD <= "0001";
"1101101" WHEN BCD <= "0010";
"1111001" WHEN BCD <= "0011";
"0110011" WHEN BCD <= "0100";

"1011011" WHEN BCD <= "0101";


"1011111" WHEN BCD <= "0110";
"1110000" WHEN BCD <= "0111";
"1111111" WHEN BCD <= "1000";
"1110011" WHEN BCD <= "1001";
END CASE;
END PROCESS;
end Behavioral;

2. Codificador Hexadecimal a 7 segmentos


Realice la descripcin y simulacin VHDL de un codificador
Hexadecimal a 7 segmentos.
Revise el manual del usuario de la tarjeta y determine las terminales
adecuadas para el usode los exhibidores., asigne las entradas a los
interruptores. Obtenga el mapa deinterconectividad del codificador y
mustrelo al instructor. Realice la programacin delFPGA. Nota: el
desplegado se llevara acabo en un solo exhibidor.

3. Medio sumador de 1 bit


Realice el proceso completo de diseo para un medio sumador de 1
bit y muestre susresultados al instructor. Asigne las entradas a los
interruptores deslizables y las salidas a los leds. Realice la
programacin del FPGA. Reporte el procedimiento.
SUMADOR RESTADOR COMPLETO DE 1 BITS
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity SUM_RES is
Port ( CTRL : in STD_LOGIC;
A : in STD_LOGIC;
B : in STD_LOGIC;
CIN : in STD_LOGIC;
COUT :out STD_LOGIC;
C :out STD_LOGIC);

end SUM_RES;
architectureBehavioral of SUM_RES is
begin
C <= ((CIN xor B)xor A);
COUT <= (CIN and (A xor CTRL)) or (B and (A xor CTRL)) or (B and
CIN);
endBehavioral;

4. Incrementador
Repita el punto 3 de esta prctica para un incrementador de 3 bits y
muestre sus resultadosal instructor. Realice la programacin del
FPGA. Reporte el procedimiento.
INCREMENTADOR DE 2 BITS
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity CONTADOR is
Port ( CLK : in STD_LOGIC;
RESET : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR (1 downto 0));

end CONTADOR;
architecture Behavioral of CONTADOR is
begin
PROCESS (CLK,RESET)
BEGIN
IF (RESET='1') THEN
Q <= "00";
ELSIF (CLK'EVENT AND CLK='1') THEN
Q<="01";
END IF;
END PROCESS
end Behavioral;

INCREMENTADOR DE 4 BITS
library IEEE;

use IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
entity contador5B is
Port ( CLK : in STD_LOGIC;
CUENTA : out STD_LOGIC_VECTOR (4 downto 0));
end contador5B;
architecture Behavioral of contador5B is
SIGNAL CUENTA_INT : STD_LOGIC_VECTOR(4 DOWNTO 0) :=
(OTHERS => '0');
begin
P1: PROCESS (CLK)
BEGIN
IF (CLK = '1' AND CLK'EVENT) THEN CUENTA_INT<=
CUENTA_INT+1;
END IF;
END PROCESS;
CUENTA <= CUENTA_INT;
end Behavioral;
SIMULACION CON TEST BENCH
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY contador5B_TB IS
END contador5B_TB;
ARCHITECTURE behavior OF contador5B_TB IS
COMPONENT contador5B
PORT(
CLK : IN std_logic;

CUENTA : OUT std_logic_vector(4 downto 0) );


END COMPONENT;
--Inputs
signal CLK : std_logic := '0';
--Outputs
signal CUENTA : std_logic_vector(4 downto 0);
BEGIN
uut: contador5B PORT MAP (
CLK => CLK,
CUENTA => CUENTA );
stim_proc: process
begin
wait for 100 ns;
CLK <= not CLK;
end process
END;

Cuestionario.
1. Realice la descripcin y simulacin VHDL de un sumador
completo de 8 bits.
VHDL SUMADOR COMPLETO DE 8 BITS
SUMADOR DE 8 BITS
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entityOchoBits is
port (cin : std_logic;
A, B :instd_logic_vector(7 downto 0);
cout: out std_logic;
s : out std_logic_vector(7 downto 0));
endOchoBits;
architecturecomponente of OchoBits is
componentFull_adder
port (cin, A, B : in std_logic;
cout, s :out std_logic);
end component;
signal carry : std_logic_vector (7 downto 1);
begin
FA0 : Full_adder port map(cin,A(0),B(0),carry(1),s(0));
FA1 : Full_adder port map(carry(1),A(1),B(1),carry(2),s(1));
FA2 : Full_adder port map(carry(2),A(2),B(2),carry(3),s(2));
FA3 : Full_adder port map(carry(3),A(3),B(3),carry(4),s(3));
FA4 : Full_adder port map(carry(4),A(4),B(4),carry(5),s(4));
FA5 : Full_adder port map(carry(5),A(5),B(5),carry(6),s(5));
FA6 : Full_adder port map(carry(6),A(6),B(6),carry(7),s(6));
FA7 : Full_adder port map(carry(7),A(7),B(7),cout,s(7));
end componente;

2.Repita el problema 1 del cuestionario para un verificador de


paridad en una palabra de 8 BITS.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity VERIPAR is
Port ( D0 : in STD_LOGIC;
D1 : in STD_LOGIC;
D2 : in STD_LOGIC;
D3 : in STD_LOGIC;
P : in STD_LOGIC;
E : out STD_LOGIC);
end VERIPAR;
architecture Behavioral of VERIPAR is
begin
E <= ((((P XOR D3) XOR D2) XOR D1) XOR D0);
endBehavioral;

3) DECREMENTADOR DE 3 BITS
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity decrementador3bits is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
CIN : in STD_LOGIC;
COUT : out STD_LOGIC;
RESUL : out STD_LOGIC);
END decrementador3bits;
architecture Behavioral of decrementador3bits is
begin

COUT <= (A AND B) OR (A AND CIN) OR (CIN AND B);


RESUL <= ((A XOR B) XOR CIN);
end Behavioral;

4) COMPARADOR COMPLETO DE 1 BITS

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity COMPARADOR is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
EQ : out STD_LOGIC);
end COMPARADOR;
architecture Behavioral of COMPARADOR is
begin
EQ <= (NOT A AND NOT B) OR (A AND B);
endBehavioral;

CONCLUSION

Se reforz las habilidades adquiridas en el manejo de los entornos


de simulacin, descripcin y sntesis cubiertos en prcticas
anteriores mediante la realizacin del proceso completo de diseo
de varios circuitos combinacionales bsicos.

You might also like