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

Multipliers<br />

VHDL<br />

Following is the VHDL code for an unsigned 8-bit greater or equal<br />

comparator.<br />

library ieee;<br />

use ieee.std_logic_1164.all;<br />

use ieee.std_logic_unsigned.all;<br />

entity compar is<br />

port(A,B : in std_logic_vector(7 downto 0);<br />

CMP : out std_logic);<br />

end compar;<br />

architecture archi of compar is<br />

begin<br />

CMP = B<br />

else '0';<br />

end archi;<br />

Verilog<br />

Following is the Verilog code for an unsigned 8-bit greater or equal<br />

comparator.<br />

module compar(A, B, CMP);<br />

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

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

output CMP;<br />

assign CMP = A >= B ? 1'b1 : 1'b0;<br />

endmodule<br />

When implementing a multiplier, the size of the resulting signal is<br />

equal to the sum of 2 operand lengths. If you multiply A (8-bit signal)<br />

by B (4-bit signal), then the size of the result must be declared as a 12bit<br />

signal.<br />

Large Multipliers Using Block Multipliers<br />

XST can generate large multipliers using an 18x18 bit block multiplier<br />

available in Virtex-II and Virtex-II Pro. For multipliers larger than<br />

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

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

Saved successfully!

Ooh no, something went wrong!