05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

XST <strong>User</strong> <strong>Guide</strong><br />

Note When using VHDL, for a positive-edge clock instead of using<br />

if (C’event and C=’1’) then<br />

you can also use<br />

if (rising_edge(C)) then<br />

and for a negative-edge clock you can use<br />

if (falling_edge(C)) then<br />

or<br />

C’event and C=’0’<br />

Verilog Code<br />

Following is the equivalent Verilog code sample for the flip-flop with<br />

a positive-edge clock.<br />

module flop (C, D, Q);<br />

input C, D;<br />

output Q;<br />

reg Q;<br />

always @(posedge C)<br />

begin<br />

Q = D;<br />

end<br />

endmodule<br />

Flip-flop with Negative-Edge Clock and<br />

Asynchronous Clear<br />

The following figure shows a flip-flop with negative-edge clock and<br />

asynchronous clear.<br />

D<br />

C<br />

CLR<br />

FDC_1<br />

Q<br />

X3847<br />

2-16 <strong>Xilinx</strong> Development System

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!