Sei sulla pagina 1di 19

UADY

CAMPUS DE CIENCIAS EXACTAS E INGENIERAS

EJERCICIO 1
Es necesario multiplicar dos nmeros de binarios, cada uno de dos bits para formar su producto en binarios. Asuma los dos nmeros representados por (a1, a0) y (b1, b0), donde el suscrito con 0 denote el bit menos significativo.

TABLA DE VERDAD
Se procedi en primera instancia a determinar la tabla de verdad del ejercicio y a conseguir las expresiones de minitrminos que describieran dicha tabla. a1 a0 b1 b0 C3 C2 C1 C0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 1 0 0 1

Para C3 C3 00 01 11 10 00 0 0 0 0 01 0 0 0 0 11 0 0 1 0 10 0 0 0 0 3 = 1 0 1 0 Para C2 C2 00 01 11 10 00 0 0 0 0 01 0 0 0 0 11 0 0 0 1 10 0 0 1 1 2 = 1 0 1 + 1 1 0

Para C1 C1 00 01 11 10 00 0 0 0 0 Para C2 01 0 0 1 1 11 0 1 0 1 10 0 1 1 0 Para C0 C0 00 01 11 10 00 0 0 0 0 01 0 1 1 0 11 0 1 1 0 10 0 0 0 0

1 = 1 0 1 + 0 1 0 + 1 1 0 + 1 0 0

0 = 0 0

IMPLEMENTACIN EN ISE PROJECT NAVIGATOR


Se implement primeramente el archivo principal, guardndolo en un archivo .vhdl, el cdigo fue el siguiente: --INICIO library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity ejer_04 is port ( a : in STD_LOGIC_VECTOR (1 DOWNTO 0); b : in STD_LOGIC_VECTOR (1 DOWNTO 0); F : out STD_LOGIC_VECTOR (3 DOWNTO 0) ); end ejer_04; architecture arq_ejer04 of ejer_04 is signal c0: std_logic; signal c1: std_logic; signal c2: std_logic; signal c3: std_logic; begin c0 <= (a(0) and b(0)); c1 <= (((not a(1)) and a(0) and b(1)) or (a(0) and b(1) and (not b(0))) or (a(1) and (not b(1)) and b(0)) or (a(1) and (not a(0)) and b(0))); c2 <= ((a(1) and (not a(0)) and b(1)) or (a(1) and b(1) and (not b(0)))); c3 <= (a(1) and a(0) and b(1) and b(0)); F(3) <= c3; F(2) <= c2; F(1) <= c1; F(0) <= c0; end arq_ejer04; --FIN

El siguiente archivo creado fue el test bench, el cual nos permite hacer la simulacin, y as poder comprobar lo que hemos hecho antes de pasar a la tarjeta de pruebas, el cdigo fue el siguiente: --INICIO library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity ejer_04_tb is end entity ejer_04_tb; architecture arq_ejer04 of ejer_04_tb is component ejer_04 is Port ( a : in STD_LOGIC_VECTOR (1 DOWNTO 0); b : in STD_LOGIC_VECTOR (1 DOWNTO 0); F : out STD_LOGIC_VECTOR (3 DOWNTO 0) ); end component; signal a_s: signal b_s: signal F_s: signal aa: signal bb: STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (3 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0);

begin compejer04: ejer_04 port map ( a => a_s, b=>b_s, F=>F_s); a_s <= aa; b_s <= bb; aa <= "00", "00" after 50 ns, "00" after 100 ns, "00" after 150 ns, "01" after 200 ns, "01" after 250 ns, "01" after 300 ns, "01" after 350 ns, "10" after 400 ns, "10" after 450 ns,

"10" after 500 ns, "10" after 550 ns, "11" after 600 ns, "11" after 650 ns, "11" after 700 ns, "11" after 750 ns;

bb <= "00", "01" after 50 ns, "10" after 100 ns, "11" after 150 ns, "00" after 200 ns, "01" after 250 ns, "10" after 300 ns, "11" after 350 ns, "00" after 400 ns, "01" after 450 ns, "10" after 500 ns, "11" after 550 ns, "00" after 600 ns, "01" after 650 ns, "10" after 700 ns, "11" after 750 ns; end arq_ejer04; --FIN Por ltimo se cre el archivo UCF, que nos permitir crear el archivo .BIT para su implementacin en la tarjeta de pruebas, en esta parte nos cercioramos que las salidas y entradas correspondieran a las que tiene fsicamente la tarjeta a utilizar. --INICIO NET "a(1)" NET "a(0)" NET "b(1)" NET "b(0)" NET "F(3)" NET "F(2)" NET "F(1)" NET "F(0)" --FIN LOC = N3; LOC = E2; LOC = F3; LOC = G3; LOC = G1; LOC = P4; LOC = N4; LOC = N5;

SIMULACIN

Se gener la simulacin para poder ver los resultados y sabes si los procedimientos anteriores fueron correctos, a continuacin se muestra la simulacin.

Entradas

Asignacin

Salida

Si podemos observar, al multiplicar las asignaciones, se genera el valor de la salida, se prefiri poner estos valores en decimales para poder apreciar mejor el resultado, las marcas en azul nos permiten ver la relacin de las entradas con el tiempo, esto es algo que implementamos en el cdigo que podemos apreciar en la simulacin.

CIRCUITO

Haciendo uso del conocimiento aprendido sobre el software se realiz la implementacin del circuito, del cual se obtuvo la imagen que arriba se muestra

EJERCICIO 2
Es necesario sumar dos nmeros de binarios, cada uno de dos bits para formar una suma de binarios. Asuma los dos nmeros representados por (a1, a0) y (b1, b0), donde el suscrito con 0 denote el bit menos significativo.

TABLA DE VERDAD
Se procedi en primera instancia a determinar la tabla de verdad del ejercicio y a conseguir las expresiones de minitrminos que describieran dicha tabla. a1 a0 b1 b0 C2 C1 C0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 0

Para C2

C2 00 01 11 10 00 0 0 0 0 01 0 0 1 0 11 0 1 1 1 10 0 0 1 1 2 = 1 1 + 1 0 0 + 0 1 0

Para C1 C1 00 01 11 10 00 0 0 1 1 01 0 1 0 1 11 1 0 1 0 10 1 1 0 0 1 = 1 0 1 + 1 1 0 + 1 1 0 + 1 0 1 + 1 0 1 0 + 1 0 1 0

Para C0 C0 00 01 11 10 00 0 1 1 0 01 1 0 0 1 11 1 0 0 1 10 0 1 1 0

0 = 0 0 + 0 0

IMPLEMENTACIN EN ISE PROJECT NAVIGATOR


Se implement primeramente el archivo principal, guardndolo en un archivo .vhdl, el cdigo fue el siguiente: --INICIO library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity ejer_05 is port ( a : in STD_LOGIC_VECTOR (1 DOWNTO 0); b : in STD_LOGIC_VECTOR (1 DOWNTO 0); F : out STD_LOGIC_VECTOR (2 DOWNTO 0) ); end ejer_05; architecture arq_ejer05 of ejer_05 is signal c0: std_logic; signal c1: std_logic; signal c2: std_logic; begin c0 <= ((a(0) and (not b(0))) or ((not a(0)) and b(0))); c1 <= (((not a(1)) and (not a(0)) and b(1)) or ((not a(1)) and b(1) and (not b(0))) or (a(1) and (not b(1)) and (not b(0)))or (a(1) and (not a(0)) and (not b(1))) or ((not a(1)) and a(0) and (not b(1)) and b(0)) or (a(1) and a(0) and b(1) and b(0))); c2 <= ((a(1) and b(1)) or (a(1) and a(0) and b(0)) or (a(0) and b(1) and b(0))); F(2) <= c2; F(1) <= c1; F(0) <= c0; end arq_ejer05; --FIN

El siguiente archivo creado fue el test bench, el cual nos permite hacer la simulacin, y as poder comprobar lo que hemos hecho antes de pasar a la tarjeta de pruebas, el cdigo fue el siguiente: --INICIO library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity ejer_05_tb is end entity ejer_05_tb; architecture arq_ejer05 of ejer_05_tb is component ejer_05 is Port ( a : in STD_LOGIC_VECTOR (1 DOWNTO 0); b : in STD_LOGIC_VECTOR (1 DOWNTO 0); F : out STD_LOGIC_VECTOR (2 DOWNTO 0) ) ; end component; signal a_s: signal b_s: signal F_s: signal aa: signal bb: begin compejer04: ejer_05 port map ( a => a_s, b=>b_s, F=>F_s); STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (2 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0); STD_LOGIC_VECTOR (1 DOWNTO 0);

a_s <= aa; b_s <= bb; aa <= "00", "00" after 50 ns, "00" after 100 ns, "00" after 150 ns, "01" after 200 ns, "01" after 250 ns, "01" after 300 ns, "01" after 350 ns, "10" after 400 ns,

"10" after 450 ns, "10" after 500 ns, "10" after 550 ns, "11" after 600 ns, "11" after 650 ns, "11" after 700 ns, "11" after 750 ns; bb <= "00", "01" after 50 ns, "10" after 100 ns, "11" after 150 ns, "00" after 200 ns, "01" after 250 ns, "10" after 300 ns, "11" after 350 ns, "00" after 400 ns, "01" after 450 ns, "10" after 500 ns, "11" after 550 ns, "00" after 600 ns, "01" after 650 ns, "10" after 700 ns, "11" after 750 ns; end arq_ejer05; --FIN Por ltimo se cre el archivo UCF, que nos permitir crear el archivo .BIT para su implementacin en la tarjeta de pruebas, en esta parte nos cercioramos que las salidas y entradas correspondieran a las que tiene fsicamente la tarjeta a utilizar. --INICIO NET "a(1)" NET "a(0)" NET "b(1)" NET "b(0)" NET "F(2)" NET "F(1)" NET "F(0)" --FIN LOC = N3; LOC = E2; LOC = F3; LOC = G3; LOC = P4; LOC = N4; LOC = N5;

SIMULACIN
Se gener la simulacin para poder ver los resultados y sabes si los procedimientos anteriores fueron correctos, a continuacin se muestra la simulacin.

Entradas

Asignacin

Salida

Si podemos observar, al sumar las asignaciones, se genera el valor de la salida, se prefiri poner estos valores en decimales para poder apreciar mejor el resultado, las marcas en azul nos permiten ver la relacin de las entradas con el tiempo, esto es algo que implementamos en el cdigo que podemos apreciar en la simulacin.

CIRCUITO

Haciendo uso del conocimiento aprendido sobre el software se realiz la implementacin del circuito, del cual se obtuvo la imagen que arriba se muestra

EJERCICIO 3
Disee un circuito combinacional que acepte un nmero de tres bits y genere un nmero binario de salida igual al cuadrado del nmero de entrada.

TABLA DE VERDAD
Se procedi en primera instancia a determinar la tabla de verdad del ejercicio y a conseguir las expresiones de minitrminos que describieran dicha tabla. X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z C5 C4 C3 C 2 C1 C0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1

C5 0 1

00 0 0

01 11 10 0 0 0 0 1 1

5 =

C1 0 1

00 0 0

01 11 10 0 0 0 0 0 0

1 = 0

C4 0 1

00 0 1

01 11 10 0 0 0 1 1 0

4 = +

C0 0 1

00 0 0

01 11 1 1 1 1

10 0 0

0 =

C3 0 1

00 0 0

01 11 10 0 1 0 1 0 0

3 = +

C2 0 1

00 0 0

01 11 10 0 0 1 0 0 1

2 =

IMPLEMENTACIN EN ISE PROJECT NAVIGATOR


Se implement primeramente el archivo principal, guardndolo en un archivo .vhdl, el cdigo fue el siguiente: --INICIO library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity comb_01 is Port ( x : in STD_LOGIC; y : in STD_LOGIC; z : in STD_LOGIC; F : out STD_LOGIC_VECTOR (5 DOWNTO 0) end comb_01; architecture Arquitectura of comb_01 is signal m1: std_logic; signal m2: std_logic; signal m3: std_logic; signal m4: std_logic; signal m5: std_logic; signal m6: std_logic; signal m7: std_logic; begin m1 <= (x) and (y); m2 <= (x) and (not y); m3 <= (x) and (z); m4 <= (not x)and (y) and (z); m5 <= (x) and (not y) and (z); m6 <= (y) and (not z); m7 <= (z); F(5) <= m1; F(4) <= m2 or m3; F(3) <= m4 or m5; F(2) <= m6; F(1) <= '0'; F(0) <= m7; end Arquitectura; --FIN

);

El siguiente archivo creado fue el test bench, el cual nos permite hacer la simulacin, y as poder comprobar lo que hemos hecho antes de pasar a la tarjeta de pruebas, el cdigo fue el siguiente --INICIO library IEEE; use IEEE.STD_LOGIC_1164.all; entity comb_01_tb is end entity comb_01_tb; architecture arquitectura_1 of comb_01_tb is component comb_01 is Port ( x : in STD_LOGIC; y : in STD_LOGIC; z : in STD_LOGIC; F : out STD_LOGIC_VECTOR (5 DOWNTO 0) ) ; end component; signal x_s: signal y_s: signal z_s: signal F_s: signal xy: STD_LOGIC; STD_LOGIC; STD_LOGIC; STD_LOGIC_VECTOR(5 DOWNTO 0); STD_LOGIC_VECTOR(2 DOWNTO 0); port map ( x => x_s, y=>y_s, z=> z_s, F=>F_s);

begin componente_01: comb_01

x_s <= xy(2); y_s <= xy(1); z_s <= xy(0); xy <= "000", "001" after 50 ns, "010" after 100 ns, "011" after 150 ns, "100" after 200 ns, "101" after 250 ns, "110" after 300 ns, "111" after 350 ns; end arquitectura_1; --FIN

Por ltimo se cre el archivo UCF, que nos permitir crear el archivo .BIT para su implementacin en la tarjeta de pruebas, en esta parte nos cercioramos que las salidas y entradas correspondieran a las que tiene fsicamente la tarjeta a utilizar. NET "x" NET "y" NET "z" NET "F(5)" NET "F(4)" NET "F(3)" NET "F(2)" NET "F(1)" NET "F(0)" LOC = N3; LOC = E2; LOC = F3; LOC = G1; LOC = P4; LOC = N4; LOC = N5; LOC = P6; LOC = P7;

SIMULACIN
Se gener la simulacin para poder ver los resultados y sabes si los procedimientos anteriores fueron correctos, a continuacin se muestra la simulacin.

Entradas

Asignacin

Salida

Si podemos observar, al elevar al cuadrado, se genera el valor de la salida, se prefiri poner estos valores en decimales para poder apreciar mejor el resultado, las marcas en azul nos permiten ver la relacin de las entradas con el tiempo, esto es algo que implementamos en el cdigo que podemos apreciar en la simulacin.

CIRCUITO

Haciendo uso del conocimiento aprendido sobre el software se realiz la implementacin del circuito, del cual se obtuvo la imagen que arriba se muestra

Potrebbero piacerti anche