Está en la página 1de 12

UNIVERSIDAD DEL MAGDALENA

FACULTAD DE INGENIERÍA ELECTRÓNICA


DISEÑO DE SISTEMAS DIGITALES

TALLER 2
GRUPO N° 1

MARIANA DE LOS ANGELES PALACIOS MOSCARELLA


2018119045

Santa Marta
14/03/20
1)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity ModuloTopTemperatura is
Port ( X,Y,Z : in STD_LOGIC;
O : out STD_LOGIC);
end ModuloTopTemperatura;

architecture Behavioral of ModuloTopTemperatura is

signal XYZ: std_logic_vector(2 downto 0);


begin

XYZ <= X & Y & Z;

O <= '1' when XYZ ="100" or XYZ = "111" else '0';

end Behavioral;
2)

a) El semáforo E-O estará en luz verde siempre que los carriles C


y D estén ocupados
b) El semáforo E-O estará en luz verde siempre que C o D estén
ocupados, pero A y B no estén ocupados
c) El semáforo N-S estará en luz verde siempre que los carriles A
y B estén ocupados, pero que C y D no lo estén
d) El semáforo N-S también estará en luz verde cuando A o B estén
ocupados en tanto que C y D estén vacíos
e) El semáforo E-O estará en luz verde cuando no haya vehículos
transitando

A B C D N-S E-O

0 0 0 0 0 1

0 0 0 1 0 1

0 0 1 0 0 1

0 0 1 1 0 1

0 1 0 0 1 0

0 1 0 1 0 0

0 1 1 0 0 0

0 1 1 1 0 1

1 0 0 0 1 0

1 0 0 1 0 0

1 0 1 0 0 0

1 0 1 1 0 1

1 1 0 0 1 0

1 1 0 1 0 0

1 1 1 0 0 0

1 1 1 1 0 1
TABLA DE VERDAD PARA EL SEMÁFORO N-S

N-S = BC'D' + AC'D'


TABLA DE VERDAD PARA EL SEMÁFORO E-O

E-O = A'B' + CD
ESTRUCTURAL

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY ESTRUCTURAL IS
PORT(
C : IN STD_LOGIC_VECTOR (3 DOWNTO 0);--Sensor Carro
SEM: OUT STD_LOGIC_VECTOR (1 DOWNTO 0);--Semaforo
END comportamental;

ARCHITECTURE carro OF ESTRUCTURALIS

A=3 B=2 C=1 D=0


NS<= ((C(2)) and ( not C(1)) and ( not C(0))) or ((C(3)) and (not
C(1)) and (not C(0)))
EO<= ((not C(3)) and (not C(2))) or ((C(1)) and (C(0)))
COMPORTAMENTAL

END carro;

------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

ENTITY comportamental IS
PORT(
C : IN STD_LOGIC_VECTOR (3 DOWNTO 0);--Sensor Carro
SEM: OUT STD_LOGIC_VECTOR (1 DOWNTO 0);--Semaforo
END comportamental;

ARCHITECTURE carro OF comportamental IS


PROCESS(C) IS
begin

--primera condición
if (C(1)='1' and C(0)='1')then --C Y D encendidos
SEM(0)<='0' --SEM(2) es el semáforo N-S
SEM(1)<='1' --SEM(1) es el semáforo E-O
ELSIF ((C(1)='1') OR (C(0)='1')) and (C(2)='0' AND
C(3)='0'))then -- C o D están encendidos pero A y B
apagados
SEM(0)<='0' --SEM(2) es el semáforo N-S
SEM(1)<='1' --SEM(1) es el semáforo E-O
ELSIF ((C(3)='1' and C(4)='1') and (C(1)='0' and
C(0)='0')then
SEM(0)<='1' --SEM(2) es el semáforo N-S
SEM(1)<='0' --SEM(1) es el semáforo E-O
ELSIF ((C(3)='1' or C(4)='1') and (C(1)='0' and
C(0)='0')then
SEM(0)<='1' --SEM(2) es el semáforo N-S
SEM(1)<='0' --SEM(1) es el semáforo E-O
ELSIF ((C(3)='0' and C(4)='0' and (C(1)='0' and
C(0)='0')then
SEM(0)<='0' --SEM(2) es el semáforo N-S
SEM(1)<='1' --SEM(1) es el semáforo E-O
ELSE
SEM(0)<='0' --SEM(2) es el semáforo N-S
SEM(1)<='0' --SEM(1) es el semáforo E-O
END IF

END PROCESS​;
END carro;

3)

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity Top is
Port ( W: in STD_LOGIC;
X: in STD_LOGIC_VECTOR(1 downto 0);
Y,Z : in STD_LOGIC_VECTOR(2 downto 0);
BCD: out STD_LOGIC_VECTOR(3 downto 0);
Signal4 : out STD_LOGIC);
end Top;

architecture Behavioral of Top is

signal xu,yu,zu,wu: std_logic_vector(3 downto 0);


signal total: unsigned(3 downto 0);

begin

xu <= "0001" when x = "01" else "0010" when x ="10" else "0000";
yu <= "0001" when y = "001" else "0010" when y = "010" else "0011"
when y="100" else "0000";

Zu <= "0001" when z = "001" else "0010" when z = "010" else "0011"
when z="100" else "0000";

Wu <= "0001" when w = '1' else "0000";

total <= unsigned(xu) + unsigned(yu) + unsigned(zu) +


unsigned(wu);

BCD <=STD_LOGIC_VECTOR(total);
signal4 <= '1' when total > 4 else '0';

end Behavioral;
4)
a) 9 bits
b) respuesta es 38
c) 7 bits
d) ninguna de las anteriores y pues realmente por
simplificación sale con un sola compuerta xor de dos entradas,
concretamente

A’B’C+ABC’+A’BC’+A’B’C = B xor C
e) a=6, b=-2
5)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Sumador is
Port ( a,b : in STD_LOGIC_VECTOR(2 downto 0);
Sel : in STD_LOGIC;
Dout : out STD_LOGIC_VECTOR(6 downto 0);
Dig : in STD_LOGIC_VECTOR(1 downto 0));
end Sumador;

architecture Behavioral of Sumador is

COMPONENT sumador
port(
d0: in STD_LOGIC_VECTOR(2 downto 0);
d1: in STD_LOGIC_VECTOR(2 downto 0);
A1: out STD_LOGIC_VECTOR(3 downto 0);
A2: out STD_LOGIC_VECTOR(3 downto 0)
);
End component;

COMPONENT MUX2_1
port(
D0: in STD_LOGIC_VECTOR(2 downto 0);
D1: in STD_LOGIC_VECTOR(2 downto 0);
SEL: in STD_LOGIC;
A2: out STD_LOGIC_VECTOR(3 downto 0)
);
End component;
COMPONENT DEC_BCD_7seg
port(
n: in STD_LOGIC_VECTOR(3 downto 0);
seg: out STD_LOGIC_VECTOR(6 downto 0)
);
End component;

COMPONENT DEC2_1
port(
Din: in STD_LOGIC;
sal: out STD_LOGIC_vector(1 downto 0) );
End component;

signal sa1,sa2, ss: std_logic_vector(3 downto 0);

begin

inst_sumador: sumador port map(


d0=> a,
d1=> b,
A1=> sa1,
A2=> sa2);

inst_Mux2_1: Mux2_1 port map(


D0 => sa1,
D1 => sa2,
Sel => sel,
s => ss);
inst_DEC_BCD_7SEG: DEC_BCD_7SEG port map(
n => ss,
seg => dout);
inst_DEC2_1: DEC2_1 port map(
din=>sel,
sal=>dig);
end Behavioral;

También podría gustarte