verilog

    0熱度

    2回答

    我正在編寫一個Verilog程序,它將反覆運行並將變量clk的值從0更改爲1,回到0等等,運行無限次。以下是該模塊的代碼: module FirstQuestion( output clk ); reg clk; initial begin while(1) begin clk = 0; #10 clk = 1; end

    0熱度

    3回答

    我在寫代碼來實現異步復位d flipfip,但[email protected]線呈現出語法錯誤: `timescale 1ns/1ps module Dflipflop( input D, input reset, input clk, output Q ); reg Q; initial begin if(reset==1) //clear the out

    0熱度

    1回答

    我有一個pdf函數,它是一個指數函數除以定積分。我有兩個問題: 1)如何在HSPICE中定義我自己的PDF? (我發現HSPICE具有高斯分佈,但這不是我正在尋找的) 2)如何解決HSPICE中的定積分? 我可以用Verilog-A中的模型解決這兩個問題嗎? 在此先感謝!

    0熱度

    2回答

    何時在Verilog模塊中執行「GENERATE BLOCK」? 生成塊內的代碼是否會按順序執行?

    0熱度

    1回答

    我知道這個問題之前已經被問過了,但是,我能找到的每個答案都指向SystemVerilog及其語法。 我有以下代碼: parameter NUM_TILES = 2; parameter [15:0] TILE_SIZE [NUM_TILES - 1'b1:0]; parameter [15:0] TILE_PRV_SIZE [NUM_TILES - 1'b1:0]; parameter

    0熱度

    3回答

    我知道,如果我的Verilog輸出二進制文件,那麼我可以使用下面的Verilog IO標準功能: $fwrite(fd,"%u",32'hABCDE124); 但上面的命令寫入的4字節數據到文件。如果我想寫入的二進制數據只有一個字節,兩個字節或三個字節會怎樣? 我該怎麼做? 例如,我知道下面會不會做我想做的: $fwrite(fd,"%u",8'h24); $fwrite(fd,"%u",1

    0熱度

    1回答

    我試圖用Verilog創建日期\內存,但有一個錯誤,如下面, error: Read is not a reg in this context. 我的代碼是這樣的,什麼是錯誤? module DataMemory(Read,Write,Address,memW,memR); input memR,memW; input[15:0] Address,Write; output [15:0] R

    0熱度

    2回答

    這是我的代碼:當所述操作碼的第一個比特是0,執行 module Adder_8b_df (A, B, opcode, S, Cout); input [7:0] A, B; input [3:0] opcode; output [7:0] S; output Cout; wire [8:0] tmp; assign tmp = (opcode[0] == 0) ? (A +

    1熱度

    3回答

    這是我編寫的簡單代碼。從'outt'我得到了122116.但是如果我將'outt'寬度更改爲33位([32:0]),那麼代碼似乎工作並給出正確答案-140028。這種行爲的原因是什麼? `timescale 1ns/1ps module valu_parser(clk,outt); input clk; reg signed [31:0] r_1; reg signed [31:0]

    2熱度

    2回答

    我製作了兩個verilog模塊。第一個數字取9位數字,並返回第一個出現位置1。 module findPositionOf_1( input [8:0] data, output reg [3:0] position ); always @(data) begin if(data==9'b0000_00000) position=4