第六讲VHDL复杂电路描述方法课件.pptx
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《第六讲VHDL复杂电路描述方法课件.pptx》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 第六 VHDL 复杂 电路 描述 方法 课件
- 资源描述:
-
1、第六讲 复杂电路的描述方法ECE 545 Introduction to VHDLVHDL for SpecificationVHDL for SimulationVHDL for SynthesisECE 545 Introduction to VHDLLevels of design descriptionAlgorithmic levelRegister Transfer LevelLogic(gate)levelCircuit(transistor)levelPhysical(layout)levelLevel of description most suitable for synt
2、hesisECE 545 Introduction to VHDLRegister Transfer Logic(RTL)Design Description Combinational Logic Combinational LogicRegistersTodays TopicECE 545 Introduction to VHDLVHDL Design StylesComponents andinterconnectsstructuralVHDL Design StylesdataflowConcurrent statementsbehavioral Registers State mac
3、hines Test benchesSequential statementsSubset most suitable for synthesis VHDLVHDL的执行语句的执行语句描述结构体中电路硬件的变化特点;描述结构体中电路硬件的变化特点;结构体中的任何执行语句都是并行语句;结构体中的任何执行语句都是并行语句;并行语句的种类有:并行语句的种类有:赋值类语句:数据流描述赋值类语句:数据流描述 (逻辑函数的运算逻辑函数的运算)元件类语句:结构描述元件类语句:结构描述 (逻辑符号的连接)(逻辑符号的连接)进程语句:行为描述进程语句:行为描述 (电路功能的流程)(电路功能的流程)ECE 545
4、 Introduction to VHDLXOR3 ExampleECE 545 Introduction to VHDLEntity(XOR3 Gate)entity XOR3 is port(A:in STD_LOGIC;B:in STD_LOGIC;C:in STD_LOGIC;RESULT:out STD_LOGIC );end XOR3;ECE 545 Introduction to VHDLDataflow Architecture(XOR3 Gate)architecture XOR3_DATAFLOW of XOR3 issignal U1_OUT:STD_LOGIC;begi
5、n U1_OUT=A xor B;RESULT A,I2=B,Y =U1_OUT);U2:XOR2 port map(I1=U1_OUT,I2=C,Y =RESULT);end XOR3_STRUCTURAL;I1I2YXOR2ABCRESULTU1_OUTXOR3ABCRESULTXOR3ECE 545 Introduction to VHDLBehavioral Architecture(XOR Gate)architecture XOR3_BEHAVIORAL of XOR3 isbeginXOR3_BEHAVE:process(A,B,C)beginif(A xor B xor C)=
6、1)thenRESULT=1;elseRESULT=0;end if;end process XOR3_BEHAVE;end XOR3_BEHAVIORAL;ECE 545 Introduction to VHDLDataflow Description Describes how data moves through the system and the various processing steps.Data Flow uses series of concurrent statements to realize logic.Concurrent statements are evalu
7、ated at the same time;thus,order of these statements doesnt matter.Data Flow is most useful style when series of Boolean equations can represent a logic.ECE 545 Introduction to VHDLData-flow VHDL concurrent signal assignment ()conditional concurrent signal assignment (when-else)selected concurrent s
8、ignal assignment (with-select-when)generate scheme for equations (for-generate)Major instructionsConcurrent statementsECE 545 Introduction to VHDLData-flow VHDL concurrent signal assignment ()conditional concurrent signal assignment (when-else)selected concurrent signal assignment (with-select-when)
9、generate scheme for equations (for-generate)Major instructionsConcurrent statementsECE 545 Introduction to VHDLData-flow VHDL:Example0 0 0 1 0 1 1 1 c i 1+0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 c i x i y i 000111100 1 x i y i c i 1 1 1 1 s i x i y i c i =000111100 1 x i y i c i 1 1 1 1 c i
10、1+x i y i x i c i y i c i+=c i x i y i s i c i 1+(a)Truth table(b)Karnaugh maps(c)Circuit 0 1 1 0 1 0 0 1 s i ECE 545 Introduction to VHDLData-flow VHDL:ExampleLIBRARY ieee;USE ieee.std_logic_1164.all;ENTITY fulladd ISPORT(x,y,Cin:IN STD_LOGIC;s,Cout:OUT STD_LOGIC);END fulladd;ARCHITECTURE LogicFunc
11、 OF fulladd ISBEGINs=x XOR y XOR Cin;Cout=(x AND y)OR(Cin AND x)OR(Cin AND y);END LogicFunc;ECE 545 Introduction to VHDLLogic Operators Logic operators Logic operators precedenceand or nand nor xor not xnor notand or nand nor xor xnorHighestLowestECE 545 Introduction to VHDL Wanted:Y=ab+cdIncorrectY
12、=a and b or c and d equivalent toY=(a and b)or c)and d equivalent toY=(ab+c)dCorrectY=(a and b)or(c and d)No Implied Precedence ECE 545 Introduction to VHDLConcatenationsignal A:STD_LOGIC_VECTOR(3 downto 0);signal B:STD_LOGIC_VECTOR(3 downto 0);signal C,D,E:STD_LOGIC_VECTOR(7 downto 0);A=”0000”;B=”1
13、111”;C=A&B;-C=”00001111”D=0&”0001111”;-D=”00001111”E=0&0&0&0&1&1&1&1;-E=”00001111”ECE 545 Introduction to VHDLRotations in VHDLA(3)A(2)A(1)A(0)A(2)A(1)A(0)A(3)A1A_rotL=A(2 downto 0)&A(3)ECE 545 Introduction to VHDLArithmetic Functions in VHDL(1)To use basic arithmetic operations involving std_logic_
14、vectors you need to include thefollowing library packages:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;ECE 545 Introduction to VHDLArithmetic Functions in VHDL(2)You can use standard+,-operatorsto perform addition and subtraction:signal A:STD_LOGIC_VECTOR(3 downto 0);sign
15、al B:STD_LOGIC_VECTOR(3 downto 0);signal C:STD_LOGIC_VECTOR(3 downto 0);C=A+B;ECE 545 Introduction to VHDLData-flow VHDL concurrent signal assignment ()conditional concurrent signal assignment (when-else)selected concurrent signal assignment (with-select-when)generate scheme for equations (for-gener
16、ate)Major instructionsConcurrent statementsECE 545 Introduction to VHDLData Flow Instructions(1)target_signal=value1 when condition1 else value2 when condition2 else .valueN-1 when conditionN-1 else valueN;When-Else.Value NValue N-1Condition N-1Condition 2Condition 1Value 2Value 1Target SignalECE 54
17、5 Introduction to VHDLOperators Relational operators Logic and relational operators precedence=/=not=/=and or nand nor xor xnorHighestLowestECE 545 Introduction to VHDL compare a=bcIncorrect when a=b and c else equivalent to when(a=b)and c else Correct when a=(b and c)else Priority of logic and rela
18、tional operators ECE 545 Introduction to VHDLData-flow VHDL concurrent signal assignment ()conditional concurrent signal assignment (when-else)selected concurrent signal assignment (with-select-when)generate scheme for equations (for-generate)Major instructionsConcurrent statementsECE 545 Introducti
19、on to VHDLData Flow Instructions(2)with choice_expression select target_signal=expression1 when choices1,expression2 when choices2,.expressionN when choicesN;With-Selectchoices1choices2choicesNexpression1target_signalchoice expressionexpression2expressionNECE 545 Introduction to VHDLMLU ExampleECE 5
20、45 Introduction to VHDLMLU:Block DiagramBANEG_ANEG_BIN0IN1IN2IN3OUTPUTSEL1SEL0MUX_4_1L0L1NEG_YYY1A1B1MUX_0MUX_1MUX_2MUX_3ECE 545 Introduction to VHDLMLU:Entity Declarationlibrary IEEE;use IEEE.STD_LOGIC_1164.all;entity MLU is port(NEG_A:in STD_LOGIC;NEG_B:in STD_LOGIC;NEG_Y:in STD_LOGIC;A:in STD_LOG
21、IC;B:in STD_LOGIC;L1:in STD_LOGIC;L0:in STD_LOGIC;Y:out STD_LOGIC );end MLU;ECE 545 Introduction to VHDLMLU:Architecture Declarative Sectionarchitecture MLU_DATAFLOW of MLU issignal A1:STD_LOGIC;signal B1:STD_LOGIC;signal Y1:STD_LOGIC;signal MUX_0:STD_LOGIC;signal MUX_1:STD_LOGIC;signal MUX_2:STD_LO
22、GIC;signal MUX_3:STD_LOGIC;signal L:STD_LOGIC_VECTOR(1 downto 0);ECE 545 Introduction to VHDLMLU-Architecture BodybeginA1=not A when(NEG_A=1)elseA;B1=not B when(NEG_B=1)else B;Y=not Y1 when(NEG_Y=1)elseY1;MUX_0=A1 and B1;MUX_1=A1 or B1;MUX_2=A1 xor B1;MUX_3=A1 xnor B1;L=L1&L0;with(L)select Y1=MUX_0
23、when 00,MUX_1 when 01,MUX_2 when 10,MUX_3 when others;end MLU_DATAFLOW;ECE 545 Introduction to VHDLData-flow VHDL concurrent signal assignment ()conditional concurrent signal assignment (when-else)selected concurrent signal assignment (with-select-when)generate scheme for equations (for-generate)Maj
24、or instructionsConcurrent statementsECE 545 Introduction to VHDLPARITY ExampleECE 545 Introduction to VHDLPARITY:Block DiagramECE 545 Introduction to VHDLFor Generate StatementFor Generatename:for parameter_specification generate Declaration Statements begin Concurrent Statements end generate name;E
25、CE 545 Introduction to VHDLPARITY:Entity Declarationlibrary IEEE;use IEEE.STD_LOGIC_1164.all;entity PARITY is port(Parity_in:in STD_LOGIC_VECTOR(7 downto 0);Parity_out:out STD_LOGIC );end PARITY;ECE 545 Introduction to VHDLPARITY:Block DiagramXor_out(1)Xor_out(2)Xor_out(3)Xor_out(4)Xor_out(5)Xor_out
展开阅读全文