嘗試實現數組的sum方法。將函數的返回值存儲到Integer中。爲什麼我得到的輸出是48而不是560? program test;
class check2;
logic [7:0] a [3:0] = '{10,20,30,500};
function void dis();
int unsigned ch;
ch = a.sum()+16'd0;
$di
我想開發一個代碼,它像一個邏輯計算器一樣工作;我已經成功地編譯了代碼和測試平臺,沒有任何錯誤。下面是代碼: module AriLogCal(
input logic [3:0] OpA, OpB, //Operands A and B. The two numbers we will operate on.
input logic [2:0] DoOpt, /