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

📄 modectrlunit.v

📁 hmac的verilog代码, 通过控制字选择进行sha1运算或hmac运算
💻 V
字号:
/////////////////////////////////////////////////////////    module describe// name: 		modectrlunit// function:	record the ctrl word,the addr is 0;ctrlword[0] is the padflg.// writer:		zy// data:		2006/03/14// version:		1.0// feature:		////////////////////////////////////////////////////////module modectrlunit(clk,reset,en,wr,addr,datain,ctrlword,maskword);input clk;input reset;input en;input wr;input [3:0] addr;input [4:0] datain;output [4:0] ctrlword;output [2:0] maskword;reg [4:0] ctrlword;//ctrl[0] is pad flag, ctrl[1] is soft reset,ctrl[2] is modsel, ctrl[3] is newhmac, ctrl[4] is ivrstreg [2:0] maskword;always @(posedge clk)begin	if (!reset)		begin			ctrlword<=0;			maskword<=0;		end	else if ((addr==0)&&(en)&&(!wr))		ctrlword<=datain;	else if ((addr==15)&&(en)&&(!wr))		maskword<=datain[2:0];	else 		ctrlword[1]<=0;endendmodule

⌨️ 快捷键说明

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