vhdl

    0熱度

    1回答

    我有一個包含數字的字符串,例如3.76,我想將此解析的字符串轉換爲vhdl中的sfixed值。我使用的技巧是使用real'image(字符串)將字符串轉換爲實數,然後調用to_fixed(value, integer part, -precision)。但是這種方法不可綜合(real'image)。我想知道是否有其他方法,例如將字符串轉換爲std_logic_vector,然後使用To_slv()

    4熱度

    1回答

    VHDL-2008定義 type integer_vector is array (natural range <>) of integer ,它可以被用來創建不受約束整數數組就好: signal sUnconsrainedIntA : integer_vector(0 to 1) := (others => 0); 然而,如何聲明約束整數數組,例如: -- does not work:

    0熱度

    1回答

    我正在試圖模擬xilinx vivado套件上的一個程序,該程序打算查找給定整數的平方。我的程序的一部分 - for j in (num_of_bits-1) downto 0 loop res <=res+to_integer(unsigned(dvandha(shln(std_logic_vector(to_unsigned(num)),j)))); -- I get error h

    0熱度

    1回答

    我正試圖在VHDL中實現一個32位乘法器的記錄邏輯。此外,輸入位矢量(x_in)被重新編碼,它有一個額外的輸入「1」。意圖是當「一」是'1'輸出應該是x_in否則如果「一」是'0',它應該是兩次x_in。如果「負」高,則輸出必須反轉。這是我的VHDL代碼: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigne

    -1熱度

    1回答

    我有一個std_logic_vector輸入聲明在我的程序中, 說數字:std_logic_vector(7 downto 0)。 我想聲明一個std_logic_vector類型的信號,它的長度一直增加,直到輸入'數字'的長度。具體來說,我想要一個信號做到這一點 - for j in num_length downto 0 loop --num_length=number'length-1 a

    1熱度

    1回答

    我寫了簡單的代碼,並只定義了一個數組。但它顯示以下三個錯誤。 ERROR:HDLCompiler:806 - Syntax error near "type". Parsing entity . ERROR:HDLCompiler:854 - Unit ignored due to previous errors. Parsing architecture of entity . ERROR:HD

    -1熱度

    1回答

    我有數組初始化的寫代碼,但它顯示我以下錯誤 ERROR:HDLCompiler:806 - "Syntax error near ":=". ERROR:HDLCompiler:854 - Unit ignored due to previous errors. library IEEE; use IEEE.std_logic_1164.all; entity kelvin is end

    0熱度

    1回答

    我正在嘗試使用ufixed數據類型並將2個固定值加在一起,我已經計算出我應該有足夠的位來存儲結果並且輸出應該能夠被存儲在信號中,但是當我嘗試執行它時,我得到了一個綁定檢查失敗。有人能告訴我爲什麼我得到這個? 代碼的重要部分是: -- definition of parameters used in the failing calculation input : in ufixed(0 down

    1熱度

    2回答

    這裏是來自Xilinx Zynq示例的代碼。我無法理解這是爲了什麼? 在我pulse_d2僅在s_axi_resetn的下降沿爲1。 以這種方式檢測下降沿的原因是什麼? 爲什麼不使用事件,像「if(s_axi_resetn'event和s_axi_resetn ='0')」? process(s_axi_clk) begin if (s_axi_clk'event and s

    0熱度

    1回答

    我有以下代碼(簡化): library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use ieee.std_logic_arith.all; entity foo is end entity; architecture fum of foo is signal slv16 : STD_LOG