第七章 基本逻辑电路设计

上传人:门**** 文档编号:243143932 上传时间:2024-09-16 格式:PPT 页数:195 大小:5.30MB
返回 下载 相关 举报
第七章 基本逻辑电路设计_第1页
第1页 / 共195页
第七章 基本逻辑电路设计_第2页
第2页 / 共195页
第七章 基本逻辑电路设计_第3页
第3页 / 共195页
点击查看更多>>
资源描述
,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,第七章,*,1,第七章 基本逻辑电路设计,组合逻辑电路设计,时序逻辑电路设计,存储器,有限状态机,2,7.1,组合逻辑电路设计,7.1.1,设计基础一、组合逻辑电路的设计步骤,逻辑真值表,逻辑函数式,选定器件类型,化简逻辑函数,逻辑电路图,逻辑问题,分析事件的因果关系,确定输入端口和输出端口及逻辑状态的含意。,将实际的逻辑问题抽象成逻辑函数。,由,EDA,工具自动完成。,3,二、用,VHDL,建立组合逻辑电路的方法,1,、借助真值表设计组合电路,设计任务:设计一个四选一数据选择器。,逻辑功能:从四个输入数据中选出某一数据输出。,输入输出端口:四个数据输入端;两个选择控制输入端;一个数据输出端。,mux4,f,in0,in1,in2,in3,x0,x1,引脚框图,entity mux4 is,port(in0,in1,in2,in3:in bit;,x0,x1:in bit;,f: out bit);,end entity mux4;,4,真值表:,in0,in1,in2,in3,x1,x0,f,in0,-,-,-,0,0,in0,-,in1,-,-,0,1,in1,-,-,in2,-,1,0,in2,-,-,-,in3,1,1,in3,architecture rtl of mux4 is,begin,f= (in0 and (not x1) and (not x0) or,(in1 and (not x1) and ( x0) or,(in2 and ( x1) and (not x0) or,(in3 and ( x1) and ( x0);,end architecture rtl;,5,此例按真值表,(,用“与或”结构实现,),要求,用,VHDL,语言逻辑表达式方式描述四选一数据选择器,将,f,1,的行用最小项表达式表达出来即可。,这种描述方法和传统的由真值表变为最小项表达式的设计方法是相同的,只是用,VHDL,语言进行描述无须化简,(,由计算机进行化简,),;而用传统设计方法描述时,常常要对最小项表达式进行化简,以使设计电路简化。,6,2,、用逻辑表达式描述组合电路,设计任务:设计一个函数电路,y,abc,de,。,输入输出端口:五个函数自变量输入端;一个函数值输出端。,function,y,a,b,c,d,e,引脚框图,entity funct is,port(a,b,c,d,e:in bit;,y: out bit);,end entity funct;,architecture rtl of funct is,begin,y=(a and b and c) or (d and e);,end architecture rtl;,逻辑表达式设计函数电路非常方便,只要用,VHDL,语言的逻辑符号置换布尔方程中相应的逻辑符号即可。,7,3,、用算术表达式描述组合电路,设计任务:设计一位全加器。,逻辑功能:考虑来自低位的进位,将两个一位的二进制数相加,得到一个和位、一个进位位。,输入输出端口:两个加数输入端;一个低位进位输入端;一个和输出端;一个进位输出端。,library ieee;,use ieee.std_logic_1164.all;,use ieee.std_logic_unsigned.all;,entity fulladder is,port(a,b,cin : in std_logic;,sum,cout: out std_logic);,end entity fulladder;,full,adder,cout,a,b,cin,引脚框图,sum,8,算术表达式:,(cout,sum)=a+b+cin;,architecture rtl of fulladder is,signal a1,b1,cin1,sum1:std_logic_vector(1 downto 0);,begin,a1=0,b1=0,cin1=0,sum1= a1+b1+cin1;,sum=sum1(0);,cout=sum1(1);,end architecture rtl;,并位运算是为了满足代入符,左、右两侧运算对象的位数相同。,算术表达式设计电路,只要用,VHDL,语言的算术符号置换算术表达式中相应的算术符号即可,同时要考虑,VHDL,语言对运算操作数的要求。,9,组合逻辑电路设计实例,简单门电路,译码器,编码器,编码转换器,数据选择器,运算器,三态门及总线缓冲器,10,7.1.2,简单门电路,简单门电路表达简答逻辑关系,采用简单的信号代入语句就能够方便地实现;没有必要采用复杂的结构。,例如,,反向器,y= not a;,2,输入与非门,y= a nand b;,2,输入或非门,y= a nor b;,2,输入异或门,y= a xor b;,与或非门,y= not (a1 and a2) or (a3 and a4);,11,library ieee;,use ieee.std_logic_1164.all;,entity nand2_71 is,port(a,b:in std_logic;,y:out std_logic);,end entity nand2_71;,architecture nand2_1 of nand2_71 is,begin,y y y y y y=X;,end case;,end process;,end architecture nand2_2;,RTL,视图,15,基于真值表的另一种描述形式,library ieee;,use ieee.std_logic_1164.all;,entity nand2_73 is,port (a,b:in std_logic;,y:out std_logic);,end entity nand2_73;,architecture nand2_3 of nand2_73 is,begin,y= (not a and not b) or,(not a and b) or,( a and not b);,end architecture nand2_3;,a,b,y,0,0,1,0,1,1,1,0,1,1,1,0,二输入与非门真值表,RTL,视图,16,3. N,输入与门的描述,entity and_n is,generic(n: integer);,port(a: in,bit_vector (n-1) downto 0);,f: out bit);,end entity and_n;,architecture using_loop of,and_n,is,begin,end,architecture,using_loop;,构造体怎样编写,?,使用什么语句,?,and_n,n,a,f,17,process(a) is,variable temp_f: bit;,begin,temp_f:=,1;,for i in,arange,loop,temp_f:= temp_f and a(i);,end loop;,f=temp_f;,end process;,作业:请大家为“,n,输入或门”编写,VHDL,程序代码。,18,怎样调用可配置输入端口数目的,N,输入与门,entity and_n is,generic(n: integer);,port(a: in,bit_vector (n-1) downto 0);,f: out bit);,end entity and_n;,component,and_n,is,generic(n: integer);,port(a: in,bit_vector (n-1) downto 0);,f: out bit);,end component,and_n,;,N,输入与门实体说明部分,调用,N,输入与门的元件说明语句,19,architecture str of andgen is,componentend component,;,signal a0,a1:bit_vector(2 downto 0);,signal a2:bit_vector(1 downto 0);,begin,a0=in0 ,a1=in3 ,u0:and_n,generic map,(3),port map (a0,a2(0),);,u1:and_n,generic map,(3),port map (a1,a2(1),);,u2:and_n,generic map,(2),port map (a2, y);,end architecture str,;,利用,generic map,语句对,and_n,配置不同输入端口数目,u0,&,u2,&,u1,&,in0,in1,in2,in3,in4,in5,a2(0),a2(1),y,20,7.1.3,译码器,译码器的功能,根据特定的输入数字状态,激活电路的一个或多个输出。,常用译码器,二进制译码器:也称“最小项发生器”,其多位输出分别表达输入的不同最小项,如,3-8,线译码器。,BCD-,七段显示译码器。,地址译码器。,21,输入输出端口:一个三位的待译码二进制数据输入端;八个译码输出端,,反函数,输出;三个选通输入控制端,g1,、,g2a,、,g2b,。,library ieee;,use ieee.std_logic_1164.all;,entity kdecoder38 is,port (g1, g2a, g2b: in std_logic;,a: in std_logic_vector(2 downto 0);,y: out std_logic_vector(7 downto 0);,end entity kdecoder38;,1. 3-8,线译码器,22,architecture rtl of kdecoder38 is,signal yl:,std_logic_vector(7 downto 0);,begin,with,a,select,yl=,11111110 when 000,11111101 when 001,“01111111 when 111,11111111 when others;,y = yl,when,(g1 and not g2a and not g2b)=1,else,11111111;,end,architecture,rtl;,选通输入,二进制输入,译码输出,g1 g2a g2b,a2:0,y7:0,X 1 X,X X X,11111111,X X 1,X X X,11111111,0 X X,X X X,11111111,1 0 0,0 0 0,11111110,1 0 0,0 0 1,11111101,1 0 0,0 1 0,11111011,1 0 0,0 1 1,11110111,1 0 0,1 0 0,11101111,1 0 0,1 0 1,11011111,1 0 0,1 1 0,10111111,1 0 0,1 1 1,01111111,23,24,2. BCD-,七段显示译码器,输入,BCD,码(,8421,码,用四位二进制数码表示的一位十进制数),产生,7,个输出,分别驱动相应显示器件(二极管或液晶显示单元),可显示十进制数。,7,段输出与,BCD,码的对应关系,:,data (3 downto 0) : abcdefg,0000:1111110 0001:0110000 0010,:,1101101 0011,:,1111001,0100: 0110011 0101:1011011 0110:0011111 0111:1110000,1000:1111111 1001:1110011,25,library ieee;,use ieee.std_logic_1164.all;,entity,bcdseg7,is,port (data: in std_logic_vector (,3 downto 0,);,y: out std_logic_vector (,6 downto 0,);,end entity,bcdseg7,;,26,architecture d of bcdseg7 is,begin,y,=,1111110,when,data=0000 else,0110000 when data=0001 else,1101101 when data=0010 else,1111001 when data=0011 else,0110011 when data=0100 else,1011011 when data=0101 else,0011111 when data=0110 else,1110000 when data=0111 else,1111111 when data=1000 else,1110011 when data=1001,else,0000000 ;,end architecture d;,data (3 downto 0) :,abcdefg,0000: 1111110,0001: 0110000,0010,:,1101101,0011,:,1111001,0100: 0110011,0101: 1011011,0110: 0011111,0111: 1110000,1000: 1111111,1001: 1110011,27,3.,地址译码器,使能端,(en),地址,(a19a0),片选输出,(cs),0,00000H01FFFH,CS0=0,其余为,1,0,40000H43FFFH,CS1=0,,其余为,1,0,08000H0AFFFH,CS2=0,,其余为,1,0,E0000HE01FFH,CS3=0,,其余为,1,1,XXXXXH,全,1,地址译码器真值表,28,library ieee;,use ieee.std_logic_1164.all;,entity,addrdec,is,port(,en : in std_logic;,address : in std_logic_vector(19 downto 0);,cs : out std_logic_vector(3 downto 0),);,end entity,addrdec;,29,- en must be 0 to enable any output,- cs(0) : X00000 to X01FFF,- cs(1) : X40000 to X43FFF,- cs(2) : X08000 to X0AFFF,- cs(3) : XE0000 to XE01FF,architecture v1 of addrdec is,begin,cs(0) = X00000) and (address =X01FFF),else,1;,cs(1) = X40000) and (address = X43FFF),else,1;,cs(2) = X08000) and (address = X0AFFF),else,1;,cs(3) = XE0000) and (address = XE01FF),else,1;,end architecture v1;,30,练习:改用,case,语句或,select,语句完成地址译码器的描述,architecture v2 of addrdec is,signal,cstemp:std_logic_vector(3 downto 0);,begin,with address select cstemp=,1110 when X00000 to X01FFF,1101 when X40000 to X43FFF,1011 when X08000 to X0AFFF,0111 when XE0000 to XE01FF,1111 when others;,cscstempcstempcstempcstemp cstemp=1111 ;,end case;,end process;,cs=cstemp when en=0 else 1111;,end architecture v3;,32,use ieee.std_logic_unsigned.all;,architecture v2 of addrdec is,signal cstemp:std_logic_vector(3 downto 0);,signal addrtemp: integer range 0 to 1048575;,begin,addrtemp=conv_integer(address);,with addrtemp select cstemp=,1110 when 0 to 8191,1101 when 262144 to 278527,1011 when 32768 to 45055,0111 when 917504 to 918015,1111 when others;,cs=cstemp when en=0 else 1111;,end architecture v2;,修改后程序如下,33,4.,作业:二,-,十进制,BCD,译码器,设计任务,:,设计一个二,-,十进制,BCD,译码器。译码器输入,din,为,4,位二进制数,输出,b,为,十进制数的高位,,,a,为,十进制数的低位,,,a,、,b,是二进制编码的十进制数。端口图如下:,34,7.1.4,编码器,编码器,是与译码器逻辑功能相反的数字部件,它将,特定意义的输入数字信号,变成相应的,若干位二进制代码,。,优先级编码器,常用于中断的优先级控制。比如,8,线,-3,线优先编码器,输入,8,个数据信号,编码成,3,位二进制代码表示的数据,并进行输出,;,低位,0,优先,反函数输出。本节讲述该编码器的编程,真值表如下,35,编码输入,使能输入,组信号输出,编码输出,d7,d6,d5,d4,d3,d2,d1,d0,ein,gsn,eon,a2n,a1n,a0n,X,X,X,X,X,X,X,X,1,1,1,1,1,1,X,X,X,X,X,X,X,0,0,0,1,1,1,1,X,X,X,X,X,X,0,1,0,0,1,1,1,0,X,X,X,X,X,0,1,1,0,0,1,1,0,1,X,X,X,X,0,1,1,1,0,0,1,1,0,0,X,X,X,0,1,1,1,1,0,0,1,0,1,1,X,X,0,1,1,1,1,1,0,0,1,0,1,0,X,0,1,1,1,1,1,1,0,0,1,0,0,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1,0,1,0,1,1,1,36,library ieee;,use ieee.std_logic_1164.all;,entity encoder8_3 is,port(d : in std_logic_vector(7 downto 0);,ein: in std_logic;,a0n,a1n,a2n,gsn,eon,: out std_logic);,end entity encoder8_3;,引脚框图,37,architecture a of encoder8_3 is,signal q:std_logic_vector(2 downto 0);,begin,a0n=q(0); a1n=q(1); a2n=q(2);,process(d) is,begin,if,ein=1,then q=111;,gsn=1;eon=1,;,elsif d(0)=0 then q=111;,gsn=0;eon=1,;,elsif d(1)=0 then q=110;gsn=0;eon=1;,elsif d(7)=0 then q=000;gsn=0;eon=1;,else q=111;,gsn=1;eon=0,;,end if;,end process;,end architecture a;,优先级由高到低,38,仿真波形图,RTL,视图,39,7.1.5,码制转换电路,该类电路为多路输入,/,多路输出,将输入的编码转换为对应的输出的编码;,上述二进制译码器、编码器的数据流设计方式可以推广到各类码制转换电路的设计中;,我们将,8421,码向余三码转换电路的,VHDL,描述留给同学们作为课后练习。,40,作业:,BCD,Excess-3,(余,3,码)的转换,library ieee;,use ieee.std_logic_1164.all;,entity kbcd_ex3 is,port (a: in std_logic_vector(3 downto 0);,y: out std_logic_vector(3 downto 0);,end entity kbcd_ex3;,architecture rtl of kbcd_ex3 is,begin,使用,withselect,语句,或其他任何可行方式,end,architecture,rtl;,41,7.1.6,数据选择器,数据选择器又叫,多路开关,,在,选择信号,的控制下,数据选择器从多个数据输入通道中选择,1,路或多路的数据传输至输出端,常用于信号的切换。,我们在,7.1.1,节,讲述了利用真值表描述数据选择器的方法,在第五章中讲述,if,语句、,case,语句、选择信号代入语句、条件信号代入语句的用法时,都以四选一数据选择器为例进行说明,此处就不再重复。参看课本,143,页的例,7-13,。,42,作业:设计,16-4,数据选择器,其引脚框图及真值表如下所示。,选择输入,输出,s1,s0,x,0,0,a,0,1,b,1,0,c,1,1,d,16-4,数据选择器真值表,43,7.1.7,运算器,运算电路主要包括:,比较器(,comparator,),加法器(,adder,),乘法器(,multipliers,),算术逻辑单元(,ALU,),求补器,这里,我们主要讲加法器。,44,1.,半加器,加法器有全加器和半加器之分,半加器是组成全加器的基本部件,逻辑符号及真值表如下,二进制输入,和输出,进位输出,b,a,s,co,0,0,0,0,0,1,1,0,1,0,1,0,1,1,0,1,45,library ieee;,use ieee.std_logic_1164.all;,entity,half_adder,is,port(a, b:in std_logic;,s, co:out std_logic);,end entity half_adder;,architecture half1 of,half_adder,is,begin,co=a and b;,s=a xor b;,end,architecture,half1;,c=a or b;,d=a nand b;,co=not d;,s=c and d;,signal c,d:std_logic;,46,47,2.,全加器,输入输出端口,输入,: a, b, ci (,进位),输出,: s(,和位), co,(进位),半加器仅能用于,1bit,加法,如果要设计较多位的加法器时,仅靠多个半加器相连无法达成此愿望,因其无法处理进位问题,故须使用全加器。当两个二进制数相加时,较高的高位相加时必须加入较低的进位项,以得到输出为和(,s,)及进位(,co,),因此有三个输入项,而输出同样为两项。,48,输入,输出,a,b,ci,s,co,0,0,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,1,0,1,1,1,0,0,1,1,1,1,1,1,全加器真值表,逻辑表达式:,49,library ieee;,use ieee.std_logic_1164.all;,entity,fulladder,is,port (a :,in,std_logic;,b :,in,std_logic;,ci : in std_logic;,s :,out,std_logic;,co :,out,std_logic);,end entity,fulladder;,architecture rtl of,fulladder,is,begin,s = (a xor b) xor ci;,co = (a and b) or (ci and a) or (ci and b);,end architecture rtl;,50,基于逻辑表达式的,RTL,视图,基于算术表达式的,RTL,视图,51,3.,由两个半加器构成一位全加器,library,ieee;,use,ieee.std_logic_1164.all;,entity,full_adder,is,port,(a,b,cin :,in,std_logic;,s,co :,out,std_logic);,end,entity,full_adder;,半加器逻辑表达式,全加器逻辑表达式,52,architecture,full,of,full_adder,is,component,half_adder,is,port,(a, b:,in,std_logic;,s, co:,out,std_logic);,end component,half_adder;,signal,u0_co,u0_s,u1_co:std_logic;,begin,u0:half_adder,port map,(,a,b,u0_s,u0_co,);,u1:half_adder,port map,(,u0_s,cin,s,u1_co,);,co=u0_co or u1_co;,end,architecture,full;,53,4. N,位串行进位加法器,54,library ieee;,use ieee.std_logic_1164.all;,entity,addern,is,generic(n:integer:=16);,port(a:in std_logic_vector(n downto 1);,b:in std_logic_vector(n downto 1); cin:in std_logic;,sum:out std_logic_vector(n downto 1); cout:out std_logic);,end,entity,addern;,architecture,structural of addern is,component,fulladder,is,port (a : in std_logic; b : in std_logic;,ci : in std_logic; s : out std_logic;,co : out std_logic);,end component,fulladder;,55,signal carry : std_logic_vector(,0 to n,);,begin,carry(0)=cin;,couta(i), b=b(i), ci=carry(i-1), s=sum(i), co=carry(i);,end generate;,end,architecture,structural;,思考:我们可以用信号代入语句来写吗?,56,练习:改错并判断以下程序所描述电路的功能,library ieee,;,use ieee.std_logic_1164.all;,entity kparity9 is,port(i : in std_logic_vector;,even, odd : out std_logic);,end entity kparity9;,architecture rtl of kparity9 is,variable y1,y2,y3: std_logic;,begin,y1:= i(1) xor i(2) xor i(3);,y2:= i(4) xor i(5) xor i(6);,y3:= i(7) xor i(8) xor i(9);,even= not odd;,odd = y1 xor y2 xor y3;,end architecture rtl;,9,位奇偶校验电路,若输入数据中包含偶数个,1,则,,even,为,1,,,odd,为,0,;否则,,even,为,0,,,odd,为,1,。,57,练习: 设计一个四位比较器,它有两个四位输入端口,in1,和,in2,,是需要比较的两个操作数;一个一位的输出端口,pout,,当,in1,in2,时,输出高电平,否则输出低电平。,library ieee;,use ieee.std_logic_1164.all;,use ieee.,std_logic_unsigned,.all;,entity comp is,port( in1,in2:in std_logic_vector(3 downto 0);,pout: out std_logic);,end entity comp;,architecture rtl of comp is,begin,comp,in1,in2,pout,58,process(in1,in2) is,variable t1,t2: integer range 0 to15;,begin,t1:=,conv_integer,(in1);,t2:=,conv_integer,(in2);,if,t1t2,then,pout=1;,else,pout=0;,end if;,end process;,end architecture rtl;,comp,in1,in2,pout,use ieee.,std_logic_unsigned,.all;,59,60,练习 二进制值运算经常用到求补操作,设计一个,8,位的求补器。,library ieee;,use ieee.std_logic_1164.all;,use,ieee.std_logic_unsigned,.all;,entity hosuu is,port( a: in std_logic_vector(7 downto 0);,b: out std_logic_vector(7 downto 0);,end entity hosuu;,architecture rtl of hosuu is,begin,b= not a + 1;,end architecture rtl;,此程序没有考虑有符号数的求补,61,library ieee;,use ieee.std_logic_1164.all;,use ieee.std_logic_unsigned.all;,entity hos is,port( a: in std_logic_vector(7 downto 0);,b: out std_logic_vector(7 downto 0);,end entity hos;,architecture rtl of hos is,begin,end architecture rtl;,process(a) is,variable t:std_logic_vector(6 downto 0);,begin,if a(7)=1 then,t:= not a(6 downto 0)+1;,b= a(7) ,else,b -,实现,a+b+cin,;,when 001 = -,实现,a-b-cin;,when “010” = -,实现,a+cin,;,when 011 = -,实现,a-cin,;,when “100” = -,实现,y=a and b,;,when “101” = -,实现,y=a or b,;,when “110” = -,实现,y=a xor b,;,when “111” = -,实现,y= not a,;,when others = y= 0000”; cout=0;,end case;,end process;,end architecture beh;,67,7.1.8,三态门及总线缓冲器,三态门电路,数据输入,控制输入,数据输出,din,en,dout,X,0,Z,0,1,0,1,1,1,三态门真值表,三态门和双向缓冲器是接口电路和总线驱动电路经常用到的器件。利用高阻态,可以使总线被多个设备所共享,并且可以方便地实现数据总线的双向操作。,68,library ieee;,use ieee.std_logic_1164.all;,entity trigate is,port(din,en :in std_logic;,dout: out std_logic);,end entity trigate;,architecture rtl of trigate is,begin,process(,din,en,) is,begin,if,(en=1),then,dout= din;,else,dout=Z;,end if;,end process;,end,architecture,rtl;,69,卫式块结构描述的三态门,architecture rtl of tri_gate is,begin,tri_gate2: block,(en=1),begin,dout dout=din;,when others = dout= Z;,end case;,end process;,end architecture rtl;,case,语句描述的三态门,70,2.,单向总线缓冲器,单向总线缓冲器通常由多个三态门组成,所有三态缓冲器的控制端连在一起,。,八位单向总线驱动器,din(0),din(1),din(2),din(3),din(4),din(5),din(6),din(7),dout(0),dout(1),dout(2),dout(3),dout(4),dout(5),dout(6),dout(7),en,en,din(0),din(1),din(2),din(3),din(4),din(5),din(6),din(7),dout(0),dout(1),dout(2),dout(3),dout(4),dout(5),dout(6),dout(7),en,71,library ieee;,use ieee.std_logic_1164.all;,entity tribuf8 is,port ( din:in std_logic_vector(7 downto 0);,dout: out std_logic_vector(7 downto 0);,en: in std_logic);,end entity tribuf8;,architecture rtl of tribuf8 is,begin,process(en,din) is,begin,if (en=1) then dout=din;,else dout= “ZZZZZZZZ”;,end if;,end process;,end architecture rtl;,Tri_buff: block,(en=1),begin,dout dout dout=,ZZZZZZZZ,;,end case;,end process tri_buf;,dout=din when en=1 else ZZZZZZZZ;,72,采用条件语句的仿真波形,采用卫式块的仿真波形,采用条件语句的,RTL,视图,73,3.,双向总线缓冲器,g,dir,功能,0,0,a=b,0,1,b=a,1,X,高阻,双向总线缓冲器真值表,74,library ieee;,use ieee.std_logic_1164.all;,entity tribigate is,port (a, b: inout std_logic_vector (7 downto 0);,g, dir: in std_logic);,end entity tribigate;,architecture rtl of tribigate is,signal aout, bout: std_logic_vector (7 downto 0);,begin,引脚框图,75,process (a, dir, g) is,begin,if (g=0)and (dir=1) then bout=a;,else bout=ZZZZZZZZ;,end if;,b=bout;,end process;,process (b,dir,g),is,begin,if( g = 0 and dir=0) then aout=b;,else aout=ZZZZZZZZ;,end if;,a=aout;,end process;,end architecture rtl;,b=a when (g = 0) and (dir = 0) else ZZZZZZZZ;,a=b when (g = 0) and (dir = 1) else “ZZZZZZZZ”;,g,dir,功能,0,0,a=b,0,1,b=a,1,X,高阻,真值表,76,注意双向总线缓冲器在功能仿真时的输入波形设置,a,和,b,的输入不要同时存在,;,设置,a,的输入,应将,b,的输入设置为“,ZZZZZZZZ”(,高阻,);,转换传输方向时,应该以双向阻塞作为间隔。,b=a when (g = 0) and (dir = 0) else ZZZZZZZZ;,a=b when (g = 0) and (dir = 1) else “ZZZZZZZZ”;,77,7.2,时序逻辑电路的,VHDL,设计,时序电路与组合电路的区别在于,时序逻辑电路多了,存储电路,部分,需要记录目前的输出信号状态,用来与输入信号一起,共同决定下一次输出信号的状态。,本节内容:,时钟信号和复位信号,触发器,寄存器,计数器,78,7.2.1,时钟信号和复位信号,1.,时钟信号的描述,时序逻辑电路的信号变化特点:,任何时序逻辑电路以,时钟信号,为驱动;电路内部信号的变化(或输出信号的变化)只发生在
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 小学资料


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!