Tarea 1 Flip Flops Bojorquez 5EB

Descargar como docx, pdf o txt
Descargar como docx, pdf o txt
Está en la página 1de 13

INSTITUTO TECNOLOGICO DE

MERIDA

------- Diseño Digital con VHDL -----------

------- Tarea 1: Flip Flops -----------

------- Mtro. Freddy Antonio Ix Andrade -----------

------- Ingeniería Electrónica -----------

------- 5 Semestre -----------


5EB

------- Br. José Moisés Bojórquez Rodríguez -----------

Matricula E18080939

LE18080939@merida.tecnm.mx

------- Fecha de entrega: 19 de octubre de 2020 -----------


Flip Flop D
El "flip-flop" tipo D, sigue a la entrada, haciendo transiciones que coinciden con las
de la entrada. El término "D", significa dato; este "flip-flop" almacena el valor que
está en la línea de datos. Se puede considerar como una celda básica de
memoria. Un "flip-flop" D, se puede hacer con un "flip-flop" "set/reset", uniendo la
salida set (estado alto) con la salida reset (estado bajo), a través de un inversor. El
resultado se puede sincronizar.
Para el código del flip flop D tenemos:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity ffd is
port (clk, RESET, EN, D: in std_logic;
Q: inout std_logic);
end ffd;

architecture a_ffd of ffd is


signal q_aux:std_logic;
begin
process (clk, RESET, EN)
begin
if (reset = '1') then
q_aux<='0';
elsif (clk' event and clk = '1') then
if (EN='1') then
q_aux <= D;
else
q_aux <= q;
end if;
end if;
end process;
q <= q_aux;
end a_ffd;

Tenemos 3 entradas que son el enable, data y el reset, sin contar el clk que esta con el
reloj de la placa y nuestra salida Q

Nuestras constraints para la placa quedarían de la siguiente manera:


set_property PACKAGE_PIN E3 [get_ports clk]
set_property PACKAGE_PIN J15 [get_ports D]
set_property PACKAGE_PIN L16 [get_ports EN]
set_property PACKAGE_PIN H17 [get_ports Q]
set_property PACKAGE_PIN V10 [get_ports RESET]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports D]
set_property IOSTANDARD LVCMOS33 [get_ports EN]
set_property IOSTANDARD LVCMOS33 [get_ports RESET]
set_property IOSTANDARD LVCMOS33 [get_ports Q]
Lo siguiente seria la implementación en la placa nexys a7

Podemos ver el enable activado y el data en 1, la salida Q es 1


Desactivando el enable, el data se guarda hasta resetearlo o volver a activar el enable

Se activa el reset.

Flip Flop SR
El flip-flop tiene dos entradas R (reset) y S (set), se encuentran a la izquierda del
símbolo. Este flip-flop tiene activas las entradas en el nivel BAJO, lo cual se indica
por los circulitos de las entradas R y S. Los flip-flop tienen dos salidas
complementarias, que se denominan Q y 1, la salida Q es la salida normal y 1 = 0.
Código:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

library ieee;
use ieee.std_logic_1164.all;
entity ffsr is port (
S, R, clk: in std_logic;
Q, Qn: inout std_logic);
end ffsr;

architecture a_ffsr of ffsr is


begin
process (clk, S, R)
begin
if (clk' event and clk = '1') then
if (S = '0' and R= '1') then
Q <= '0';
Qn <= '1';
elsif (S = '1' and R = '0') then
Q <= '1';
Qn <= '0';
elsif (S = '0' and R='0') then
Q <= Q;
Qn <= Qn;
else
Qn <= '-';
end if;
end if;
end process;
end a_ffsr;
Los constraints quedarían:
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports Q]
set_property IOSTANDARD LVCMOS33 [get_ports Qn]
set_property IOSTANDARD LVCMOS33 [get_ports R]
set_property IOSTANDARD LVCMOS33 [get_ports S]
set_property PACKAGE_PIN E3 [get_ports clk]
set_property PACKAGE_PIN H17 [get_ports Q]
set_property PACKAGE_PIN K15 [get_ports Qn]
set_property PACKAGE_PIN L16 [get_ports R]
set_property PACKAGE_PIN J15 [get_ports S]
Flip Flop JK
Este flip-flop se denomina como "universal" ya que los demás tipos se pueden
construir a partir de él. En el símbolo anterior hay tres entradas síncronas (J, K y
CLK). Las entradas J y K son entradas de datos, y la entrada de reloj transfiere el
dato de las entradas a las salidas.
Código:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;

entity ffjk is
port( J,K: in std_logic;
Reset: in std_logic;
Clock_enable: in std_logic;
Clock: in std_logic;
Output: out std_logic);
end ffjk;

architecture a_ffjk of ffjk is


signal temp: std_logic;
begin
process (Clock)
begin
if rising_edge(Clock) then
if Reset='1' then
temp <= '0';
elsif Clock_enable ='1' then
if (J='0' and K='0') then
temp <= temp;
elsif (J='0' and K='1') then
temp <= '0';
elsif (J='1' and K='0') then
temp <= '1';
elsif (J='1' and K='1') then
temp <= not (temp);
end if;
end if;
end if;
end process;
Output <= temp;
end a_ffjk;
Los constraints:
set_property PACKAGE_PIN E3 [get_ports Clock]
set_property PACKAGE_PIN M13 [get_ports Clock_enable]
set_property PACKAGE_PIN L16 [get_ports J]
set_property PACKAGE_PIN J15 [get_ports K]
set_property PACKAGE_PIN H17 [get_ports Output]
set_property PACKAGE_PIN V10 [get_ports Reset]
set_property IOSTANDARD LVCMOS33 [get_ports Clock]
set_property IOSTANDARD LVCMOS33 [get_ports Clock_enable]
set_property IOSTANDARD LVCMOS33 [get_ports J]
set_property IOSTANDARD LVCMOS33 [get_ports K]
set_property IOSTANDARD LVCMOS33 [get_ports Output]
set_property IOSTANDARD LVCMOS33 [get_ports Reset]
Flip Flop T
El comportamiento de un flip-flop tipo T es equivalente al de un flip-flop tipo J-K
con sus entradas J y K unidas. De este Modo, si la entrada T presenta un nivel
bajo ‘0’ el dispositivo está en su modo de memoria, y si a la entrada T se
encuentra a nivel alto ‘1’ el dispositivo cambia de estado, es decir la salida
bascula.
Código:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity fft is
port (T,Reset,CLK,CLK_enable: in std_logic;
Q: out std_logic);
end fft;
architecture a_fft of fft is

begin
process (Reset,CLK)
variable temp: std_logic;
begin
if (rising_edge(CLK)) then
if Reset='1' then
temp := '0';
elsif CLK_enable ='1' then
temp := T xor temp;
end if;
end if;
Q <= temp;
end process;
end a_fft;
Los constraints:
set_property IOSTANDARD LVCMOS33 [get_ports CLK]
set_property IOSTANDARD LVCMOS33 [get_ports Q]
set_property IOSTANDARD LVCMOS33 [get_ports CLK_enable]
set_property IOSTANDARD LVCMOS33 [get_ports Reset]
set_property IOSTANDARD LVCMOS33 [get_ports T]
set_property PACKAGE_PIN E3 [get_ports CLK]
set_property PACKAGE_PIN L16 [get_ports CLK_enable]
set_property PACKAGE_PIN H17 [get_ports Q]
set_property PACKAGE_PIN V10 [get_ports Reset]
set_property PACKAGE_PIN J15 [get_ports T]

También podría gustarte

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy