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

📄 sigcounter.tdf

📁 51单片机C语言常用模块与综合系统设计实例精讲
💻 TDF
字号:
SUBDESIGN sigcounter
(
	sig, lrst,suocun,oe		: INPUT ;
	ad[7..0]	: OUTPUT;
)

VARIABLE
	cnt0[7..0]		:DFF;
	cnt1[7..0]		:DFF;
	reg[4..0]		:DFF;
	tnode[7..0] : TRI_STATE_NODE;
BEGIN
	reg0.clk=suocun;
	reg0.d=!reg0;
	reg1.clk=!oe;
	reg1.d=!reg0;
	reg2.clk=!suocun;
	reg2.d=reg0;
	reg3.clk=!oe;
	reg3.d=reg0;
	reg4.clk=!suocun;
	reg4.d=!reg0;

	cnt0[].clk=sig & reg0;
	cnt1[].clk=sig & !reg0;

	cnt0[].clrn=lrst & (reg3.q # reg4.q);
	cnt1[].clrn=lrst & (reg1.q # reg2.q);

	cnt0[].d=cnt0[]+1;
	cnt1[].d=cnt1[]+1;

	tnode[7]=TRI(cnt0[7].q,oe & !reg0);
	tnode[7]=TRI(cnt1[7].q,oe & reg0);
	tnode[6]=TRI(cnt0[6].q,oe & !reg0);
	tnode[6]=TRI(cnt1[6].q,oe & reg0);
	tnode[5]=TRI(cnt0[5].q,oe & !reg0);
	tnode[5]=TRI(cnt1[5].q,oe & reg0);
	tnode[4]=TRI(cnt0[4].q,oe & !reg0);
	tnode[4]=TRI(cnt1[4].q,oe & reg0);
	tnode[3]=TRI(cnt0[3].q,oe & !reg0);
	tnode[3]=TRI(cnt1[3].q,oe & reg0);
	tnode[2]=TRI(cnt0[2].q,oe & !reg0);
	tnode[2]=TRI(cnt1[2].q,oe & reg0);
	tnode[1]=TRI(cnt0[1].q,oe & !reg0);
	tnode[1]=TRI(cnt1[1].q,oe & reg0);
	tnode[0]=TRI(cnt0[0].q,oe & !reg0);
	tnode[0]=TRI(cnt1[0].q,oe & reg0);

	ad[]=tnode[];
	
END;

⌨️ 快捷键说明

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