数字系统设计课件第四章+时序逻辑电路2.pdf
本章目录
不当的设计实例
误用异步复位
误用门控时钟
误用派生时钟
功耗考虑
计数器
二进制计数器
格雷码计数器
环形计数器
线性反馈移位寄存器(LFSR)
寄存器充当快速临时存储
时序电路设计:实践
同步设计在设计规模巨大、复杂的系统时是最重要的。
在过去,一些非同步的设计实践被用来节约芯片和面积
滥用异步复位
滥用门控时钟
滥用派生时钟
误用异步复位
原则:在寄存器正常工作的时候,不要用复位信号来清空寄存
器。
这里有一个不太实用的10进制计数器例子,当计数值达到
“1010”时,立刻清空计数器。
误用异步复位
libraryieee;process(clk,async_clr)
useieee.std_logic_1164.all;begin
useieee.numeric_std.all;if(async_clr=’1’)then
entitymod10_counterisr_reg=(others=’0’);
port(elsif(clk’eventandclk=’1’)then
clk,reset:instd_logic;r_reg=r_next;
q:outstd_logic_vector(3downto0)endif;
);endprocess;
endmod10_counter;--asynchronousclear
architecturepoor_async_archofasync_clr=’1’when(reset=’1’or
mod10_counterisr_reg=1010)
signalr_reg:unsigned(3downto0);else’0’;
signalr_next:unsigned(3downto0);--nextstateandoutputlogic
signalasync_clr:std_logic;r_next=r_reg+1;
beginq=std_logic_vector(r_reg);
--registerendpoor_async_arch;
误用异步复位
问题所在:
从“1001”到“0000”的跳转时,经过了“1010”状态(如时序图所
示)。
在驱动aync_clr信号的组合逻辑中,任意的毛刺都会复位计数器
不能应用时序分析来决定最大的时钟频率
因此,异步复位信
号只能在上电初始
化的