bitadd.tdf

来自「乘法器的vhdl语言描述.本人调试已经通过」· TDF 代码 · 共 28 行

TDF
28
字号
%
Serial adder - inspired by the work of Ray Andraka

Written by steven groom (steven.groom@arrow.co.nz)
This module can be used freely as and when needed as long as this message remains intact.
%
include "lpm_add_sub";
subdesign bitadd
(
	dataa				:	input;		-- serial data in
	datab				:	input;		-- other serial data in
	result				:	output;		-- serial result out
	clk					:	input;		-- module clock
	reset				:	input;		-- module reset
)
variable
	_sum				:	dff;		-- the 1/2 adder sum
	_carry				:	dff;		-- and the carry
begin
	_sum.clk=clk;
	_sum.clrn=not reset;
	_carry.clk=clk;
	_carry.clrn=not reset;
	_sum=(((not dataa) and (datab xor _carry)) or (dataa and (datab xnor _carry)));
	_carry=(((not dataa) and (datab and _carry)) or (dataa and (datab or _carry)));
	result=_sum;
end;

⌨️ 快捷键说明

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