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

R

Dividers HDL Coding Techniques

if (reset)

accum <= 16'b0000000000000000; else

if (add_sub)

accum <= accum + mult;

else

accum <= accum - mult;

end

assign RES = accum;

endmodule

Dividers HDL Coding Techniques

This section discusses Dividers HDL Coding Techniques, and includes:

“About Dividers”

“Dividers Log File”

“Dividers Related Constraints”

“Dividers Coding Examples”

About Dividers

Dividers are supported only when the divisor is a constant and is a power of 2. In that case, the operator is implemented as a shifter. Otherwise, XST issues an error message.

Dividers Log File

When you implement a divider with a constant with the power of 2, XST does not issue any message during the Macro Recognition step. In case your divider does not correspond to the case supported by XST, XST issues the following error message:

...

ERROR:Xst:719 - file1.vhd (Line 172).

Operator is not supported yet : 'DIVIDE'

...

Dividers Related Constraints

None

Dividers 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.

“Division by Constant 2 Divider”

XST User Guide

www.xilinx.com

155

10.1

Chapter 2: XST HDL Coding Techniques

R

Division by Constant 2 Divider

This section discusses Division by Constant 2 Divider, and includes:

“Division by Constant 2 Divider Diagram”

“Division by Constant 2 Divider Pin Descriptions”

“Division by Constant 2 Divider VHDL Coding Example”

“Division by Constant 2 Divider Verilog Coding Example”

8

 

8

 

DI

 

 

 

DO

 

 

2

 

 

X10562

 

Figure 2-51: Division by Constant 2 Divider Diagram

Table 2-63: Division by Constant 2 Divider Pin Descriptions

 

 

 

IO Pins

 

Description

 

 

 

DI

 

Division Operands

 

 

 

DO

 

Division Result

 

 

 

Division by Constant 2 Divider VHDL Coding Example

--

-- Division By Constant 2

--

library ieee;

use ieee.std_logic_1164.all; use ieee.numeric_std.all;

entity divider_1 is

port(DI : in unsigned(7 downto 0); DO : out unsigned(7 downto 0));

end divider_1;

architecture archi of divider_1 is begin

DO <= DI / 2;

end archi;

Division by Constant 2 Divider Verilog Coding Example

//

// Division By Constant 2

//

module v_divider_1 (DI, DO);

156

www.xilinx.com

XST User Guide

 

 

10.1

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