Beispiel #1
0
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="floatWidth">total bit-width of input floating-point number
        /// (actual partitioning between exponent and mantissa bits does not matter)</param>
        /// <param name="outFormat">desired fixed-point output format</param>
        public FloatSignAsSigned(int floatWidth, FixFormat outFormat)
        {
            FloatWidth = floatWidth;
            OutFormat  = outFormat;

            _outM1 = SFix.FromDouble(-1.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _out0  = SFix.FromDouble(0.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _out1  = SFix.FromDouble(1.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _zeros = StdLogicVector._0s(floatWidth - 1);

            TASite = new TransactionSite(this);
        }
        /// <summary>
        /// Constructs a new instance.
        /// </summary>
        /// <param name="floatWidth">total bit-width of input floating-point number
        /// (actual partitioning between exponent and mantissa bits does not matter)</param>
        /// <param name="outFormat">desired fixed-point output format</param>
        public FloatSignAsSigned(int floatWidth, FixFormat outFormat)
        {
            FloatWidth = floatWidth;
            OutFormat = outFormat;

            _outM1 = SFix.FromDouble(-1.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _out0 = SFix.FromDouble(0.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _out1 = SFix.FromDouble(1.0, outFormat.IntWidth, outFormat.FracWidth).SLVValue;
            _zeros = StdLogicVector._0s(floatWidth - 1);

            TASite = new TransactionSite(this);
        }