gfdiv.tdf

来自「CodeVisionAVR C Library Functions Refere」· TDF 代码 · 共 60 行

TDF
60
字号
-------------------------------------------------------------------------
-------------------------------------------------------------------------
--
-- Revision Control Information
--
-- $Workfile:   GFDIV.TDF  $
-- $Archive:   P:/RS_eras/units/Common_units/ahdl/GFDIV.TDv  $
--
-- $Revision:   1.1  $
-- $Date:   14 Jul 1999 10:33:54  $
-- $Author			:  Alejandro Diaz-Manero
--
-- Project      :  RS_eras
--
-- Description	: 
--
-- Copyright 1999 (c) Altera Corporation
-- All rights reserved
--
-------------------------------------------------------------------------
-------------------------------------------------------------------------  

FUNCTION lpm_rom (address[LPM_WIDTHAD-1..0], inclock, outclock, memenab)
   RETURNS (q[LPM_WIDTH-1..0]);

FUNCTION gfmul (a[m..1], b[m..1]) 
	RETURNS (c[m..1]);

PARAMETERS
(
 m = 8, -- field width
 irrpol = 285, -- irreducible polynomial
 inv_file = "inv.mif"
);

subdesign gfdiv  -- c = a/d

(
a[m..1], d[m..1] : INPUT;
c[m..1] : OUTPUT;
)

VARIABLE

b[m..1] : node; -- inverse of d

BEGIN

-- take inverse of d => b

b[] = lpm_rom (d[],,,)
		WITH (LPM_WIDTH = m, LPM_WIDTHAD = m, LPM_FILE = inv_file,
			  LPM_ADDRESS_CONTROL = "UNREGISTERED", LPM_OUTDATA = "UNREGISTERED");

c[] = gfmul (a[], b[]) 
		WITH (m = m, irrpol = irrpol);

END;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?