FPGA projects, Verilog projects, VHDL projects

VHDL code for D Flip Flop

VHDL code for D Flip Flop is presented in this project. Verilog code for D Flip Flop here. There are several types of D Flip Flops such as high-level asynchronous reset D Flip-Flop, low-level asynchronous reset D Flip-Flop, synchronous reset D-Flip-Flop, rising edge D Flip-Flop, falling edge D Flip-Flop, which is implemented in VHDL in this VHDL project.

VHDL code for D Flip Flop


VHDL code for Rising Edge D Flip Flop:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for rising edge D flip flop 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity RisingEdge_DFlipFlop is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;   
      D :in  std_logic    
   );
end RisingEdge_DFlipFlop;
architecture Behavioral of RisingEdge_DFlipFlop is  
begin  
 process(Clk)
 begin 
    if(rising_edge(Clk)) then
   Q <= D; 
    end if;       
 end process;  
end Behavioral; 

VHDL code for Rising Edge D Flip-Flop with Synchronous Reset:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Rising edge D flip flop with Synchronous Reset input 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity RisingEdge_DFlipFlop_SyncReset is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end RisingEdge_DFlipFlop_SyncReset;
architecture Behavioral of RisingEdge_DFlipFlop_SyncReset is  
begin  
 process(Clk)
 begin 
    if(rising_edge(Clk)) then
   if(sync_reset='1') then 
    Q <= '0';
   else 
    Q <= D; 
   end if;
    end if;       
 end process;  
end Behavioral; 

VHDL code for Rising Edge D Flip-Flop with Asynchronous Reset High Level:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Rising edge D flip flop with Asynchronous Reset high
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity RisingEdge_DFlipFlop_AsyncResetHigh is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end RisingEdge_DFlipFlop_AsyncResetHigh;
architecture Behavioral of RisingEdge_DFlipFlop_AsyncResetHigh is  
begin  
 process(Clk,sync_reset)
 begin 
     if(sync_reset='1') then 
   Q <= '0';
     elsif(rising_edge(Clk)) then
   Q <= D; 
  end if;      
 end process;  
end Behavioral; 

VHDL code for Rising Edge D Flip-Flop with Asynchronous Reset Low Level:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Rising edge D flip flop with Asynchronous Reset low 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity RisingEdge_DFlipFlop_AsyncResetLow is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end RisingEdge_DFlipFlop_AsyncResetLow;
architecture Behavioral of RisingEdge_DFlipFlop_AsyncResetLow is  
begin  
 process(Clk,sync_reset)
 begin 
     if(sync_reset='0') then 
   Q <= '0';
     elsif(rising_edge(Clk)) then
   Q <= D; 
  end if;      
 end process;  
end Behavioral; 

VHDL code for Falling Edge D Flip Flop:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for falling edge D flip flop 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity FallingEdge_DFlipFlop is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;   
      D :in  std_logic    
   );
end FallingEdge_DFlipFlop;
architecture Behavioral of FallingEdge_DFlipFlop is  
begin  
 process(Clk)
 begin 
    if(falling_edge(Clk)) then
   Q <= D; 
    end if;       
 end process;  
end Behavioral; 

VHDL code for Falling Edge D Flip-Flop with Synchronous Reset:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Falling edge D flip flop with Synchronous Reset input 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity FallingEdge_DFlipFlop_SyncReset is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end FallingEdge_DFlipFlop_SyncReset;
architecture Behavioral of FallingEdge_DFlipFlop_SyncReset is  
begin  
 process(Clk)
 begin 
    if(falling_edge(Clk)) then
   if(sync_reset='1') then 
    Q <= '0';
   else 
    Q <= D; 
   end if;
    end if;       
 end process;  

end Behavioral;

VHDL code for Falling Edge D Flip-Flop with Asynchronous Reset High Level:


-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Falling edge D flip flop with Asynchronous Reset high 
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity FallingEdge_DFlipFlop_AsyncResetHigh is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end FallingEdge_DFlipFlop_AsyncResetHigh;
architecture Behavioral of FallingEdge_DFlipFlop_AsyncResetHigh is  
begin  
 process(Clk,sync_reset)
 begin 
     if(sync_reset='1') then 
   Q <= '0';
     elsif(falling_edge(Clk)) then
   Q <= D; 
  end if;      
 end process;  
end Behavioral; 

VHDL code for Falling Edge D Flip-Flop with Asynchronous Reset Low Level:

-- FPGA projects using VHDL/ VHDL 
-- fpga4student.com
-- VHDL code for D Flip FLop
-- VHDL code for Falling edge D flip flop with Asynchronous Reset low  
Library IEEE;
USE IEEE.Std_logic_1164.all;

entity FallingEdge_DFlipFlop_AsyncResetLow is 
   port(
      Q : out std_logic;    
      Clk :in std_logic;  
   sync_reset: in std_logic;  
      D :in  std_logic    
   );
end FallingEdge_DFlipFlop_AsyncResetLow;
architecture Behavioral of FallingEdge_DFlipFlop_AsyncResetLow is  
begin  
 process(Clk,sync_reset)
 begin 
     if(sync_reset='0') then 
   Q <= '0';
     elsif(falling_edge(Clk)) then
   Q <= D; 
  end if;      
 end process;  
end Behavioral; 

Simulation waveform for D Flip-Flop:

VHDL code for D Flip Flop

This tutorial explains in detail the flip-flop schematic and how it worksHERE.
To understand more about setup and hold time of flip-flop, check it out HERE.
Recommended VHDL projects:
1. What is an FPGA? How VHDL works on FPGA
2. VHDL code for FIFO memory
3. VHDL code for FIR Filter
4. VHDL code for 8-bit Microcontroller
5. VHDL code for Matrix Multiplication
6. VHDL code for Switch Tail Ring Counter
7. VHDL code for digital alarm clock on FPGA
8. VHDL code for 8-bit Comparator
9. How to load a text file into FPGA using VHDL
10. VHDL code for D Flip Flop
11. VHDL code for Full Adder
12. PWM Generator in VHDL with Variable Duty Cycle
13. VHDL code for ALU
14. VHDL code for counters with testbench
15. VHDL code for 16-bit ALU
16. Shifter Design in VHDL
17. Non-linear Lookup Table Implementation in VHDL
18. Cryptographic Coprocessor Design in VHDL

19. Verilog vs VHDL: Explain by Examples
20. VHDL Code for Clock Divider on FPGA
21. How to generate a clock enable signal instead of creating another clock domain
22. VHDL code for debouncing buttons on FPGA
23. VHDL code for Traffic light controller
24. VHDL code for a simple 2-bit comparator
25. VHDL code for a single-port RAM
22. VHDL code for debouncing buttons on FPGA
23. VHDL code for Traffic light controller
24. VHDL code for a simple 2-bit comparator
25. VHDL code for a single-port RAM
26. VHDL code for Car Parking System using FSM
27. VHDL coding vs Software Programming
Verilog VHDL Tool

No comments:

Post a Comment