资源简介
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年新年祝福源码
相关资源
- FPGA数字信号处理二并行FIR滤波器Ver
- FPGA和DS18B20通信verilog实现
- xilinx 的rom ip核使用方法
- fpga电子琴设计ppt
- 基于FPGA 的温湿度传感器
- Verilog驱动DS18B20
- 基于CPLD的生日贺卡实现点阵,液晶,
- CIC滤波器的设计.docx
- PAT蓝桥LeetCode学习路径刷题经验_v2.4
- 2017年全国电子设计竞赛第十三届资料
- 基于FPGA+STM32数字示波器
- 《HELLO FPGA》- 书籍合辑.zip
- FPGAs深度解析
- ALTERA FPGA/CPLD设计 高级篇(第2版)
- aurora_8b10b_0_ex_framing.7z
- 《深入浅出玩转 FPGA》[吴厚航] [书签
- Data_Structures_and_Algorithms_in_Swift_v3.0.0
- vscode 教程
- Linux Device Drivers Development(pdf+epub+mo
- iOS13.4 Xcode真机支持文件
- IOS iOS 13.4 (17E262)真机调试包
- 太空大战 太空战机 Funcode 课程设计
- Arial Unicode Ms字体包
- 直接数字频率合成技术的FPGA实现
- FPGA 图像处理
- 基于Nexys4 DDR的FPGA串口模块,带缓冲
- ZYNQ PL FPGA UART 串口例程
- FPGA课程设计,数字时钟,verilog编写
- iOS13.5真机支持包
- 基于FPGA的数据采集系统资料齐全,代
评论
共有 条评论