精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • type row is array ( 0 to 7) of std_logic; signal x1 :row; signal y1:std_logic_vector(0 to 7);

    type row is array ( 0 to 7) of std_logic; signal x1 :row; signal y1:std_logic_vector(0 to 7);
    x1(0 to3)
    英語人氣:271 ℃時間:2020-07-10 06:05:58
    優(yōu)質(zhì)解答
    --定義matrix_index 為數(shù)組
    TYPE matrix_index is array (3 downto 0) of std_logic_vector(7 downto 0);
    SIGNAL a:matrix_index;--定義了數(shù)組a[4],即數(shù)組元素為a[0],a[1],a[2],a[3]
    constant R :matrix_index:=( x"15",x"0F",x"0A",x"06");--定義了常數(shù)數(shù)組R[4]
    --使用時跟C語言中一樣,加下標(biāo)就可以了,上面是用downto定義了方向,故R[0]是最后一項(xiàng),如在R數(shù)組中R[0]=X"06",R[3]=X"15"
    以上不知道說清楚了沒,
    我看還是補(bǔ)充一段參考程序吧
    ---------------------------------------
    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.std_logic_arith.all;
    use ieee.std_logic_unsigned.all;
    ENTITY shift_row_inv IS
    PORT(
    shiftrow_in :IN STD_LOGIC_VECTOR(127 DOWNTO 0);
    shiftrow_out :OUT STD_LOGIC_VECTOR(127 DOWNTO 0)
    );
    END shift_row_inv;
    ARCHITECTURE beh OF shift_row_inv IS
    -- type describing the byte array consisting of 16 byte matrix array
    TYPE matrix_index is array (15 downto 0) of std_logic_vector(7 downto 0);
    SIGNAL b,c :matrix_index;
    BEGIN
    --initial mapping of input into a byte matrix array named b
    matrix_mapping:PROCESS(shiftrow_in)
    BEGIN
    FOR i IN 15 DOWNTO 0 LOOP
    \x05b(15-i) <= shiftrow_in(8*i+7 DOWNTO 8*i);
    END LOOP;
    END PROCESS matrix_mapping;
    --shift row transformation
    --\x05 b(i)\x05 -->\x05\x05c(i)
    --
    -- | 0 4 8 12 | | 0 4 8 12 | (no shift)
    -- | 1 5 9 13 | ==> | 13 1 5 9 | ( 1 right shift)
    -- | 2 6 10 14 | | 10 14 2 6 | ( 2 right shift)
    -- | 3 7 11 15 | | 7 11 15 3 | ( 3 right shift)
    --shifted first column
    c(0) <= b(0);
    c(1) <= b(13);
    c(2) <= b(10);
    c(3) <= b(7);
    --shifted second column
    c(4) <= b(4);
    c(5) <= b(1);
    c(6) <= b(14);
    c(7) <= b(11);
    --shfited third column
    c(8) <= b(8);
    c(9) <= b(5);
    c(10) <= b(2);
    c(11) <= b(15);
    --shifted forth column
    c(12) <= b(12);
    c(13) <= b(9);
    c(14) <= b(6);
    c(15) <= b(3);
    --mapping temporary c vector into shiftedrow output
    matrix_mapping_back:PROCESS(c)
    BEGIN
    FOR i IN 15 DOWNTO 0 LOOP
    \x05shiftrow_out(8*i+7 DOWNTO 8*i) <= c(15-i);
    END LOOP;
    END PROCESS matrix_mapping_back;
    END beh;
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點(diǎn),以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機(jī)版