⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 select1.tdf

📁 CodeVisionAVR C Library Functions Reference CodeVisionAVR C 库函数介绍 译自CodeVisionAVR C Compiler Help
💻 TDF
字号:
-------------------------------------------------------------------------
-------------------------------------------------------------------------
--
-- Revision Control Information
--
-- $Workfile:   SELECT1.TDF  $
-- $Archive:   P:/RS_eras/units/Common_units/ahdl/SELECT1.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
--
-------------------------------------------------------------------------
-------------------------------------------------------------------------

PARAMETERS
(
inwidth = 4,
outwidth = 15	-- 2^inwidth -1
);

-- 0 = 1, 1 = 2, 2 = 4, 3 = 8, etc

subdesign select1
(
selin[inwidth..1] : INPUT;
selout[outwidth..1] : OUTPUT;
)

VARIABLE

comps[outwidth..1][inwidth..1] : node;
calcs[outwidth..1][inwidth..1] : node;

BEGIN

FOR k IN 1 TO outwidth GENERATE
  comps[k][] = k-1;
END GENERATE;

FOR k IN 1 TO outwidth GENERATE
  
  calcs[k][1] = comps[k][1] $ selin[1];
  FOR j IN 2 TO inwidth GENERATE
    calcs[k][j] = calcs[k][j-1] # (comps[k][j] $ selin[j]);
  END GENERATE;
  selout[k] = !calcs[k][inwidth];   

END GENERATE;

END;

⌨️ 快捷键说明

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