1 / 41

8 数字系统设计基础

8 数字系统设计基础. 8.1 概 述. 数字系统是指对数字信息进行存储、传输、处理的电子系统。. 数据处理单元主要由寄存器、运算器、数据选择器等部件组成。. 控制单元属于时序逻辑电路,可由同步状态机实现。. 8.1 概 述. 方法一:采用标准集成电路实现. 标准集成电路:标准集成电路是指功能、物理配置固定,用户无法修改的集成电路。标准集成电路品种多、价格低, 80 年代以前,广泛采用标准数字集成电路来实现数字系统。采用标准集成电路设计数字系统的主要缺点是体积大、功能固定。. 8.1 概 述. 方法二:采用可编程逻辑器件实现;.

vito
Download Presentation

8 数字系统设计基础

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 8 数字系统设计基础

  2. 8.1 概 述 数字系统是指对数字信息进行存储、传输、处理的电子系统。 数据处理单元主要由寄存器、运算器、数据选择器等部件组成。 控制单元属于时序逻辑电路,可由同步状态机实现。

  3. 8.1 概 述 方法一:采用标准集成电路实现 标准集成电路:标准集成电路是指功能、物理配置固定,用户无法修改的集成电路。标准集成电路品种多、价格低,80年代以前,广泛采用标准数字集成电路来实现数字系统。采用标准集成电路设计数字系统的主要缺点是体积大、功能固定。

  4. 8.1 概 述 方法二:采用可编程逻辑器件实现; 可编程逻辑器件:与标准集成电路不同,可编程逻辑器件允许用户根据自己的要求实现相应的逻辑功能,并且可以多次编程。可编程逻辑器件结构上由门阵列、可编程触发器、可编程开关组成。常见的可编程逻辑器件有CPLD和FPGA。

  5. 8.1 概 述 方法三:采用定制专用集成电路ASIC实现; 虽然可编程逻辑器件得到了广泛应用,但可编程逻辑器件内含的大量可编程开关消耗了芯片面积,限制了速度的提高。为了进一步提高速度、降低功耗、降低成本、提高集成度,通常采用专用集成电路(ASIC)设计。 采用ASIC设计可使数字系统集成度最高、性能最好。

  6. 8.1 概 述 自底向上设计方法 由真值表、卡诺图、布尔方程、 状态表和状态图描述电路的功能 。 小规模数字系统:采用试凑法,凭借设计着的经验就可以实现。 规模较大数字系统:也可采用试凑法,如不合适,可寻找更合适的设计方法。

  7. 8.1 概 述 自顶向下设计方法 设计者从整个系统逻辑出发,进行最上层的系统设计, 而后按一定的原则将全局系统分成若干子系统,逐级向下 ,再将每个子系统分为若干个功能模块、子模块、基本模块。

  8. 8.2 数字系统的自底向上设计方法 8.2.1设计题目 设计一4位数字频率计。 测量范围为0~9999Hz,假设被测信号为标准的方波信号。

  9. 8.2 数字系统的自底向上设计方法 原理框图 时序图

  10. 8.2 数字系统的自底向上设计方法 设计方案

  11. 8.2 数字系统的自底向上设计方法 计数电路设计 采用4个十进制加法计数器级联,芯片型号为CD4518

  12. 8.2 数字系统的自底向上设计方法 连线图

  13. 8.2 数字系统的自底向上设计方法 2.LED显示电路设计

  14. 8.2 数字系统的自底向上设计方法 3.控制电路设计

  15. 8.2 数字系统的自底向上设计方法 控制电路时序图

  16. 8.2 数字系统的自底向上设计方法 4.振荡电路设计

  17. 8.2 数字系统的自底向上设计方法 5.总体原理图

  18. 8.3 相加-移位乘法器设计 设计步骤: 1.算法设计 2.电路划分 3.数据处理单元的设计 4.控制单元的设计

  19. 8.3 相加-移位乘法器设计 1.算法设计 设A=1011,B=1101,则乘法运算过程和运算结果为: 乘法运算可分解为加法和移位两种操作。 部分积P右移1位后与A相加。最终的部分积P即为A与B的乘积。在运算过程中,若某一位 Bi=0,则只移位不累加。

  20. 8.3 相加-移位乘法器设计

  21. 8.3 相加-移位乘法器设计 乘法器的算法流程

  22. 8.3 相加-移位乘法器设计 电路划分:数据处理单元+控制单元

  23. 8.3 相加-移位乘法器设计 (1)REGA模块的设计 REGA模块为4位并行寄存器,其逻辑功能为:当LD=0时,处于保持状态;当LD=1时,处于并行置数状态。REGA模块的VHDL代码如下: library IEEE; use IEEE.std_logic_1164.all; entity REGA is port(CP,LD:in std_logic; D:in std_logic_vector(3 downto 0); Q:out std_logic_vector(3 downto 0)); end REGA;

  24. 8.3 相加-移位乘法器设计 architecture one of REGA is begin process(CP,LD,D) begin if(CP'event and CP='1')then if LD='1' then Q<=D; end if; end if; end process; end;

  25. (2)REGB模块的设计 REGB模块为4位多功能移位寄存器, 其逻辑功能为:当S1S0=00时,寄存器处于保持状态;当S1S0=01时,寄存器处于右移状态;当S1S0=11时,寄存器处于并行置数状态。REGB模块的VHDL程序如下: library IEEE; use IEEE.std_logic_1164.all; entity REGB is port(CP,DIR:in std_logic; S:in std_logic_vector(1 downto 0); D:in std_logic_vector(3 downto 0); Q:buffer std_logic_vector(3 downto 0)); end REGB;

  26. architecture one of REGB is begin process(CP,D,S) begin if (CP'event and CP='1')then case S is when "00"=> NULL; when "01"=> Q <= DIR&Q(3 downto 1); when "11"=> Q <= D; when others =>NULL; end case; end if; end process; end;

  27. (3)REGC模块的设计 REGC模块为5位多功能移位寄存器, 其逻辑功能为:当S1S0=00时,寄存器处于保持状态;当S1S0=01时,寄存器处于右移状态;当S1S0=11时,寄存器处于并行置数状态;当RD=1时,寄存器处于异步清零功能。REGC模块的VHDL程序如下: library IEEE; use IEEE.std_logic_1164.all; entity REGC is port(CP,RD,DIR:in std_logic; S:in std_logic_vector(1 downto 0); D:in std_logic_vector(4 downto 0); Q:buffer std_logic_vector(4 downto 0)); end REGC;

  28. architecture one of REGC is begin process(CP,D,S,RD) begin if(RD='1')then Q<=(others=>'0'); elsif (CP'event and CP='1') then case S is when "00" => NULL; when "01" =>Q<=DIR&Q(4 downto 1); when "11" => Q<=D; when others => NULL; end case; end if; end process; end;

  29. (4)CNT模块的设计 CNT模块为5进制加法计数器模块,其逻辑功能为:当RD=1时,处于异步清零功能;当ET=1时,允许计数。CNT模块的VHDL程序如下: library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity CNT is port(CP,RD,ET:in std_logic; CO:out std_logic); end CNT;

  30. end if; end if; end if; end process; process(Q) begin if(Q=4)then CO<='1'; else CO<='0'; end if; end process; end; architecture one of CNT is signal Q:std_logic_vector(2 downto 0); begin process(CP,RD,ET) begin if(RD='1')then Q<="000"; elsif(CP'event and CP='1')then if ET='1' then if (Q=4)then Q<="000"; else Q<=Q+1;

  31. (5)ADD4B模块的设计 ADD4B模块实现4位二进制加法运算,并产生进位输出。ADD4B模块的VHDL语言程序如下: library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity ADD4B is port(A:in std_logic_vector(3 downto 0); B:in std_logic_vector(3 downto 0); C:out std_logic_vector(3 downto 0); COUT:out std_logic); end;

  32. Architecture one of ADD4B is signal CRLT:std_logic_vector(4 downto 0); signal AA,BB:std_logic_vector(4 downto 0); begin AA <=‘0’& A; BB <=‘0’& B; CRLT<=AA+BB; C<=CRLT(3 downto 0); COUT<=CRLT(4); end;

  33. (6)MULCON模块的设计 定义4个状态:S0、S1、S2、S3。S0为初始状态;S1完成对计数器和寄存器清零,同时将两个乘数置入寄存器;S2完成加法运算;S3完成移位操作。每个状态发出的控制信号如表所示。

  34. 8.3 相加-移位乘法器设计

  35. library IEEE; use IEEE.std_logic_1164.all; entity MULCON is port(START,I4,BI,CP:in std_logic; DONE,RD,CA,CB1,CB0,CC1,CC0, ET:out std_logic); end MULCON; architecture one of MULCON is signal current_state,next_state:bit_vector(1 downto 0); constant S0:bit_vector(1 downto 0):="00"; constant S1:bit_vector(1 downto 0):="01"; constant S2:bit_vector(1 downto 0):="11"; constant S3:bit_vector(1 downto 0):="10"; begin

  36. COM:process(current_state,START,BI,I4) Begin DONE<='0';RD<='0';CA<='0';CB1<='0'; CB0<='0';CC1<='0';CC0<='0';ET<='0'; case current_state is when S0=>DONE<='1'; if(start ='1')then next_state<=S1; else next_state<=S0; end if; when S1=> RD<='1';CA<='1';CB1<='1';CB0<='1'; next_state <=S2;

  37. when S2=> if (BI='1') then CC1<='1';CC0<='1';ET<='1'; else ET<='1'; end if; next_state <=S3; when S3=>CB0<='1';CC0<='1'; if(I4='1') then next_state <=S0; else next_state <=S2; end if; end case; end process COM;

  38. REG:process(CP) begin if CP='1' and CP'event then current_state<=next_state; end if; end process REG; end;

  39. 8.3 相加-移位乘法器设计 控制器仿真结果

  40. 8.3 相加-移位乘法器设计 乘法器顶层原理图

  41. 8.3 相加-移位乘法器设计 乘法器仿真时序图

More Related