1. 基本的组合逻辑电路.PPT
文本预览下载声明
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * VHDL Components 預先定義的邏輯函數 以套件宣告(package declaration)儲存在VHDL的程式庫,並且可在程式中視需要多次呼叫。 類似一個IC的儲存盒。 任何邏輯函數的VHDL程式都可以變成元件(component) ,然後在大型程式中使用。 VHDL Components component name_of_component is port (port definition); end component name_of_component; - 2-input XOR gate component declaration component XOR_gate is port (A, B: in bit; X: out bit); end component XOR-gate The entity XOR_gate and the architecture of the XOR_gate must also be defined VHDL Signals Signals 類似於電路板上使各元件互相連接的導線。 Inputs與outputs是利用埠(Port)敘述式在實體(entity)宣告中進行宣告。 Signals 是在結構(architecture)中宣告,使用signal敘述式。 Signal是VHDL關鍵字。 Program in VHDL using structural approach In a library in the entity and architecture of the OR_1 and the XOR_gate -- program for the XOR OR circuit entity XOR_OR_Logic is port (IN1, IN2, IN3, IN4: in bit; OUT3: out bit); end entity XOR_OR_Logic; program for the XOR OR circuit continued architecture LogicOperation of XOR_OR_Logic is component XOR_gate is port (A, B: in bit; X: out bit); end component XOR_gate; component OR_1 is port (A, B; in bit; X: out bit): end component OR_1; signal OUT1, OUT2: bit; program for the gate XOR OR circuit continued begin G1: XOR_gate port map (A=IN1, B=IN2, X=OUT1); G2: XOR_gate port map (A=IN3, B=IN4, X=OUT2); G3: OR1 port map (A=OUT1, B=OUT2, X=OUT3); end architecture LogicOperation VHDL 並行性 並行性(concurrency)表示系統可同時處理敘述式。 並行的概念適用於程式的架構(architecture)裡的begin和end之間的敘述式中。 entity combinational is port(A,B,C,D: in bit; X,Y: out bit) end entity combinational; architecture example of combinational is begin X=(A and B) or not C; Y=C or not D; end architecture example; 並行敘述式,與出現順序無關 VHDL Processes 過程(process)是用在程式的架構中,順序地或並行地執行敘述式。 信號串列(Sensitivity list)是過程(process) 必須處理的一組信號。 Name: process (sensitivity list) Declarations Begin S
显示全部