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.

HDL Coding Techniques<br />

Verilog<br />

The following template shows the recommended configuration<br />

coded in Verilog.<br />

module raminfr (clk, we, en, addr, di, do);<br />

input clk;<br />

input we;<br />

input en;<br />

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

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

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

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

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

always @(posedge clk)<br />

begin<br />

if (en)<br />

begin<br />

if (we)<br />

begin<br />

RAM[addr]

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

Saved successfully!

Ooh no, something went wrong!