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

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

?? 220model.v

?? 一本老師推薦的經典的VHDL覆蓋基礎的入門書籍
?? V
?? 第 1 頁 / 共 5 頁
字號:
                    if (data[lpm_width-1] == 0) // positive number
                    begin
                        tmp_buf = data >> dist;
                        if ((data != 0) && ((dist >= lpm_width) || (tmp_buf == 0)))
                            underflow = 1'b1;
                    end
                    else // negative number
                    begin
                        tmp_buf = (data >> dist) | (ONES << (lpm_width - dist));
                        if ((data != ONES) && ((dist >= lpm_width-1) || (tmp_buf == ONES)))
                            underflow = 1'b1;
                    end
                end
                else if (dist > 0) // shift left
                begin
                    tmp_buf = data << dist;
                    
                    for (i=lpm_width-1; i >= lpm_width-dist; i=i-1)    
                    begin
                        if(data[i-1] != data[lpm_width-1])
                            overflow = 1'b1;    
                    end                      
                end
            end
            else
            begin
                if (direction)
                begin
                    for (i=0; i < lpm_width; i=i+1)
                        tmp_buf[i] = data[lpm_width-1]; 
                        
                    underflow = 1'b1;
                end
                else
                begin
                    tmp_buf = data << lpm_width;
                    
                    if (data != 0)
                    begin
                        overflow = 1'b1;
                    end
                end
            end
            ArithShift = {overflow,underflow,tmp_buf[lpm_width-1:0]};
        end
    endfunction // ArithShift

    // Perform rotate shift operation
    function [lpm_width+1:0] RotateShift;
        input [lpm_width-1:0] data;
        input [lpm_widthdist-1:0] dist;
        input direction;
        reg   [lpm_width-1:0] tmp_buf;
        
        begin
            tmp_buf = data;
            if ((direction) && (dist > 0)) // shift right
                tmp_buf = (data >> dist) | (data << (lpm_width - dist));
            else if (dist > 0) // shift left
                tmp_buf = (data << dist) | (data >> (lpm_width - dist));
            RotateShift = {2'bx, tmp_buf[lpm_width-1:0]};
        end
    endfunction // RotateShift

// INITIAL CONSTRUCT BLOCK
    initial
    begin
        if (lpm_shifttype != "LOGICAL" &&
            lpm_shifttype != "ARITHMETIC" &&
            lpm_shifttype != "ROTATE" &&
            lpm_shifttype != "UNUSED")          // non-LPM 220 standard
            $display("Error!  LPM_SHIFTTYPE value must be \"LOGICAL\", \"ARITHMETIC\", or \"ROTATE\".");

        if (lpm_width <= 0)
        begin
            $display("Value of lpm_width parameter must be greater than 0(ERROR)");
            $finish;
        end

        if (lpm_widthdist <= 0)
        begin
            $display("Value of lpm_widthdist parameter must be greater than 0(ERROR)");
            $finish;
        end

        for (i=0; i < lpm_width; i=i+1)
            ONES[i] = 1'b1;
    end

// ALWAYS CONSTRUCT BLOCK
    always @(data or i_direction or distance)
    begin
        if ((lpm_shifttype == "LOGICAL") || (lpm_shifttype == "UNUSED"))
            {overflow, underflow, result} = LogicShift(data, distance, i_direction);
        else if (lpm_shifttype == "ARITHMETIC")
            {overflow, underflow, result} = ArithShift(data, distance, i_direction);
        else if (lpm_shifttype == "ROTATE")
            {overflow, underflow, result} = RotateShift(data, distance, i_direction);
    end

endmodule // lpm_clshift

//START_MODULE_NAME------------------------------------------------------------
//
// Module Name     :  lpm_add_sub
//
// Description     :  Parameterized adder/subtractor megafunction.
//
// Limitation      :  n/a
//
// Results expected:  If performs as adder, the result will be dataa[]+datab[]+cin.
//                    If performs as subtractor, the result will be dataa[]-datab[]+cin-1.
//                    Also returns carry out bit and overflow status bit.
//
//END_MODULE_NAME--------------------------------------------------------------

// BEGINNING OF MODULE
`timescale 1 ps / 1 ps

// MODULE DECLARATION
module lpm_add_sub (
    dataa,     // Augend/Minuend
    datab,     // Addend/Subtrahend
    cin,       // Carry-in to the low-order bit.
    add_sub,   // If the signal is high, the operation = dataa[]+datab[]+cin.
               // If the signal is low, the operation = dataa[]-datab[]+cin-1.

    clock,     // Clock for pipelined usage.
    aclr,      // Asynchronous clear for pipelined usage.
    clken,     // Clock enable for pipelined usage.
    result,    // dataa[]+datab[]+cin or dataa[]-datab[]+cin-1
    cout,      // Carry-out (borrow-in) of the MSB.
    overflow   // Result exceeds available precision.
);

// GLOBAL PARAMETER DECLARATION
    parameter lpm_width = 1; // Width of the dataa[],datab[], and result[] ports.
    parameter lpm_representation = "SIGNED"; // Type of addition performed
    parameter lpm_direction  = "UNUSED";  // Specify the operation of the lpm_add_sub function
    parameter lpm_pipeline = 0; // Number of Clock cycles of latency
    parameter lpm_type = "lpm_add_sub";
    parameter lpm_hint = "UNUSED";

// INPUT PORT DECLARATION
    input  [lpm_width-1:0] dataa;
    input  [lpm_width-1:0] datab;
    input  cin;
    input  add_sub;
    input  clock;
    input  aclr;
    input  clken;

// OUTPUT PORT DECLARATION
    output [lpm_width-1:0] result;
    output cout;
    output overflow;

// INTERNAL REGISTER/SIGNAL DECLARATION
    reg [lpm_width-1:0] tmp_result2 [lpm_pipeline:0];
    reg [lpm_pipeline:0] tmp_cout2;
    reg [lpm_pipeline:0] tmp_overflow2;
    reg [lpm_width-1:0] tmp_result;
    reg i_cin;

// LOCAL INTEGER DECLARATION
    integer borrow;
    integer i;

// INTERNAL TRI DECLARATION
    tri1 add_sub;
    tri0 aclr;
    tri0 clock;
    tri1 clken;

    buf (i_aclr, aclr);
    buf (i_clock, clock);
    buf (i_clken, clken);
    buf (i_add_sub, add_sub);

// INITIAL CONSTRUCT BLOCK
    initial
    begin
        // check if lpm_width < 0
        if (lpm_width <= 0)
        begin
            $display("Error!  LPM_WIDTH must be greater than 0.\n");
            $finish;
        end
        if ((lpm_direction != "ADD") &&
            (lpm_direction != "SUB") &&
            (lpm_direction != "UNUSED") &&   // non-LPM 220 standard
            (lpm_direction != "DEFAULT"))    // non-LPM 220 standard
        begin
            $display("Error!  LPM_DIRECTION value must be \"ADD\" or \"SUB\".");
            $finish;
        end
        if ((lpm_representation != "SIGNED") &&
            (lpm_representation != "UNSIGNED"))
        begin
            $display("Error!  LPM_REPRESENTATION value must be \"SIGNED\" or \"UNSIGNED\".");
            $finish;
        end
        if (lpm_pipeline < 0)
        begin
            $display("Error!  LPM_PIPELINE must be greater than or equal to 0.\n");
            $finish;
        end

        for (i = 0; i <= lpm_pipeline; i = i + 1)
        begin
            tmp_result2[i] = 'b0;
            tmp_cout2[i] = 1'b0;
            tmp_overflow2[i] = 1'b0;
        end
    end

// ALWAYS CONSTRUCT BLOCK
    always @(cin or dataa or datab or i_add_sub or i_aclr)
    begin
        if (i_aclr)
            for (i = 0; i <= lpm_pipeline; i = i + 1)
            begin
                tmp_result2[i] = 1'b0;
                tmp_cout2[i] = 1'b0;
                tmp_overflow2[i] = 1'b0;
            end
        else
        begin

            // cout is the same for both signed and unsign representation.
            if ((lpm_direction == "ADD") || ((i_add_sub == 1) &&
                ((lpm_direction == "UNUSED") || (lpm_direction == "DEFAULT")) ))
            begin
                i_cin = (cin === 1'bz) ? 0 : cin;
                {tmp_cout2[lpm_pipeline], tmp_result2[lpm_pipeline]} = dataa + datab + i_cin;
                tmp_overflow2[lpm_pipeline] = tmp_cout2[lpm_pipeline];
            end
            else if ((lpm_direction == "SUB") || ((i_add_sub == 0) &&
                    ((lpm_direction == "UNUSED") || (lpm_direction == "DEFAULT")) ))
            begin
                i_cin = (cin === 1'bz) ? 1 : cin;
                borrow = (~i_cin) ? 1 : 0;
                {tmp_overflow2[lpm_pipeline], tmp_result2[lpm_pipeline]} = dataa - datab - borrow;
                tmp_cout2[lpm_pipeline] = (dataa >= (datab+borrow))?1:0;
            end

            if (lpm_representation == "SIGNED")
            begin
                // perform the addtion or subtraction operation
                if ((lpm_direction == "ADD") || ((i_add_sub == 1) &&
                    ((lpm_direction == "UNUSED") || (lpm_direction == "DEFAULT")) ))
                begin
                    tmp_result = dataa + datab + i_cin;
                    tmp_overflow2[lpm_pipeline] = ((dataa[lpm_width-1] == datab[lpm_width-1]) &&
                                                   (dataa[lpm_width-1] != tmp_result[lpm_width-1])) ?
                                                  1 : 0;
                end
                else if ((lpm_direction == "SUB") || ((i_add_sub == 0) &&
                        ((lpm_direction == "UNUSED") || (lpm_direction == "DEFAULT")) ))
                begin
                    tmp_result = dataa - datab - borrow;
                    tmp_overflow2[lpm_pipeline] = ((dataa[lpm_width-1] != datab[lpm_width-1]) &&
                                                   (dataa[lpm_width-1] != tmp_result[lpm_width-1])) ?
                                                  1 : 0;
                end
                tmp_result2[lpm_pipeline] = tmp_result;
            end
        end
    end

    always @(posedge i_clock)
    begin
        if ((!i_aclr) && (i_clken == 1))
            for (i = 0; i < lpm_pipeline; i = i + 1)
            begin
                tmp_result2[i] <= tmp_result2[i+1];
                tmp_cout2[i] <= tmp_cout2[i+1];
                tmp_overflow2[i] <= tmp_overflow2[i+1];
            end
    end

// CONTINOUS ASSIGNMENT
    assign result = tmp_result2[0];
    assign cout = tmp_cout2[0];
    assign overflow = tmp_overflow2[0];

endmodule // lpm_add_sub
// END OF MODULE

//START_MODULE_NAME------------------------------------------------------------
//
// Module Name     :  lpm_compare
//
// Description     :  Parameterized comparator megafunction. The comparator will
//                    compare between data[] and datab[] and return the status of
//                    comparation for the following operation.
//                    1) dataa[] < datab[].
//                    2) dataa[] == datab[].
//                    3) dataa[] > datab[].
//                    4) dataa[] >= datab[].
//                    5) dataa[] != datab[].
//                    6) dataa[] <= datab[].
//
// Limitation      :  n/a
//
// Results expected:  Return status bits of the comparision between dataa[] and
//                    datab[].
//
//END_MODULE_NAME--------------------------------------------------------------

// BEGINNING OF MODULE
`timescale 1 ps / 1 ps

// MODULE DECLARATION
module lpm_compare ( 
    dataa,   // Value to be compared to datab[]. (Required)
    datab,   // Value to be compared to dataa[]. (Required)
    clock,   // Clock for pipelined usage.
    aclr,    // Asynchronous clear for pipelined usage.
    clken,   // Clock enable for pipelined usage.
    
    // One of the following ports must be present.
    alb,     // High (1) if dataa[] < datab[].
    aeb,     // High (1) if dataa[] == datab[].
    agb,     // High (1) if dataa[] > datab[].
    aleb,    // High (1) if dataa[] <= datab[].
    aneb,    // High (1) if dataa[] != datab[].
    ageb     // High (1) if dataa[] >= datab[].
);

// GLOBAL PARAMETER DECLARATION
    parameter lpm_width = 1;  // Width of the dataa[] and datab[] ports. (Required)
    parameter lpm_representation = "UNSIGNED"; // Type of comparison performed: 
                                               // "SIGNED", "UNSIGNED"
    parameter lpm_pipeline = 0; // Specifies the number of Clock cycles of latency
                                // associated with the alb, aeb, agb, ageb, aleb,
                                //  or aneb output.
    parameter lpm_type = "lpm_compare";
    parameter lpm_hint = "UNUSED";

// INPUT PORT DECLARATION   
    input  [lpm_width-1:0] dataa;
    input  [lpm_width-1:0] datab;
    input  clock;
    input  aclr;
    input  clken;
    
// OUTPUT PORT DECLARATION
    output alb;
    output aeb;
    output agb;
    output aleb;
    output aneb;
    output ageb;

// INTERNAL REGISTERS DECLARATION
    reg [lpm_pipeline:0] tmp_alb2;
    reg [lpm_pipeline:0] tmp_aeb2;
    reg [lpm_pipeline:0] tmp_agb2;
    reg [lpm_pipeline:0] tmp_aleb2;
    reg [lpm_pipeline:0] tmp_aneb2;
    reg [lpm_pipeline:0] tmp_ageb2;

// LOCAL INTEGER DECLARATION
    integer i;

// INTERNAL TRI DECLARATION
    tri0 aclr;
    tri0 clock;
    tri1 clken;

    buf (i_aclr, aclr);
    buf (i_clock, clock);
    buf (i_clken, clken);

// INITIAL CONSTRUCT BLOCK
    initial
    begin
        if ((lpm_representation != "SIGNED") &&

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品免费观看| 日本怡春院一区二区| 精品久久久久久久一区二区蜜臀| av激情亚洲男人天堂| 国内精品国产成人| 狠狠色伊人亚洲综合成人| 免费观看一级欧美片| 奇米一区二区三区av| 天堂精品中文字幕在线| 毛片不卡一区二区| 韩国欧美一区二区| 成人午夜免费av| 欧美性大战久久久久久久蜜臀| 欧美在线免费视屏| 久久―日本道色综合久久| 日本一区二区三区久久久久久久久不| 国产精品青草久久| 日韩**一区毛片| 懂色av一区二区夜夜嗨| 成人a区在线观看| 在线综合+亚洲+欧美中文字幕| 日韩欧美一区二区视频| 久久久久久久久久久久久女国产乱 | 91成人在线观看喷潮| 在线观看日韩一区| 久久精品欧美一区二区三区麻豆| 一区二区高清在线| 国产91丝袜在线播放0| 一本一道综合狠狠老| 精品久久久久久久久久久院品网 | 国产精品你懂的在线| 一区二区三区欧美| 成人精品免费视频| 精品日韩一区二区| 日韩av在线播放中文字幕| 色天天综合久久久久综合片| 国产亚洲一区二区三区在线观看 | 色国产综合视频| 亚洲一区在线观看免费观看电影高清| 不卡电影一区二区三区| 国产精品久久午夜夜伦鲁鲁| 国产精品一区免费在线观看| 精品国产乱码久久久久久图片| 免费日本视频一区| 精品三级av在线| 成人久久18免费网站麻豆| 一区二区免费视频| 精品日本一线二线三线不卡| 成人午夜激情视频| 亚洲高清免费一级二级三级| 欧美日韩国产高清一区二区三区| 三级成人在线视频| 国产色婷婷亚洲99精品小说| 日本高清视频一区二区| 美女在线一区二区| 中文字幕在线播放不卡一区| 欧美性一二三区| 国产伦精品一区二区三区免费| 亚洲男人的天堂在线观看| 欧美精品一二三| 99re这里只有精品视频首页| 日韩影院免费视频| 亚洲国产精品麻豆| 中文一区一区三区高中清不卡| heyzo一本久久综合| 久久精品国产精品亚洲红杏| 尤物在线观看一区| 国产精品久久久99| 亚洲国产精品传媒在线观看| 日韩欧美国产系列| 91精品国产综合久久福利| 一本色道久久综合精品竹菊| 国产不卡视频在线观看| 国产综合一区二区| 国产主播一区二区| 激情小说欧美图片| 精品一区二区三区在线播放| 爽好多水快深点欧美视频| 亚洲精选一二三| 亚洲福利一区二区| 亚洲国产精品久久人人爱蜜臀| 亚洲黄色免费电影| 日韩电影在线免费| 美腿丝袜亚洲一区| 国产精品影视网| 懂色中文一区二区在线播放| 成人中文字幕电影| 不卡影院免费观看| 欧美日韩国产经典色站一区二区三区| 欧美三级电影在线观看| 欧美成人a∨高清免费观看| 日韩精品一区二区三区中文不卡| 精品处破学生在线二十三| 国产精品无遮挡| 亚洲一二三四在线| 免费成人结看片| 色综合欧美在线视频区| 欧洲国产伦久久久久久久| 日韩欧美不卡一区| 一区二区三区欧美激情| 韩国在线一区二区| 色88888久久久久久影院野外| 欧美一区二区福利在线| 国产精品久久影院| 久久国产精品99久久久久久老狼 | 日韩三区在线观看| 国产欧美日韩麻豆91| 亚洲成人午夜影院| 99r国产精品| 国产精品另类一区| 国产一区二区三区精品欧美日韩一区二区三区 | 韩国v欧美v亚洲v日本v| 精品视频在线看| 亚洲欧美日韩中文字幕一区二区三区| 久久精品久久99精品久久| 色成年激情久久综合| 最新热久久免费视频| 豆国产96在线|亚洲| 精品国产自在久精品国产| 香蕉成人伊视频在线观看| 91免费国产在线| 亚洲日本一区二区三区| 成人午夜在线播放| 国产精品妹子av| 99在线热播精品免费| 国产精品久久免费看| 99精品一区二区三区| 亚洲乱码国产乱码精品精小说| bt欧美亚洲午夜电影天堂| 国产精品久久久久永久免费观看| 精品一区二区三区免费观看| 欧美一级xxx| 国产精品538一区二区在线| 国产欧美日韩精品a在线观看| 国产精品一区二区久久不卡| 欧美电影免费观看高清完整版在线 | 国内久久精品视频| 久久综合色天天久久综合图片| 国产精品一级片| 一区二区不卡在线播放| 欧美喷水一区二区| 日韩中文字幕一区二区三区| 久久久99精品免费观看| 97久久精品人人做人人爽50路 | 国产99久久久国产精品潘金网站| 国产精品久久午夜夜伦鲁鲁| 欧美性生活大片视频| 国产精品一二一区| 亚洲一区二区三区美女| 亚洲国产激情av| 欧美电影免费观看高清完整版在线| 国产白丝精品91爽爽久久| 一区二区成人在线| 欧美高清在线一区二区| 日韩视频在线一区二区| 欧美综合亚洲图片综合区| av亚洲精华国产精华精华| 极品销魂美女一区二区三区| 午夜一区二区三区在线观看| 中文无字幕一区二区三区| 日韩欧美一区二区免费| 欧美日高清视频| 欧美日韩视频不卡| 欧美日韩精品三区| 欧美三级电影精品| 欧美在线免费观看亚洲| 91色综合久久久久婷婷| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 精品视频一区二区三区免费| 日韩**一区毛片| 五月天欧美精品| 亚洲午夜免费电影| 亚洲一区二区三区自拍| 亚洲欧美国产77777| 亚洲欧洲av一区二区三区久久| 国产精品久久久久桃色tv| 日韩一区在线播放| 亚洲欧美欧美一区二区三区| 亚洲午夜视频在线观看| 偷偷要91色婷婷| 日本人妖一区二区| av资源网一区| 精品视频在线视频| 欧美精品一区二区蜜臀亚洲| 国产日韩欧美a| 性做久久久久久| 国产一区二区三区久久悠悠色av| 国产不卡免费视频| 欧美午夜精品免费| 久久精品一区二区三区四区| 国产精品成人一区二区三区夜夜夜| 国产精品欧美一级免费| 日韩国产一二三区| 久久成人av少妇免费| 欧美色视频一区| 国产精品久久久久久久久搜平片| 亚洲免费高清视频在线| 国产成人精品亚洲日本在线桃色| 欧美性极品少妇| 亚洲欧美激情插|