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.

Verilog<br />

Logical Shifters<br />

HDL Coding Techniques<br />

Following is the Verilog code for a 3-bit 1-of-9 Priority Encoder.<br />

module priority (sel, code);<br />

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

output [2:0] code;<br />

reg [2:0] code;<br />

always @(sel)<br />

begin<br />

if (sel[0]) code

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

Saved successfully!

Ooh no, something went wrong!