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 Verilog code for a 4-bit signed up counter with<br />

asynchronous reset.<br />

module counter (C, CLR, Q);<br />

input C, CLR;<br />

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

reg signed [3:0] tmp;<br />

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

begin<br />

if (CLR)<br />

tmp

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

Saved successfully!

Ooh no, something went wrong!