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 />

Verilog Code<br />

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

positive-edge clock and synchronous set.<br />

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

input C, D, S;<br />

output Q;<br />

reg Q;<br />

always @(posedge C)<br />

begin<br />

if (S)<br />

Q = 1’b1;<br />

else<br />

Q = D;<br />

end<br />

endmodule<br />

Flip-flop with Positive-Edge Clock and Clock Enable<br />

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

clock enable.<br />

D<br />

CE<br />

C<br />

FDE<br />

Q<br />

X8361<br />

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

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

Saved successfully!

Ooh no, something went wrong!