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

📄 shift_add.v

📁 移向相加器
💻 V
字号:
//--------------------------------------------------------------------------------------------------
//
// Title       : shift_add
// Design      : demo21
// Author      : suli
// Company     : Tsinghua
//
//-------------------------------------------------------------------------------------------------
//
// File        : shift_add.v
// Generated   : Sat Dec 13 10:57:29 2003
// From        : interface description file
// By          : Itf2Vhdl ver. 1.20
//
//-------------------------------------------------------------------------------------------------
//
// Description : 
//
//-------------------------------------------------------------------------------------------------
`timescale 1ps / 1ps

//{{ Section below this comment is automatically maintained
//   and may be overwritten
//{module {shift_add}}
module shift_add ( product, a, b, clk, reset );
	output[15:0] product;
	input[7:0]a,b;
	input clk, reset;
	reg[15:0] product,tempa;
	reg[7:0] tempb;
	reg qb;
	integer i;
	
	always@(negedge reset or posedge clk)
		if (~reset)
			begin
				tempa[15:8]=7'd0;
				tempa[7:0]=a;
				tempb=b;
				product=16'd0;
				i=0;
			end
		else		
			begin 
				qb=tempb[0];
				tempb[6:0]=tempb[7:1];
				if (qb==1)  product=product+tempa;
				tempa=tempa<<1;
				i=i+1;
			end



//}} End of automatically maintained section

// -- Enter your statements here -- //

endmodule

⌨️ 快捷键说明

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