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

Sequential Always Blocks<br />

Sequential circuit description is based on always blocks with a<br />

sensitivity list.<br />

The sensitivity list contains a maximum of three edge-triggered<br />

events: the clock signal event (which is mandatory), possibly a reset<br />

signal event, and a set signal event. One, and only one "If...else"<br />

statement is accepted in such an always block.<br />

An asynchronous part may appear before the synchronous part in the<br />

first and the second branch of the "If...else" statement. Signals<br />

assigned in the asynchronous part must be assigned to the constant<br />

values ’0’, ’1’, ’X’ or ’Z’ or any vector composed of these values.<br />

These same signals must also be assigned in the synchronous part<br />

(that is, the last branch of the "if-else" statement). The clock signal<br />

condition is the condition of the last branch of the "if-else" statement.<br />

The following example gives the description of an 8-bit register.<br />

Example 7-6 8 Bit Register Using an Always Block<br />

module seq1 (DI, CLK, DO);<br />

input [7:0] DI;<br />

input CLK;<br />

output [7:0] DO;<br />

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

always @(posedge CLK)<br />

DO = DI ;<br />

endmodule<br />

The following example gives the description of an 8-bit register with<br />

a clock signal and an asynchronous reset signal.<br />

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

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

Saved successfully!

Ooh no, something went wrong!