摘要: 串行进位加法器由一位全加器级联而成,结构简单,但延时很长,延时主要是进位信号级连造成的。在最坏情况下,进位必须从最低有效全加器传到最高有效全加器。 一位全加器的公式为:SUM=X⊕Y⊕CIN COUT=X·Y+ X·CIN+Y·CIN 在Verilog里可以调用门电路的原语实现。 下面为8位串行进位加法器的Verilog代码module add_serial(sum,cout,a,b,cin); //8位串行加法器input cin;input [7:0] a,b;output cout;output [7:0] sum;wire cin1,cin2,cin3,c 阅读全文
posted @ 2011-09-28 20:02 oceany 阅读(3358) 评论(0) 推荐(0) 编辑
摘要: 《数字系统设计与Verilog HDL》上面有这么一段代码,用于实现8位4级流水线加法器。module adder8pip(cout,sum,cin,ina,inb,clk );input cin,clk;input [7:0] ina,inb;output cout;output [7:0] sum;reg cout,tempcin;reg [7:0] sum,tempa,tempb;reg firstco,secondco,thirdco; //前三级加法的进位输出reg [1:0] firstsum,thirdina,thirdinb;reg [3:0] secondsum,sec... 阅读全文
posted @ 2011-09-28 17:57 oceany 阅读(2747) 评论(0) 推荐(0) 编辑