OpenCores
URL https://opencores.org/ocsvn/encore/encore/trunk

Subversion Repositories encore

[/] [encore/] [trunk/] [fpmult/] [src/] [fpmult_stage0.vhdl] - Diff between revs 4 and 6

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 4 Rev 6
Line 23... Line 23...
        end record;
        end record;
        signal r,rin:reg_type;
        signal r,rin:reg_type;
begin
begin
        comb:process(d,r)
        comb:process(d,r)
                variable v:reg_type;
                variable v:reg_type;
 
                variable a_is_normal,b_is_normal:boolean;
 
                variable a_is_subnormal,b_is_subnormal:boolean;
 
                variable a_is_zero,b_is_zero:boolean;
 
                variable a_is_infinite,b_is_infinite:boolean;
 
                variable a_is_nan,b_is_nan:boolean;
 
                variable is_normal:boolean;
 
                variable is_zero:boolean;
 
                variable is_infinite:boolean;
 
                variable is_nan:boolean;
        begin
        begin
                -- sample register outputs
                -- sample register outputs
                v:=r;
                v:=r;
 
 
                -- overload
                -- overload
                v.a:=d.a;
                v.a:=d.a;
                v.b:=d.b;
                v.b:=d.b;
 
 
 
                a_is_normal:=fp_is_normal(v.a);
 
                b_is_normal:=fp_is_normal(v.b);
 
                a_is_subnormal:=fp_is_subnormal(v.a);
 
                b_is_subnormal:=fp_is_subnormal(v.b);
 
                a_is_zero:=fp_is_zero(v.a);
 
                b_is_zero:=fp_is_zero(v.b);
 
                a_is_infinite:=fp_is_infinite(v.a);
 
                b_is_infinite:=fp_is_infinite(v.b);
 
                a_is_nan:=fp_is_nan(v.a);
 
                b_is_nan:=fp_is_nan(v.b);
 
 
 
                if a_is_normal or b_is_normal then
 
                        if a_is_normal and b_is_normal then
 
                                is_normal:=true;
 
                        end if;
 
                        if a_is_zero or b_is_zero then
 
                                is_zero:=true;
 
                        end if;
 
                        if a_is_infinite or b_is_infinite then
 
                                is_infinite:=true;
 
                        end if;
 
                        if a_is_nan or b_is_nan then
 
                                is_nan:=true;
 
                        end if;
 
                end if;
 
 
                v.p_sign:=fp_sign(d.a) xor fp_sign(d.b);
                v.p_sign:=fp_sign(d.a) xor fp_sign(d.b);
                v.p_exp:=fp_exp(d.a) + fp_exp(d.b) - 127;
                v.p_exp:=fp_exp(d.a) + fp_exp(d.b) - 127;
                if fp_mantissa(d.b)(0)='1' then
                if fp_mantissa(d.b)(0)='1' then
                        v.p_mantissa:=resize(fp_mantissa(d.a),48);
                        v.p_mantissa:=resize(fp_mantissa(d.a),48);
                else
                else

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.