Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Practica #2
“Diseño del juego piedra, papel, tijera”
J. Eduardo Gonzalez B., Joyce Aguilar M., Ricardo Romero S., Roberto Castillo M.,
Resumen – Para esta practica se planteo el empate deberá de mostrarse por medio de un 11
siguiente problema;* en la salida.
En el caso de que no se oprima J (J=0) las
Diseñe un sistema electrónico digital capaz de salidas SA y SB serán igual a cero.
mostrar al ganador entre dos adversarios
del tradicional concurso piedra, papel o tijera. Introducción
El sistema estará definido por las entradas de
los jugadores A (A1, A2) y B (B1, B2) y dos Este documento habla sobre la resolución de un
salidas Sa y Sb, Se recomienda usar el siguiente problema, el diseño de un sistema
código para identificar cada propuesta: combinacional, con su respectivo modelo
optimizado y su posterior emulación utilizando
codigo Propuesta código VHDL
0 0 No hay El problema plantea que se necesitan de al
propuesta
menos cuatro votos, para decidir que elección
0 1 piedra se tomara, sin embargo, si ningún regidor vota
a favor, no se tomara la decisión como válida
1 0 Papel
aunque cuente con la cantidad de votos
1 1 Tijera necesarios.
1 0 0 1 1 0 1
1 0 1 0 0 1 0
S0 ┐C┐D ┐CD C C
D ┐D
1 0 1 0 1 1 1
┐A┐B 0 1 0 1
1 0 1 1 0 0 1
1 0 1 1 1 1 0 ┐AB 0 1 0 1
1 1 0 0 0 1 0 AB 0 1 0 1
1 1 0 0 1 1 0 A┐B 0 1 0 1
1 1 0 1 0 1 1
1 1 0 1 1 0 1
S1 ┐C┐D ┐CD C C
D ┐D
1 1 1 0 0 1 0
┐A┐B 0 0 0 1
1 1 1 0 1 0 1
┐AB 1 1 1 0
1 1 1 1 0 1 0
1 1 1 1 1 1 1 AB 1 1 1 0
A┐B 0 0 0 1
S2 ┐C┐D ┐CD C C
𝐹 = ┐𝐴𝑆┐𝑅1𝑅2𝑅3 + ┐𝐴𝑆𝑅1𝑅2┐𝑅3 D ┐D
+ ┐𝐴𝑆𝑅1┐𝑅2𝑅3
┐A┐B 0 0 1 0
+ ┐𝐴𝑆𝑅1𝑅2𝑅3 + 𝐴𝑆𝑅1𝑅2𝑅3
+ 𝐴𝑆𝑅1𝑅2┐𝑅3 + 𝐴𝑆𝑅1┐𝑅2𝑅3 ┐AB 0 0 1 1
+ 𝐴𝑆𝑅1┐𝑅2┐𝑅3 AB 1 1 0 0
+ 𝐴𝑆┐𝑅1𝑅2𝑅3
A┐B 1 1 0 1
+ 𝐴𝑆┐𝑅1┐𝑅2𝑅3
+ 𝐴𝑆┐𝑅1┐𝑅2𝑅3
+ 𝐴┐𝑆𝑅1𝑅2𝑅3
S3 ┐C┐D ┐CD C C
+ 𝐴┐𝑆𝑅1𝑅2┐𝑅3 D ┐D
+ 𝐴┐𝑆𝑅1┐𝑅2𝑅3
┐A┐B 0 0 0 0
+ 𝐴┐𝑆𝑅1┐𝑅2┐𝑅3
+ 𝐴┐𝑆┐𝑅1𝑅2𝑅3 ┐AB 0 0 0 0
+ 𝐴┐𝑆┐𝑅1┐𝑅2𝑅3 AB 0 0 1 1
+ 𝐴┐𝑆┐𝑅1𝑅2┐𝑅3
A┐B 0 0 1 0
Mapa de Karnaugh.
//robert Ecuación:
┐C┐D ┐CD C C
D ┐D
//robert
Código VHDL:
---------------------------------------
---------------------------------------
---
-- Company:
-- Engineer:
--
-- Create Date: 20:27:40 29/06/2018
-- Design Name:
-- Module Name: Votacion - a1 :
Behavioral in
-- Project Name:
-- Target Devices: STD_LOGIC;
-- Tool versions: a2 : in STD_LOGIC;
-- Description: b1 : in STD_LOGIC;
-- b2 : in STD_LOGIC;
-- Dependencies: sa : out STD_LOGIC;
-- sb : out STD_LOGIC);
-- end pp;
architecture Behavioral of Votacion is
begin
sa <=(j and a1 and not a2 and b1)or (j
and a1 and a2 and b2)or
(j and a2 and not b1 and b2);
sb <= (j and a1 and not a2 and not b1
and b2)or
(j and a1 and b1 and not b2)or
(j and a1 and a2 and b1)or
(j and a2 and b1 and b2)or
(j and not a1 and a2 and b2);
end Behavioral;
Revision: Resultados
-- Revision 0.01 - File Created
-- Additional Comments: //robert
--
---------------------------------------
---------------------------------------
--- library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
Referencias