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

Latches<br />

Verilog Code<br />

Following is the equivalent Verilog code for a 4-bit register with a<br />

positive-edge clock, asynchronous set and clock enable.<br />

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

input C, CE, PRE;<br />

input [3:0] D;<br />

output [3:0] Q;<br />

reg [3:0] Q;<br />

always @(posedge C or posedge PRE)<br />

begin<br />

if (PRE)<br />

Q = 4'b1111;<br />

else<br />

if (CE)<br />

Q = D;<br />

end<br />

endmodule<br />

XST is able to recognize latches with the asynchronous set/clear<br />

control signals.<br />

Latches can be described using:<br />

• Process (VHDL) and always block (Verilog)<br />

• Concurrent state assignment<br />

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

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

Saved successfully!

Ooh no, something went wrong!