资源简介
Altera公司的资料,有许多问题自己不知道如何解决,看完这些资料后也许就会发现现成的方法,绝对值得一看。

代码片段和文件信息
// Copyright 2007 Altera Corporation. All rights reserved.
// Altera products are protected under numerous U.S. and foreign patents
// maskwork rights copyrights and other intellectual property laws.
//
// This reference design file and your use thereof is subject to and governed
// by the terms and conditions of the applicable Altera Reference Design
// License Agreement (either as signed by you or found at www.altera.com). By
// using this reference design file you indicate your acceptance of such terms
// and conditions between you and Altera Corporation. In the event that you do
// not agree with such terms and conditions you may not use the reference
// design file and please promptly destroy any copies you have made.
//
// This reference design file is being provided on an “as-is“ basis and as an
// accommodation and therefore all warranties representations or guarantees of
// any kind (whether express implied or statutory) including without
// limitation warranties of merchantability non-infringement or fitness for
// a particular purpose are specifically disclaimed. By making this reference
// design file available Altera expressly does not recommend suggest or
// require that this reference design file be used in combination with any
// other product not provided by Altera.
/////////////////////////////////////////////////////////////////////////////
//baeckler - 11-14-2006
#include
int log2 (int n)
{
int bits = 0;
while (n)
{
n >>= 1;
bits++;
}
return (bits);
}
int main (void)
{
unsigned int num_ins = 6;
unsigned int num_outs = log2(num_ins);
unsigned int num_cases = (1< unsigned int n = 0 k = 0;
unsigned int out_val = 0;
fprintf (stdout“//baeckler - 11-14-2006\n“);
fprintf (stdout“// priority encoder\n“);
fprintf (stdout“// no requests - output = 0\n“);
fprintf (stdout“// request bit 0 (highest priority) - output = 1\n“);
fprintf (stdout“// request bit %d (lowest priority) - output = %d\n“num_ins-1num_ins);
fprintf (stdout“module prio_encode (reqsout);\n“);
fprintf (stdout“input [%d:0] reqs;\n“num_ins-1);
fprintf (stdout“output [%d:0] out;\n“num_outs-1);
fprintf (stdout“reg [%d:0] out;\n\n“num_outs-1);
fprintf (stdout“ always @(*) begin\n“);
fprintf (stdout“ case(reqs)\n“);
fprintf (stdout“ // 0 is special no reqs\n“);
fprintf (stdout“ %d‘d%d: out = %d;\n\n“num_ins00);
for (n=1; n {
out_val = 1;
k = n;
while (k && !(k&1))
{
k >>=1;
out_val += 1;
}
fprintf (stdout“ %d‘d%d: out = %d;\n“num_insnout_val);
}
fprintf (stdout“ endcase\n“);
fprintf (stdout“ end\n“);
fprintf (stdout“endmodule\n“);
return (0);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-07-30 16:37 cookbook\
目录 0 2009-07-30 16:19 cookbook\arbitration\
文件 1983 2009-01-05 20:50 cookbook\arbitration\arbiter.v
文件 3196 2009-01-05 20:50 cookbook\arbitration\arbiter_tb.v
文件 1581 2009-01-05 20:50 cookbook\arbitration\bitscan.v
文件 2086 2009-01-05 20:50 cookbook\arbitration\bitscan_tb.v
文件 1911 2009-01-05 20:50 cookbook\arbitration\log2.inc
文件 2853 2009-01-05 20:50 cookbook\arbitration\prio_encode.cpp
文件 3405 2009-01-05 20:50 cookbook\arbitration\prio_encode.v
文件 5071 2009-03-24 19:41 cookbook\arbitration\tx_4channel_arbiter.v
文件 7939 2009-03-24 19:41 cookbook\arbitration\tx_4channel_arbiter_tb.sv
目录 0 2009-07-30 16:19 cookbook\arithmetic\
文件 4219 2009-01-05 20:50 cookbook\arithmetic\adder_tree.v
文件 4174 2009-01-05 20:50 cookbook\arithmetic\adder_tree_la
文件 3439 2009-01-05 20:50 cookbook\arithmetic\adder_tree_node.v
文件 3009 2009-01-05 20:50 cookbook\arithmetic\adder_tree_tb.v
文件 2572 2009-01-05 20:50 cookbook\arithmetic\addsub.v
文件 5378 2009-01-05 20:50 cookbook\arithmetic\basic_adder.v
文件 1763 2009-01-05 20:50 cookbook\arithmetic\compress_32.v
文件 5728 2009-01-05 20:50 cookbook\arithmetic\cordic.v
文件 4208 2009-01-05 20:50 cookbook\arithmetic\cordic_angle_table.cpp
文件 4754 2009-01-05 20:50 cookbook\arithmetic\cordic_tb.v
文件 5122 2009-01-05 20:50 cookbook\arithmetic\divider.v
文件 3766 2009-01-05 20:50 cookbook\arithmetic\divider_tb.v
文件 4094 2009-01-05 20:50 cookbook\arithmetic\double_addsub.v
文件 2342 2009-01-05 20:50 cookbook\arithmetic\double_addsub_tb.v
文件 1765 2009-01-05 20:50 cookbook\arithmetic\iter_addsub.v
文件 4684 2009-01-05 20:50 cookbook\arithmetic\karatsuba_mult.v
文件 2571 2009-01-05 20:50 cookbook\arithmetic\karatsuba_mult_tb.v
文件 4809 2009-01-05 20:50 cookbook\arithmetic\lc_mult_signed.v
文件 4288 2009-01-05 20:50 cookbook\arithmetic\lc_mult_signed_tb.v
............此处省略346个文件信息
- 上一篇:NAO机器人舞蹈 极乐净土
- 下一篇:2011年新年祝福源码
相关资源
- 条码字体barcode128
- FPGA实现PID.v
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- FPGA彩条显示
- STM32蓝牙和串口程序
- Xilinx-FPGA-引脚功能详细介绍.doc
- 基于xilinx FPGA的PCIe设计实战
- 基于PCIe的FPGA动态配置设计与实现
- 为什么工程师要掌握FPGA开发知识?
- 数字频率合成dds正弦波基于FPGA的DDS产
- Verilog FPGA UART串口控制器
- gmsk调制在FPGA上实现
- UNICODE GBK双向码表二进制文件
- 一个简单的verilog编写的DMA IP CORE,和
- FPGA在步进电机驱动上的应用实例及代
- 常用编码(UnicodeUTF-8GBK)转换工具
- fpga实现频率测量
- vc URL编解码类
- FPGA开发-ChipScope教程
- 红外循迹小车VHDL程序
- 中文转化unicoder码的方法
- 基于FPGA的USB接口设计
- DE2模拟的交通红绿灯
- 一种抗SEU存储器电路的FPGA设计
- Cyclone 10LP Remote Update Intel FPGA IP 官方工
- codesys编程手册中文版
- nRF24L01无线模块在单片机与FPGA上的应
- 基于FPGA多协议转换网关设计
- XSS Encode
- LHC生命周期前沿的非弹性暗物质:A
评论
共有 条评论