Académique Documents
Professionnel Documents
Culture Documents
1. TEMA
FLIP-FLOPS (MULTIVIBRADORES BIESTABLES)
2. OBJETIVOS
2.1. Afianzar los conocimientos en diseño de circuitos secuenciales usando flip-flops.
2.2. Creación de flip-flops mediante VHDL.
3. TRABAJO PREPARATORIO
3.1. Consultar la distribución de pines y la tabla de funcionamiento de los Circuitos
integrados: 7476, 74107, 74109, 74112.
7476:
Esta compuerta contiene 2 flip flop de tipo J-K independientes cada uno con J-K, reloj, preset y
borrado individuales. El Integrado cuenta con 16 Pines distribuidos de la siguiente manera:
Esta compuerta contiene 2 flip flop de tipo J-K independientes cada uno con J-K, reloj, y
borrado individuales. Este circuito no cuenta con el pin de preset. El Integrado cuenta con 14
Pines distribuidos de la siguiente manera:
74109:
Flip Flop Dual con disparo por flanco positivo con preset y clear.
Al igual que los anteriores contiene 2 flip-flops de tipo J-K con flanco positivo.
A nivel bajo en el preset o clear, se definen o borran las salidas sin importar el nivel de las otras
entradas. Tiene 16 Pines distribuidos de la siguiente manera:
Es un integrado que contiene dos flips flops de tipo J-K con la opción de borrado y preset.
Funciona a altas velocidades y bajo consumo de potencia con tecnología CMOS. Tiene alta
inmunidad al ruido, impedancias de salidas simétricas, retrasos balanceados, gran rango de
voltaje. El integrado tiene 16 pines distribuidos de la siguiente manera:
Su tabla de funcionamiento es la
siguiente:
3.3. Con el circuito integrado 7476, o algún equivalente, diseñar un flip – flop tipo D y
tipo T.
El integrado 7476 es un flip flop de tipo JK que posee la siguiente tabla de función:
J K Q
0 0 Qn
0 1 0
1 0 1
1 1 Qn’
Flip-Flop Tipo D
En el flip flop tipo T, en cambio:
T Q
0 Q
1 Q’
En este caso corresponde a los estados en los que J y K son iguales. Entonces:
Flip-Flop Tipo T
3.4. Con el circuito integrado 7476, o algún equivalente, en configuración de flip – flop
tipo J - K, diseñar un contador asincrónico ascendente según la siguiente tabla. Incluya
el circuito de borrado manual además presentarlo en display. Módulo 25
3.5. Elaborar código en VHDL que permita implementar un flip–flop S–R sincrónico.
Código en VHDL (arquitectura funcional)
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity FFSRS2 is
port
(
S, R, CLK: IN STD_LOGIC;
Q: OUT STD_LOGIC;
Qc: OUT STD_LOGIC
);
end FFSRS2;
Test Bench:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity FFSRS2_tb is
end FFSRS2_tb;
signal S, R, Q, Qc : STD_LOGIC;
signal clk: STD_LOGIC:= '1';
constant num_ciclos: INTEGER:= 1;
begin
process
begin
for i in 1 to num_ciclos loop
clk <= not clk;
wait for 1 ns;
clk <= not clk;
wait for 4 ns;
end loop;
wait;
end process;
flipflop: FFSRS2
port map
(
S => S,
R => R,
CLK => clk,
Q => Q,
Qc => Qc
);
process
begin
S <= '0';
R <= '0';
wait for 1 ns;
S <= '0';
R <= '0';
wait for 1 ns;
S <= '0';
R <= '1';
wait for 1 ns;
S <= '1';
R <= '0';
wait for 1 ns;
S <= '1';
R <= '1';
wait for 1 ns;
Resultado en GTKWave:
3.6. Elaborar código en VHDL que permita implementar un flip–flop JK con PRESET
y CLEAR.
Código en VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity FFJK is
port
(
J, K, CLK, PR, CLR: IN STD_LOGIC;
Q: INOUT STD_LOGIC;
Qc: INOUT STD_LOGIC
);
end FFJK;
Test Bench:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity FFJK_tb is
end FFJK_tb;
begin
process
begin
for i in 1 to num_ciclos loop
clk <= not clk;
wait for 0.5 ns;
clk <= not clk;
wait for 0.5 ns;
end loop;
wait;
end process;
flipflop: FFJK
port map
(
J => J,
K => K,
PR => PR,
CLR => CLR,
CLK => clk,
Q => Q,
Qc => Qc
);
process
begin
PR <= '0';
CLR <= '0';
J <= '0';
K <= '0';
wait for 1 ns;
PR <= '0';
CLR <= '0';
J <= '0';
K <= '1';
wait for 1 ns;
PR <= '0';
CLR <= '0';
J <= '1';
K <= '0';
wait for 1 ns;
PR <= '0';
CLR <= '0';
J <= '1';
K <= '1';
wait for 1 ns;
PR <= '1';
CLR <= '0';
J <= '1';
K <= '1';
wait for 1 ns;
PR <= '0';
CLR <= '1';
J <= '0';
K <= '0';
wait for 1 ns;
PR <= '1';
CLR <= '1';
J <= '1';
K <= '1';
wait for 1 ns;
PR <= '0';
CLR <= '1';
J <= '-';
K <= '-';
wait for 1 ns;
assert false report "Fin de la prueba";
wait;
end process;
end prueba;
Prueba en GTKWave
Figura 6. Prueba del FlipFlop J-K. Cuando preset y clear son 1 se obtiene una señal indeterminada X.
entity FFD is
port
(
D, CLK, PR, CLR: IN STD_LOGIC;
Q: INOUT STD_LOGIC;
Qc: INOUT STD_LOGIC
);
end FFD;
begin
Dc <= not D;
flipflopd: FFJK
port map (
J => D,
K => Dc,
CLK => CLK,
PR => PR,
CLR => CLR,
Q => Q,
Qc => Qc
);
end estructural;
entity FFT is
port
(
T, CLK, PR, CLR: IN STD_LOGIC;
Q: INOUT STD_LOGIC;
Qc: INOUT STD_LOGIC
);
end FFT;
begin
flipflopd: FFJK
port map (
J => T,
K => T,
CLK => CLK,
PR => PR,
CLR => CLR,
Q => Q,
Qc => Qc
);
end estructural;
entity FFDyT_tb is
end FFDyT_tb;
component FFT
port(
T, CLK, PR, CLR: IN STD_LOGIC;
Q: INOUT STD_LOGIC;
Qc: INOUT STD_LOGIC
);
end component;
begin
process
begin
for i in 1 to num_ciclos loop
clk <= not clk;
wait for 0.5 ns;
clk <= not clk;
wait for 0.5 ns;
end loop;
wait;
end process;
flipflop1: FFD
port map
(
D => D,
PR => PR,
CLR => CLR,
CLK => clk,
Q => Q1,
Qc => Qc1
);
flipflop2: FFT
port map
(
T => T,
PR => PR,
CLR => CLR,
CLK => clk,
Q => Q2,
Qc => Qc2
);
process
begin
PR <= '0';
CLR <= '1';
D <= '0';
T <= '0';
wait for 1 ns;
PR <= '0';
CLR <= '0';
D <= '0';
T <= '0';
wait for 1 ns;
D <= '1';
T <= '1';
wait for 1 ns;
assert false report "Fin de la prueba";
wait;
end process;
end prueba;
Resultados en GTKWave:
3.8. Realizar el código VHDL necesario para implementar un contador ascendente del
módulo indicado en la siguiente tabla. Módulo 513
Código en VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
entity contadorascendente is
port
(
CLK: IN STD_LOGIC;
NUM: OUT UNSIGNED(6 downto 0)
);
end contadorascendente;
Test Bench:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
entity contadorascendente_tb is
end contadorascendente_tb;
begin
process
begin
for i in 1 to num_ciclos loop
clk <= not clk;
wait for 1 ns;
clk <= not clk;
wait for 1 ns;
end loop;
wait;
end process;
contador: contadorascendente
port map(
CLK => clk,
NUM => NUM
);
end prueba;
Prueba en GTKWave:
Figura 8. Prueba del contador, se muestran los números hasta el 512 y luego regresa a 0.
3.9. Realizar el código VHDL necesario para implementar un contador descendente del
módulo indicado en la siguiente tabla. Módulo 385
Código en VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
entity contadordescendente is
port
(
CLK: IN STD_LOGIC;
NUM: OUT UNSIGNED(7 downto 0)
);
end contadordescendente;
Test Bench:
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
entity contadordescendente_tb is
end contadordescendente_tb;
begin
process
begin
for i in 1 to num_ciclos loop
clk <= not clk;
wait for 1 ns;
clk <= not clk;
wait for 1 ns;
end loop;
wait;
end process;
contador: contadordescendente
port map(
CLK => clk,
NUM => NUM
);
end prueba;
Resultados en GTKWave:
Referencias:
[1] TOCCI/WIDMER/MOSS. “Sistemas Digitales. Principios y Aplicaciones”. Prentice
Hall. 10ma. Edición. 2007.
[2] NOVILLO CARLOS A., "Sistemas Digitales" Quito, Escuela Politécnica Nacional,
2010.
[3] MAXIMEZ DAVID, “VHDL El arte de programar sistemas digitales”, Editorial
Continental, 2002.
[4] http://fourier.eng.hmc.edu/e85_old/lectures/digital_logic/node16.html