14.08.2013 Views

Xilinx CPLD Libraries Guide

Xilinx CPLD Libraries Guide

Xilinx CPLD Libraries 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.

About Design Elements<br />

COMPM4<br />

Macro: 4-Bit Magnitude Comparator<br />

Supported Architectures<br />

This design element is supported in the following architectures only:<br />

• XC9500XL<br />

• CoolRunner XPLA3<br />

• CoolRunner-II<br />

Introduction<br />

This design element is a 4-bit magnitude comparator that compare two positive Binary-weighted words. It<br />

compares A3 – A0 and B3 – B0, where A3 and B3 are the most significant bits.<br />

The greater-than output (GT) is High when A > B, and the less-than output (LT) is High when A < B When<br />

the two words are equal, both GT and LT are Low. Equality can be measured with this macro by comparing<br />

both outputs with a NOR gate.<br />

Logic Table<br />

Inputs Outputs<br />

A3, B3 A2, B2 A1, B1 A0, B0 GT LT<br />

A3>B3 X X X 1 0<br />

A3B2 X X 1 0<br />

A3=B3 A2B1 X 1 0<br />

A3=B3 A2=B2 A1B0 1 0<br />

A3=B3 A2=B2 A1=B1 A0

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

Saved successfully!

Ooh no, something went wrong!