电子科技大学:《数字系统EDA技术》第三章(3-9) 基本逻辑电路设计

§39基本逻辑电路设计 基本逻辑电路 组合逻辑电路 时序逻辑电路 组合逻辑电路设计 简单门电路、编码器、译码器 加法器、多路选择器、三态门等
1 基本逻辑电路: 组合逻辑电路、 时序逻辑电路 一 组合逻辑电路设计 简单门电路、编码器、译码器、 加法器、多路选择器、三态门等。 §3.9 基本逻辑电路设计

1、基本门电路 Ibrary leeei se ieee std logic 1164. alli ntity gate is port(a, b: in std logici yand, yor, nand, nor, ynot, yxor: out std logic) nd gate rchitecture art of gate is egin yand<=a and b yor<=a or bi anand<=a nand bi nor<=a nor bi ynot<=not bi yxor<=a xor bi nd arti 2
2 1、基本门电路

2、编码器 设计一个8输入优先级编码器,yo级别最低 y7级别最高:输出为3位编码。 Y7=1 Vec=111 pR工oR工TY Y6=1 Ⅴec=110 y1 Y5=1Vec=101 Y4= y三 ec[2· Ⅴec=100 4 Y3 Vec=011 y Y2 Vec=010 了 Y1=1 Vec=001 Y0=1 Vec=000
3 2、编码器 设计一个 8 输入优先级编码器,y0 级别最低, y7 级别最高;输出为3位编码。 Y7=1 Vec=111 Y6=1 Vec=110 Y5=1 Vec=101 Y4=1 Vec=100 Y3=1 Vec=011 Y2=1 Vec=010 Y1=1 Vec=001 Y0=1 Vec=000

方法1:利用多选择语句自顶向下的优先特性 library ieee use ieee std logic 1164.all entity priority is port(signal yo, y1, y2,y3, y4, y5, y6,y7:in std logici signal vec: out std logic vector (2 downto 0))i end priority. architecture behavior of priority is begin process(yo, yl, y2, y3,y4, y5, y6,y7 begin if (y7=1)then vec<=111"i elsif (y6='1')then vec<=110 i elsif (y5=1)then vec<=101 i elsif (y4=1)then vec<=100 i elsif (y3=1)then vec<=011 i elsif (y2='1)then vec<=010i elsif (yl=1)then vec<=001i elsif (yo=f1')then vec<=000 i end ifi end processi end behavior
4 方法1:利用 if 多选择语句自顶向下的优先特性

方法2:进程内为顺序语句,最先描述优先级最低 最后描述优先级最高,可实现优先级编码。 library ieee use ieee std logic 1164.all entity priority is port(signal yo, yl, y2, y3, y4, y5, y6, y7: in std logic signal vec: out std logic vector(2 downto 0))i end priority氵 architecture behavior of priority is begin process(yo, yl, y2, y3, y4, y5,y6,y7) beqir if (yo=1)then vec<=000 end if if (yl=1)then vec<=001 end ifi if (y2=f1') then vec<=001 end if if(y3=1)then vec<=011; end ifi if (y4=1) then vec<=100 i end ifi if (y5=1)then vec<=101i end ifi if (y6=1)then vec<=110; end if if (y7=1)then vec<=11l i end ifi end process end behavior
5 方法2:进程内为顺序语句,最先描述优先级最低, 最后描述优先级最高,可实现优先级编码

方法3:利用条件赋值语句 architecture behavior of priority is begin vec <=111 when y7=1 else 110 when y6=else 4101” when y5=1else 100 when y4=else 011” when y3=1'else 010 when y2=else 001 when y1=else 0002 when y0= 1'else XXX” end behavior
6 方法3:利用条件赋值语句 architecture behavior of priority is begin vec <= “111” when y7 = ‘1’ else “110” when y6 = ‘1’ else “101” when y5 = ‘1’ else “100” when y4 = ‘1’ else “011” when y3 = ‘1’ else “010” when y2 = ‘1’ else “001” when y1 = ‘1’ else “000” when y0 = ‘1’ else “XXX”; end behavior;

3、译码器 译码器是编码器的逆过程。如3-8译码器 sel=000Y=00000001 Sel=001Y=00000010 DEC sel=010Y=00000 seL[2。]y[7。 sel=011Y=00001000 sel=100Y=00010000 sel=101Y=00100000 sel=110Y=01000000 sel=111Y=10000000
7 3、译码器 译码器是编码器的逆过程。如 3-8 译码器: sel=000 Y=00000001 sel =001 Y=00000010 sel =010 Y=00000100 sel =011 Y=00001000 sel =100 Y=00010000 sel =101 Y=00100000 sel =110 Y=01000000 sel =111 Y=10000000

方法1:使用逻辑左移运算符 library leee use ieee std logic 1164. all use ieee std logic unsigned. all entity decoder is port(inp: in std logic vector(2 downto 0 outp: out std logic vector(7 downto O)) end decoder architecture rtl of decoder is begin outp<=00000001 sll(conv integer(inp)) end rtl
8 方法1:使用逻辑左移运算符 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity decoder is port(inp : in std_logic_vector(2 downto 0); outp : out std_logic_vector(7 downto 0)); end decoder; architecture rtl of decoder is begin outp<=“00000001” sll(conv_integer(inp)); end rtl;

方法2:使用 processi语句 library ieee use ieee std logic 1164. all use ieee std logic unsigned. all entity decoder is port(inp: in std logic vector(2 downto 0 outp: out std logic vector(7 downto O)) end decoder architecture rtl of decoder is begin process(inp) begin outp0) outp( conv integer(inp)-="1 end process end rtl
9 方法2:使用process语句 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity decoder is port(inp : in std_logic_vector(2 downto 0); outp : out std_logic_vector(7 downto 0)); end decoder; architecture rtl of decoder is begin process(inp) begin outp’0’); outp(conv_integer(inp))<=‘1’; end process; end rtl;

方法3:使用case语句实现。 library ieee; use ieee std logic 1164.all entity dec is port (sel: in std logic vector(2 downto 0)i en: in std logici out std logic vector(7 downto 0) end dec: architecture behavior of dec is begi
10 方法3:使用 case 语句实现
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 电子科技大学:《数字系统EDA技术》数字钟设计及显示.ppt
- 电子科技大学:《数字系统EDA技术》第一章 EDA技术概述.ppt
- 电子科技大学:《数字系统EDA技术》第二章 大规模可编程逻辑器件.ppt
- 郑州轻工业学院:《晶体管收音机原理》第一章 无线电广播的发送与接收.ppt
- 《低频电子线路》课程PPT教学课件:第五章 放大电路的频率特性(2/3).ppt
- 《低频电子线路》课程PPT教学课件:第五章 放大电路的频率特性(1/3).ppt
- 《低频电子线路》课程PPT教学课件:第三章 多级放大电路(3/3).ppt
- 《低频电子线路》课程PPT教学课件:第三章 多级放大电路(2/3).ppt
- 《低频电子线路》课程PPT教学课件:第三章 多级放大电路(1/3).ppt
- 《低频电子线路》课程PPT教学课件:第二章 基本放大电路(6/6).ppt
- 《低频电子线路》课程PPT教学课件:第二章 基本放大电路(5/6).ppt
- 《低频电子线路》课程PPT教学课件:第二章 基本放大电路(4/6).ppt
- 《低频电子线路》课程PPT教学课件:第二章 基本放大电路(3/6).ppt
- 《低频电子线路》课程PPT教学课件:第二章 基本放大电路(2/6).ppt
- 《低频电子线路》课程PPT教学课件:第七章 信号的运算和处理(3/3).ppt
- 《低频电子线路》课程PPT教学课件:第七章 信号的运算和处理(2/3).ppt
- 《低频电子线路》课程PPT教学课件:第七章 信号的运算和处理(1/3).ppt
- 《低频电子线路》课程PPT教学课件:第八章 波形的发生和信号的转换(2/3).ppt
- 《低频电子线路》课程PPT教学课件:第九章 功率放大电路(9.2)互补功率放大电路.ppt
- 《低频电子线路》课程PPT教学课件:第九章 功率放大电路(9.1)功率效火电路概述.ppt
- 电子科技大学:《数字系统EDA技术》第四章 MAX+PLUS工开发工具.ppt
- 电子科技大学:《数字系统EDA技术》第五章 实验系统箱介绍.ppt
- 电子科技大学:《数字系统EDA技术》第六章 VHDL设计应用实例.ppt
- 电子科技大学:《数字系统EDA技术》第三章 硬件描述语言(VHDL).ppt
- 电子科技大学:《数字系统EDA技术》第三章(3-4) VHDL顺序语句.ppt
- 电子科技大学:《数字系统EDA技术》第四章(4-8) 举例:层次设计思想的应用.ppt
- 石家庄铁道学院:《数字图象处理》第五章(5-3) 退化函数估计.doc
- 石家庄铁道学院:《数字图象处理》第二章(2-1) 概述.doc
- 石家庄铁道学院:《数字图象处理》第二章(2-3) 连续图像的频谱.doc
- 石家庄铁道学院:《数字图象处理》第二章(2-4) 图像采样.doc
- 石家庄铁道学院:《数字图象处理》第二章(2-5) 图像量化.doc
- 石家庄铁道学院:《数字图象处理》第二章(2-6) 数字图像的基本概念.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-1) 图像变换概述.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-3) 一维快速傅里叶变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-3) 一维快速傅里叶变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-4) 二维离散傅里叶变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-5) 离散余弦变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-6) 沃尔什和哈达玛变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-7) 霍特林变换.doc
- 石家庄铁道学院:《数字图象处理》第三章(3-8) Radon变换.doc