2

ランダムな浮動小数点数 (10 進数形式) を生成し、テキスト ファイルに保存しました。そして、VHDL でそのファイルを読み取るためのコードを作成しました。ここで、これらの浮動小数点数を IEEE 形式 (32 ビットまたは 64 ビット) に変換したいと考えています。仕事に使用できるライブラリはありますか。または、VHDL にコードがありますか。

ありがとう

4

3 に答える 3

0

VHDL浮動小数点パッケージがあります:

http://vhdl.org/fphdl/index.html

于 2012-10-15T15:40:31.427 に答える
-1

VHDL で乱数を使用する場合は、*math_real* ライブラリの UNIFORM 関数を使用してみませんか? ユニフォームはあなたの機能です、使い方は定義で説明されています

procedure UNIFORM (variable Seed1,Seed2:inout integer; variable X:out real);
    -- returns a pseudo-random number with uniform distribution in the 
    -- interval (0.0, 1.0).
    -- Before the first call to UNIFORM, the seed values (Seed1, Seed2) must
    -- be initialized to values in the range [1, 2147483562] and 
    -- [1, 2147483398] respectively.  The seed values are modified after 
    -- each call to UNIFORM.
    -- This random number generator is portable for 32-bit computers, and
    -- it has period ~2.30584*(10**18) for each set of seed values.
    --
    -- For VHDL-1992, the seeds will be global variables, functions to 
    -- initialize their values (INIT_SEED) will be provided, and the UNIFORM
    -- procedure call will be modified accordingly.  

それが必要でない場合は、*std_textio* パッケージを使用してデータを読み取ります。

procedure READ(L:inout LINE; VALUE: out real; GOOD : out BOOLEAN);
procedure READ(L:inout LINE; VALUE: out real);
于 2012-10-15T11:18:39.770 に答える