Escolar Documentos
Profissional Documentos
Cultura Documentos
2MV6
Práctica 6
Flip-Flops
Integrantes:
Montoya Gonzalez Bryan
Navarro Urrutia Mauricio Naim
Velázquez Domínguez Jose Luis
Salazar Tavares Alan Efren
Unidad de Aprendizaje
Circuitos Lógicos
Profesor: Trejo Salazar David Benjamin
Introducción:
Un flip-flop, también conocido en español como dispositivo biestable, es un
circuito de tipo multivibrador y secuencial que puede adquirir dos estados de
manera indefinida, a menos que se perturba de alguna manera dicho circuito. Es
un dispositivo ampliamente usado en el almacenaje de datos e información en
artículos digitales y electrónicos.
Clasificación de los flip flop
Los flip-flop se clasifican según las entradas que poseen, pudiendo ser:
● Síncronos: Poseen entradas de control, pero además tienen incluido un
sistema de reloj o algún tipo de mecanismo o dispositivo para rotar los
estados o temporizarlo.
● Asíncronos: Este tipo de biestable solo posee entradas de control.
Tipos de flip flop
Códigos:
6.1
library ieee;
use ieee. std_logic_1164.all;
use ieee. std_logic_arith.all;
use ieee. std_logic_unsigned.all;
entity P6 is
PORT( S,R,clk: in std_logic;
Q, QBAR, QD, QJK, QBJK, QT, Salida: out std_logic);
end P6;
Architecture behavioral of P6 is
signal SalidaAux : std_logic;
signal tmpT: std_logic;
signal Cuenta : integer range 0 to 24999999:= 0;
begin
PROCESS(clk)
variable tmpRS,tmpD,tmpJK: std_logic;
begin
if rising_edge(clk) then
if Cuenta = 24999999 then
Cuenta<=0;
SalidaAux<= not SalidaAux;
else
if(S='0' and R='0')then
tmpRS:=tmpRS;
elsif(S='1' and R='1')then
tmpRS:='Z';
elsif(S='0' and R='1')then
tmpRS:='0';
else
tmpRS:='1';
end if;
Q <= tmpRS;
QBAR <= not tmpRS;
QD <= S;
QJK <=tmpJK;
QBJK <=not tmpJK;
if S='0' then
tmpT <= tmpT;
elsif S='1' then
tmpT <= not (tmpT);
end if;
QT <= tmpT;
end if;
else
Cuenta <= Cuenta+1;
end if;
end if;
end PROCESS;
Salida<=SalidaAux;
end behavioral;
6.2
library ieee;
use ieee. std_logic_1164.all;
use ieee. std_logic_arith.all;
use ieee. std_logic_unsigned.all;
entity P6 is
PORT( S,R,clk: in std_logic;
SalidaDisplay: out std_logic_vector(6 downto 0);
Salida, Salida2, Act1, Act2: out std_logic);
end P6;
Architecture behavioral of P6 is
signal SalidaAux : std_logic;
signal SalidaAux2 : std_logic;
signal Act11 : std_logic;
signal Act22 : std_logic;
signal tmpT: std_logic;
signal Cuenta : integer range 0 to 24999999:= 0;
signal Cuenta4 : integer range 0 to 14999999:= 0;
signal Cuenta2 : integer range 0 to 10:= 0;
signal Cuenta3 : integer range 0 to 10:= 0;
Signal Cuenta5 : integer range 0 to 10:= 0;
begin
PROCESS(clk)
begin
if rising_edge(clk) then
if Cuenta = 6999999 then
Cuenta<=0;
SalidaAux<= not SalidaAux;
if cuenta2 = 10 then
cuenta3 <= cuenta3+1;
Cuenta2 <=0;
else
Cuenta <= Cuenta+1;
end if;
case Cuenta5 is
when 0 =>
SalidaDisplay <= "0111111";
when 1 =>
SalidaDisplay <= "0000110";
when 2 =>
SalidaDisplay <= "1011011";
when 3 =>
SalidaDisplay <= "1001111";
when 4 =>
SalidaDisplay <= "1100110";
when 5 =>
SalidaDisplay <= "1101101";
when 6 =>
SalidaDisplay <= "1111101";
when 7 =>
SalidaDisplay <= "0000111";
when 8 =>
SalidaDisplay <= "1111111";
when 9 =>
SalidaDisplay <= "1101111";
when 10 =>
SalidaDisplay <= "0111111";
end case;
end if;
else
Cuenta4 <= Cuenta4+1;
end if;
end if;
end PROCESS;
Salida<=SalidaAux;
Salida2<=SalidaAux2;
act1<=act11;
act2<=act22;
end behavioral;
6.3
library ieee;
use ieee.std_logic_1164.all;
entity P5 is
port (
Reloj : in std_logic;
Reset : in std_logic;
Velocidad : in std_logic;
Salida : inout std_logic;
Semaforo1 : out std_logic_vector(2 downto 0);
Semaforo2 : out std_logic_vector(2 downto 0)
);
end P5;
architecture P55 of P5 is
begin
Divisor : process(Reloj, Reset, Velocidad) is
variable i : integer := 1;
variable a : integer := 1;
begin
if Velocidad='0' then
a := 1;
else
a := 2;
end if;
if rising_edge(Reloj) then
if Cuenta = 24999999 then
Cuenta<=0;
SalidaAux<= not SalidaAux;
i :=1;
if SalidaAux = '1' then
Aux<=Aux+1;
if Aux = 16/a then
Aux <= 1;
end if;
else
if Aux <=6/a then
Semaforo1 <= "001";
Semaforo2 <= "100";
elsif Aux >= 6/a and Aux <= 8/a then
Semaforo1 <= "010";
elsif Aux >= 8/a and Aux <= 14/a then
Semaforo1 <= "100";
Semaforo2 <= "001";
elsif Aux > 14/a
then
Semaforo2 <= "010";
else
Semaforo1 <= "000";
end if;
end if;
else
Cuenta <= Cuenta+1;
end if;
end if;
end process;
Salida<=SalidaAux;
end P55;
Conclusiones:
Montoya González Bryan:
Con la realización de esta práctica aprendimos más sobre el uso de los flip flop
hasta poder armar un circuito contador ascendente y descendente
basándonos en lo aprendido en los temas anteriores. La realización de esta
práctica fue de gran ayuda ya que con esto podemos combinar los demás temas
aprendidos cómo son los programas utilizados anteriormente realizando
pequeños cambios o implementaciones y el 555 en una sola práctica.