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

State Machines<br />

Following is the Verilog code for a multiple-port RAM.<br />

module raminfr<br />

(clk, we, wa, ra1, ra2, di, do1, do2);<br />

input clk;<br />

input we;<br />

input [4:0] wa;<br />

input [4:0] ra1;<br />

input [4:0] ra2;<br />

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

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

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

reg [3:0] ram [31:0];<br />

always @(posedge clk) begin<br />

if (we)<br />

ram[wa]

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

Saved successfully!

Ooh no, something went wrong!