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 an 8-bit shift-left register with a<br />

positive-edge clock, asynchronous clear, serial in, and serial out.<br />

module shift (C, CLR, SI, SO);<br />

input C,SI,CLR;<br />

output SO;<br />

reg [7:0] tmp;<br />

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

begin<br />

if (CLR)<br />

tmp = 8'b00000000;<br />

else<br />

begin<br />

tmp = {tmp[6:0], SI};<br />

end<br />

end<br />

assign SO = tmp[7];<br />

endmodule<br />

8-bit Shift-Left Register with Positive-Edge Clock,<br />

Synchronous Set, Serial In, and Serial Out<br />

Note Because this example includes an asynchronous clear XST will<br />

not infer SRL16.<br />

The following table shows pin definitions for an 8-bit shift-left<br />

register with a positive-edge clock, synchronous set, serial in, and<br />

serial out.<br />

IO Pins Description<br />

C Positive-Edge Clock<br />

SI Serial In<br />

S Synchronous Set (active High)<br />

SO Serial Output<br />

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

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

Saved successfully!

Ooh no, something went wrong!