【正文】
器: 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 7 方法 1:使用邏輯左移運算符 library ieee。 use 。 outp : out std_logic_vector(7 downto 0))。 architecture rtl of decoder is begin outp=“ 00000001” sll(conv_integer(inp))。 8 方法 2:使用 process語句 library ieee。 use 。 outp : out std_logic_vector(7 downto 0))。 architecture rtl of decoder is begin process(inp) begin outp=(others=’ 0’ )。 end process。 9 方法 3:使用 case 語句實現(xiàn)。 三態(tài)門及總線緩沖器 VHDL語言通過指定大寫的 Z值表示高阻狀態(tài) a : std_logic。 指定高阻狀態(tài)如下: a = ‘ Z’ 。 18 1)三態(tài)門電路描述 19 三態(tài)門仿真結(jié)果: 20 2)單向總線緩沖器 21 3)雙向總線緩沖器 22 二 時序邏輯電路設(shè)計 觸發(fā)器、寄存器、計數(shù)器、分頻器、信號發(fā)生器等。 23 如: process (clock_signal) begin if (clock_edge_condition) then signal_out = signal_in 。 end process 。 如: process begin wait until (clock_edge_condition)。 ┇ 其它時序語句 ┇ end process 。 。 3)時鐘邊沿的描述 時鐘上升沿: ( clock’ event and clock = ‘ 1’) 時鐘下降沿: ( clock’ event and clock = ‘ 0’)