亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? altera_mf.vhd

?? 一本老師推薦的經典的VHDL覆蓋基礎的入門書籍
?? VHD
?? 第 1 頁 / 共 5 頁
字號:
-- This function converts an integer to a string
function INT_TO_STR_RAM (value : in integer) return string is
variable ivalue : integer := 0;
variable index  : integer := 0;
variable digit : integer := 0;
variable line_no: string(8 downto 1) := "        ";
begin
    ivalue := value;
    index := 1;

    while (ivalue > 0) loop
        digit := ivalue MOD 10;
        ivalue := ivalue/10;
        case digit is
            when 0 => line_no(index) := '0';
            when 1 => line_no(index) := '1';
            when 2 => line_no(index) := '2';
            when 3 => line_no(index) := '3';
            when 4 => line_no(index) := '4';
            when 5 => line_no(index) := '5';
            when 6 => line_no(index) := '6';
            when 7 => line_no(index) := '7';
            when 8 => line_no(index) := '8';
            when 9 => line_no(index) := '9';
            when others =>
                ASSERT FALSE
                REPORT "Illegal number!"
                SEVERITY ERROR;
        end case;
        index := index + 1;
    end loop;

    return line_no;
end INT_TO_STR_RAM;

function INT_TO_STR_ARITH (value : in integer) return string is
    variable ivalue : integer := 0;
    variable index : integer := 0;
    variable digit : integer := 0;
    variable temp: string(10 downto 1) := "0000000000";
begin
    ivalue := value;
    index := 1;

    while (ivalue > 0) loop
        digit := ivalue mod 10;
        ivalue := ivalue/10;

        case digit is
            when 0 => temp(index) := '0';
            when 1 => temp(index) := '1';
            when 2 => temp(index) := '2';
            when 3 => temp(index) := '3';
            when 4 => temp(index) := '4';
            when 5 => temp(index) := '5';
            when 6 => temp(index) := '6';
            when 7 => temp(index) := '7';
            when 8 => temp(index) := '8';
            when 9 => temp(index) := '9';
            when others =>
                ASSERT FALSE
                REPORT "Illegal number!"
                SEVERITY ERROR;
        end case;
        index := index + 1;
    end loop;

    if value < 0 then
        return '-'& temp(index downto 1);
    else
        return temp(index downto 1);
    end if;
end INT_TO_STR_ARITH;

-- This function converts a hexadecimal number to an integer
function HEX_STR_TO_INT (str : in string) return integer is
variable len : integer := str'length;
variable ivalue : integer := 0;
variable digit : integer := 0;
begin
    for i in len downto 1 loop
        case str(i) is
            when '0' => digit := 0;
            when '1' => digit := 1;
            when '2' => digit := 2;
            when '3' => digit := 3;
            when '4' => digit := 4;
            when '5' => digit := 5;
            when '6' => digit := 6;
            when '7' => digit := 7;
            when '8' => digit := 8;
            when '9' => digit := 9;
            when 'A' => digit := 10;
            when 'a' => digit := 10;
            when 'B' => digit := 11;
            when 'b' => digit := 11;
            when 'C' => digit := 12;
            when 'c' => digit := 12;
            when 'D' => digit := 13;
            when 'd' => digit := 13;
            when 'E' => digit := 14;
            when 'e' => digit := 14;
            when 'F' => digit := 15;
            when 'f' => digit := 15;
            when others =>
                ASSERT FALSE
                REPORT "Illegal character "&  str(i) & "in Intel Hex File! "
                SEVERITY ERROR;
        end case;
        ivalue := ivalue * 16 + digit;
    end loop;
    return ivalue;
end HEX_STR_TO_INT;

-- This procedure "cuts" the str_line into desired length
procedure SHRINK_LINE (str_line : inout line; pos : in integer) is
subtype nstring is string(1 to pos);
variable str : nstring;
begin
    if (pos >= 1) then
        read(str_line, str);
    end if;
end;
end ALTERA_COMMON_CONVERSION;
-- END OF PACKAGE

---START_ENTITY_HEADER---------------------------------------------------------
--
-- Entity Name     :  altaccumulate
--
-- Description     :  Parameterized accumulator megafunction. The accumulator
-- performs an add function or a subtract function based on the add_sub
-- parameter. The input data can be signed or unsigned.
--
-- Limitation      : n/a
--
-- Results expected:  result - The results of add or subtract operation. Output
--                             port [width_out-1 .. 0] wide.
--                    cout   - The cout port has a physical interpretation as 
--                             the carry-out (borrow-in) of the MSB. The cout
--                             port is most meaningful for detecting overflow
--                             in unsigned operations. The cout port operates
--                             in the same manner for signed and unsigned
--                             operations.
--                    overflow - Indicates the accumulator is overflow.
--
---END_ENTITY_HEADER-----------------------------------------------------------

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;

-- BEGINNING OF ENTITY
entity altaccumulate is
    -- GENERIC DECLARATION
    generic (
        width_in           : integer := 4;      -- Required
        width_out          : integer := 8;      -- Required
        lpm_representation : string  := "UNSIGNED";
        extra_latency      : integer := 0;
        use_wys            : string  := "ON";
        lpm_hint           : string  := "UNUSED";
        lpm_type           : string  := "altaccumulate"
    );

    -- PORT DECLARATION
    port (
        -- INPUT PORT DECLARATION
        cin       : in std_logic := 'Z';
        data      : in std_logic_vector(width_in -1 downto 0);  -- Required port
        add_sub   : in std_logic := '1';
        clock     : in std_logic;   -- Required port
        sload     : in std_logic := '0';
        clken     : in std_logic := '1';
        sign_data : in std_logic := '0';
        aclr      : in std_logic := '0';

        -- OUTPUT PORT DECLARATION
        result    : out std_logic_vector(width_out -1 downto 0) := (others => '0'); -- Required port
        cout      : out std_logic := '0';
        overflow  : out std_logic := '0'
    );
end altaccumulate;
-- END OF ENTITY

-- BEGINNING OF ARCHITECTURE
architecture behaviour of altaccumulate is

-- TYPE DECLARATION
type pipeline is array (extra_latency-1 downto 0) of std_logic_vector (width_out+1 downto 0);

-- SIGNAL DECLARATION
signal temp_sum : std_logic_vector (width_out downto 0) := (others => '0');
signal cout_int : std_logic := '0';
signal overflow_int : std_logic := '0';
signal result_int : std_logic_vector (width_out+1 downto 0) := (others => '0');

signal result_pipe : pipeline := (others => (others => '0'));

signal head : integer := 0;

begin

    MSG: process
    begin
        if( width_in <= 0 ) then
            ASSERT FALSE
            REPORT "Error! Value of width_in parameter must be greater than 0."
            SEVERITY ERROR;
        end if;

        if( width_out <= 0 ) then
            ASSERT FALSE
            REPORT "Error! Value of width_out parameter must be greater than 0."
            SEVERITY ERROR;
        end if;
        
        if( extra_latency > width_out ) then
            ASSERT FALSE
            REPORT "Info: Value of extra_latency parameter should be lower than width_out parameter for better performance/utilization."
            SEVERITY NOTE;
        end if;
        
        if( width_in > width_out ) then
            ASSERT FALSE
            REPORT "Error! Value of width_in parameter should be lower than or equal to width_out."
            SEVERITY ERROR;
        end if;
        wait;
    end process MSG;

    -- PROCESS DECLARATION
    ADDSUB : process (data, add_sub, sload, cin, sign_data,
                      result_int (width_out-1 downto 0))

    -- VARIABLE DECLARATIOM
    variable fb_int : std_logic_vector (width_out downto 0) := (others => '0');
    variable data_int : std_logic_vector (width_out-1 downto 0) := (others => '0');
    variable zeropad : std_logic_vector ((width_out - width_in)-1 downto 0) := (others => '0');
    variable temp_sum_int : std_logic_vector (width_out downto 0) := (others => '0');
    variable cout_temp, borrow : std_logic;
    variable result_full : std_logic_vector (width_out downto 0);
    variable temp_sum_zero : std_logic_vector (width_out downto 0) := (others => '0');
    variable cin_int : std_logic;
    begin

        if ((LPM_REPRESENTATION = "SIGNED") or (sign_data = '1')) then
            zeropad := (others => data (width_in-1));
        else
            zeropad := (others => '0');
        end if;

        if (sload = '1') then
            fb_int := (others => '0');
        else
            fb_int := ('0' & result_int (width_out-1 downto 0));
        end if;

        if ((data (0) = '1') or (data (0) = '0')) then
            data_int := (zeropad & data);
        end if;

        -- If cin is omitted (i.e. cin = 'z'), cin default is 0 for add operation
        -- and 1 for subtract operation.
        if ((cin /= '0') and (cin /= '1')) then
            cin_int := not add_sub;
        else
            cin_int := cin;
        end if;

        if (sload = '1') then
            temp_sum_int := unsigned(temp_sum_zero) + unsigned(data_int);
        else
            if (add_sub = '1') then
                temp_sum_int := unsigned(temp_sum_zero) + unsigned(fb_int) +
                                unsigned(data_int) + cin_int;
                cout_temp := temp_sum_int(width_out);
            else
                borrow := not cin_int;
                if ((borrow /= '1') and (borrow /= '0')) then
                    borrow := '0';
                end if;

                temp_sum_int := unsigned(temp_sum_zero) + unsigned (fb_int) -
                                unsigned (data_int) - borrow;
                result_full := unsigned(temp_sum_zero) + unsigned(data_int) +
                               borrow;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色av网站在线| 视频一区二区中文字幕| aaa欧美色吧激情视频| 中文字幕免费观看一区| 波多野结衣视频一区| 中文字幕中文在线不卡住| 色综合久久中文字幕| 亚洲成人你懂的| 欧美tk—视频vk| 国产精品中文字幕一区二区三区| 国产日韩精品久久久| 91免费在线视频观看| 日韩国产精品91| 久久免费的精品国产v∧| av高清不卡在线| 五月天激情综合网| 欧美精品一区二区三区很污很色的 | 色美美综合视频| 石原莉奈一区二区三区在线观看| 欧美一区2区视频在线观看| 国产精品2024| 亚洲女与黑人做爰| 日韩三级精品电影久久久| 国产福利不卡视频| 午夜精品久久久久久| 国产丝袜欧美中文另类| 欧美在线高清视频| 国产精品亚洲综合一区在线观看| 亚洲欧美一区二区三区久本道91 | 欧美视频精品在线观看| 麻豆成人久久精品二区三区小说| 欧美国产激情一区二区三区蜜月| 在线观看视频一区| 国产美女在线精品| 亚洲成a人v欧美综合天堂| 久久久久88色偷偷免费| 欧美视频一区二区三区四区| 国产一区二区三区最好精华液| 一区二区三区中文字幕| 国产亚洲欧美在线| 在线不卡中文字幕播放| 99在线精品观看| 精品亚洲成av人在线观看| 亚洲国产视频网站| 国产精品久久久久天堂| 精品国产乱子伦一区| 欧美三级视频在线播放| 成人午夜av电影| 日产国产欧美视频一区精品| 中文字幕亚洲欧美在线不卡| 欧美成人vr18sexvr| 欧洲精品中文字幕| av午夜一区麻豆| 国产成人av一区二区三区在线观看| 亚洲丰满少妇videoshd| 亚洲视频一二区| 中文字幕欧美日本乱码一线二线 | 国产麻豆午夜三级精品| 性欧美大战久久久久久久久| 亚洲四区在线观看| 国产欧美日韩在线| 精品国产99国产精品| 欧美一区欧美二区| 884aa四虎影成人精品一区| 色哟哟精品一区| 暴力调教一区二区三区| 成人精品小蝌蚪| 国产福利一区二区三区视频在线 | 91麻豆自制传媒国产之光| 成人免费视频一区| 国产成人精品免费在线| 国产一区二区三区久久久| 久久精品国产99久久6| 麻豆视频一区二区| 毛片不卡一区二区| 卡一卡二国产精品 | 亚洲欧洲国产专区| 综合欧美一区二区三区| 日韩美女久久久| 亚洲男人的天堂在线aⅴ视频| 17c精品麻豆一区二区免费| 国产精品国产精品国产专区不蜜| 久久精品一区二区三区四区| 国产三级欧美三级日产三级99 | 国产午夜一区二区三区| 国产午夜一区二区三区| 国产欧美精品一区| 亚洲欧美综合网| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲嫩草精品久久| 五月婷婷激情综合| 精品亚洲porn| 成人一区二区三区视频在线观看| 成人av午夜影院| 91麻豆精品在线观看| 欧美日韩一区二区三区四区| 欧美一区二区三区白人| 欧美精品一区男女天堂| 国产精品全国免费观看高清| 日韩伦理av电影| 亚洲高清免费视频| 麻豆精品一区二区三区| 国产伦精一区二区三区| 91丨九色丨国产丨porny| 欧美日本韩国一区二区三区视频| 日韩午夜电影av| 国产欧美视频一区二区| 一区二区三区.www| 久久国产三级精品| av一区二区久久| 欧美日本韩国一区| 国产午夜亚洲精品午夜鲁丝片| 亚洲精品中文字幕乱码三区 | 久久99国产乱子伦精品免费| 成人午夜电影网站| 欧美精品久久一区| 日韩午夜在线影院| 国产精品对白交换视频| 午夜久久久影院| 国产成人午夜视频| 欧美日韩成人高清| 国产精品欧美极品| 人人爽香蕉精品| 99久久国产免费看| 日韩免费看网站| 夜夜精品视频一区二区| 免费观看久久久4p| 一本久久综合亚洲鲁鲁五月天 | 高清不卡一区二区| 欧美精三区欧美精三区| 中文av一区二区| 精品写真视频在线观看| 91同城在线观看| 久久精品亚洲一区二区三区浴池| 亚洲国产精品一区二区www| 国产乱子伦视频一区二区三区 | 91在线国产福利| 日韩欧美一二三| 亚洲va天堂va国产va久| 成人免费视频一区二区| 精品国产成人在线影院| 亚洲国产一区二区三区青草影视| 成人丝袜视频网| 精品国产第一区二区三区观看体验| 亚洲国产一区二区在线播放| 9人人澡人人爽人人精品| 精品女同一区二区| 视频一区免费在线观看| 欧美伊人久久大香线蕉综合69 | 国产美女精品在线| 91精品国产欧美日韩| 五月天视频一区| 欧美日韩一区二区在线视频| 亚洲人123区| 99久久777色| 国产精品欧美精品| 成人午夜视频在线| 中文字幕乱码久久午夜不卡| 国产一区 二区 三区一级| 制服.丝袜.亚洲.中文.综合| 亚洲午夜在线视频| 欧美日韩一区精品| 婷婷国产v国产偷v亚洲高清| 欧美三级日韩三级国产三级| 亚洲卡通欧美制服中文| 91丨porny丨在线| 国产蜜臀97一区二区三区| 国产精品12区| 中文字幕精品一区二区三区精品| 国产精一品亚洲二区在线视频| 精品国产乱码久久久久久1区2区 | 国产精品青草综合久久久久99| 国产一区二区免费在线| 久久精品免费在线观看| 丰满白嫩尤物一区二区| 国产精品色一区二区三区| 成+人+亚洲+综合天堂| 日韩美女精品在线| 欧美在线视频全部完| 亚洲国产精品久久不卡毛片 | 欧美老女人第四色| 午夜精品aaa| 精品国产免费久久| 成人性生交大合| 亚洲欧美日韩在线| 在线观看一区日韩| 天天免费综合色| 欧美videos大乳护士334| 国产精品888| 亚洲欧洲一区二区三区| 色婷婷久久综合| 视频一区二区三区在线| 久久综合九色综合欧美就去吻| 成人免费观看男女羞羞视频| 成人欧美一区二区三区1314| 欧美无砖砖区免费| 久久精品国产99| 亚洲视频一二三| 日韩欧美视频一区| av激情成人网|