Tuesday 8 February 2011

VHDL code for D-Flip Flop

RELATED POSTS:

1.VHDL code for 2 to 4 binary decoder

2.VHDL code for 4 bit comparator

______________________________________________________________________________________________

 

Here is the VHDL coding of the d-flip flop :

LIBRARY ieee ;

USE ieee.std_logic_1164.all ;

ENTITY flipflop IS
PORT (     D, Resetn, Clock     : IN     STD_LOGIC ;
Q                     : OUT     STD_LOGIC) ;
END flipflop ;

ARCHITECTURE Behavior OF flipflop IS
BEGIN
PROCESS
BEGIN
WAIT UNTIL Clock'EVENT AND Clock = '1' ;
IF Resetn = '0' THEN
Q <= '0' ;
ELSE
Q <= D ;
END IF ;
END PROCESS ;
END Behavior ;

13 comments:

  1. Thanks for the tutorial, but i need to desig a 8x Edge-triggered LATCH, Tri-state (74374) in VHDL code.
    Please some can help me with this.
    Thanks,
    leonel (lntechnology@juno.com)

    ReplyDelete
  2. plz put the vhdl code for d fliop flop with DATAFLOW,STRUCTURAL MODELS....... PLZZZZZ...

    ReplyDelete
  3. Sure sarath soon i will be updating on them...thanks for your suggestion..:)

    ReplyDelete
  4. Do you know the code for a d flip-flop WITHOUT using a process, I'm stuck with that, BTW I made a d latch and I HAVE TO use the d latch as a component in the d flip-flop, but I don't know how (it's supposed to be like 5 lines of code in the architecture using the latch component made earlier). If you find the time to answer me, a student will be saved :D

    Thanks, Pat

    ReplyDelete
  5. Hello Patrick,
    I will soon provide you the code, am working on it and after a successful stimulation i will post it here.Be in touch.

    ReplyDelete
  6. neeshakumari sinha12 February 2012 at 06:12

    may i know the VHDL code for a 4bit barrel shifter

    ReplyDelete
  7. neeshakumari sinha12 February 2012 at 06:14

    may i know the VHDL code for a 4 bit barrel shifter

    ReplyDelete
  8. VHDL CODE FOR DFF USING SEQUENTIAL STATEMENTS PLS

    ReplyDelete
  9. simple, perfect ,thank u sir

    ReplyDelete
  10. In Dec 2012 B.E vtu exam for 2002 scheme the question was a DDFF (flip-flop) is similar to a D flip-flop, except that the flip-flop can change state (Q+=D) on both rising edge and falling edge of the clock input.The flip-flop has direct reset input R, and R=0 resets the flip-flop to Q=0 independent of the clock. Write a VHDL description of a D flip-flop? Please provide me the answer as soon as u could.

    ReplyDelete
  11. i want 2 know the vhdl code in structural modeling of clock diver circuit which divide input clock in 8 clock signal of different frequency .pls favour me ..n my id is ayuagrawal03@gmail.com pls rply

    ReplyDelete
  12. CAN U TELL ME the vhdl code for structural modeling of clock divider circuit which divide input clock of 10khz in 8 clk signal having different frequency.i.e. clk1 =200 hz, clk2 =4oo hz,clk3=250hz, clk4=500hz, clk5=625hz, clk6=2 khz, clk7= 4 khz, clk8=5 khz

    ReplyDelete