Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
xst.pdf
Скачиваний:
141
Добавлен:
11.06.2015
Размер:
5.64 Mб
Скачать

R

Comparators HDL Coding Techniques

use ieee.std_logic_unsigned.all;

entity adders_7 is

port(A,B : in std_logic_vector(7 downto 0); OPER: in std_logic;

RES : out std_logic_vector(7 downto 0)); end adders_7;

architecture archi of adders_7 is begin

RES <= A + B when OPER='0' else A - B;

end archi;

Unsigned 8-Bit Adder/Subtractor Verilog Coding Example

//

// Unsigned 8-bit Adder/Subtractor

//

module v_adders_7(A, B, OPER, RES); input OPER;

input [7:0] A; input [7:0] B; output [7:0] RES; reg [7:0] RES;

always @(A or B or OPER) begin

if (OPER==1'b0) RES = A + B; else RES = A - B;

end

endmodule

Comparators HDL Coding Techniques

This section discusses Comparators and HDL Coding Techniques, and includes:

“About Comparators”

“Comparators Log File”

“Comparators Related Constraints”

“Comparators Coding Examples”

About Comparators

Not applicable

Comparators Log File

The XST log file reports the type and size of recognized comparators during the Macro Recognition step.

XST User Guide

www.xilinx.com

125

10.1

Chapter 2: XST HDL Coding Techniques

R

...

Synthesizing Unit <compar>.

Related source file is comparators_1.vhd.

Found 8-bit comparator greatequal for signal <$n0000> created at line 10.

Summary:

 

 

inferred

1 Comparator(s).

Unit <compar> synthesized.

 

=============================

 

HDL Synthesis Report

 

 

Macro Statistics

 

 

# Comparators

 

: 1

8-bit comparator greatequal

: 1

==============================

 

...

 

 

Comparators Related Constraints

None

Comparators Coding Examples

The coding examples in this section are accurate as of the date of publication. Download updates from ftp://ftp.xilinx.com/pub/documentation/misc/examples_v9.zip.

“Unsigned 8-Bit Greater or Equal Comparator”

Unsigned 8-Bit Greater or Equal Comparator

This section discusses Unsigned 8-Bit Greater or Equal Comparator, and includes:

“Unsigned 8-Bit Greater or Equal Comparator Diagram”

“Unsigned 8-Bit Greater or Equal Comparator Pin Descriptions”

“Unsigned 8-Bit Greater or Equal Comparator VHDL Coding Example”

“Unsigned 8-Bit Greater or Equal Comparator Verilog Coding Example”

 

8

 

 

 

A

 

>

 

CMP

 

 

 

 

 

 

 

8

 

 

 

B

 

 

 

X10555

 

 

 

 

 

 

 

 

 

 

 

Figure 2-44: Unsigned 8-Bit Greater or Equal Comparator Diagram

Table 2-53: Unsigned 8-Bit Greater or Equal Comparator Pin Descriptions

IO Pins

Description

 

 

A, B

Comparison Operands

 

 

CMP

Comparison Result

 

 

126

www.xilinx.com

XST User Guide

 

 

10.1

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]