【正文】
sel:=0。 end mux41。 entity mux41 is port(s4,s3,s2,s1: in std_logic。 例:根據(jù)輸入確定輸出值 library ieee。 when 5 to 15 = out_1 = ‘0’ 。 end case 。 case value is 分支條件不包含 2到 15 when 0 = out_1 = ‘1’ 。 signal out_1 : bit 。 對 std_logc, std_logic_vector數(shù)據(jù)類型要特別注意使用 others分支條件。 3) CASE語句執(zhí)行時必須選中,且只能選中一 個分支條件。 格式如下: case 表達(dá)式 is when 分支 條件 = 順序處理語句; when 分支條件 = 順序處理語句; when 分支條件 = 順序處理語句; end case; ┇ 其中的分支條件可有以下的形式: when 值 = 順序處理語句; when 值 to 值 = 順序處理語句; when 值 |值 |值 |… |值 = 順序處理語句; 以上三種方式的混合; when others = 順序處理語句; Case 語句使用注意: 1)分支條件的值必須在表達(dá)式的取值范圍內(nèi)。 分為五種: if 語句、 case 語句、 loop 語句、 next 語句、 exit 語句 case 語句 case 語句常用來描述總線或編碼、譯碼行為。 end process 。 temp=temp xor (sig(3) and indicator(3))。 temp=temp xor (sig(1) and indicator(1))。 …… process(indicator, sig, temp) begin temp= ‘0’ 。 end process 。 temp :=temp xor (sig(3) and indicator(3))。 temp :=temp xor (sig(1) and indicator(1))。 begin temp := ‘0’ 。 end process。 end loop 。 begin temp := ‘0’ 。 end rtl。 b := a 。 結(jié)果是 a 和 b 的值互換 變量賦值: architecture rtl of var is begin process variable a,b:std_logic。 end process 。 定義信號