verilog求阶乘
来源:互联网 发布:mac position invalid 编辑:程序博客网 时间:2024/06/05 05:01
求阶乘
`include "function.v"
`timescale 1ns/100ps
`define clk_cycle 50
module tryfuctTop;
reg[3:0] n,i;
reg reset,clk;
wire[31:0] result;
initial
begin
n=0;
reset=1;
clk=0;
#100 reset=0;
#100 reset=1;
for(i=0;i<=15;i=i+1)
begin
#200n=i;
end
#100 $stop;
end
always #`clk_cycle clk=~clk;
tryfuncttryfunct(.clk(clk),.n(n),.result(result),.reset(reset) );
endmodule
测试程序
module taskk;
reg [31:0]fact;
reg [3:0]b=4;
//reg i;
initial
begin
jiecheng(fact,b);
end
task jiecheng;
output [31:0]jc;
integer i;
reg[31:0]wocao;
input [3:0]a;
begin
//#10
wocao=1;
for (i=1;i<a;i=i+1)
begin
#10
wocao=wocao*i;
end
jc=wocao;
end
endtask
endmodule
- verilog求阶乘
- Verilog阶乘器
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘:
- 求阶乘
- 求阶乘
- 求阶乘
- 求阶乘
- Verilog求相反数
- 递归求阶乘
- 实时查看Linux网卡流量Shell脚本
- 在Hive中创建索引
- verilog语言设计分频器
- Linux入门
- 基于Verilog HDL的有限状态机
- verilog求阶乘
- verilog语言设计有限状态机习题
- 西电 ubuntu 更新软件源
- 搜索引擎–Python下的分词插件 jieba 结巴分词
- ffmpeg 播放流程及线程管理
- Struts资料收集
- 爱上朴实的CSS细节
- supermap object 中打开工作区间代码
- Best Time to Buy and Sell Stock III