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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [tags/] [latest_stable/] [rtl/] [Collaterals/] [Module_FixedPointDivision.v] - Diff between revs 42 and 70

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

Rev 42 Rev 70
Line 54... Line 54...
 
 
 
 
parameter SIGN = 31;
parameter SIGN = 31;
wire Sign;
wire Sign;
 
 
 
wire [`WIDTH-1:0] wDividend,wDivisor;
 
wire wInputReady;
 
FFD_POSEDGE_SYNCRONOUS_RESET # ( `WIDTH ) FFD1
 
(
 
        .Clock( Clock ),
 
        .Reset( Reset),
 
        .Enable( iInputReady ),
 
        .D( iDividend ),
 
        .Q( wDividend)
 
);
 
FFD_POSEDGE_SYNCRONOUS_RESET # ( `WIDTH ) FFD2
 
(
 
        .Clock( Clock ),
 
        .Reset( Reset),
 
        .Enable( iInputReady ),
 
        .D( iDivisor ),
 
        .Q( wDivisor )
 
);
 
 
 
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD3
 
(
 
        .Clock( Clock ),
 
        .Reset( Reset),
 
        .Enable( 1'b1 ),
 
        .D( iInputReady ),
 
        .Q( wInputReady )
 
);
 
 
 
 
//wire [7:0] wExitStatus;
//wire [7:0] wExitStatus;
wire [`WIDTH-1:0] wAbsDividend,wAbsDivisor;
wire [`WIDTH-1:0] wAbsDividend,wAbsDivisor;
wire [`WIDTH-1:0] wQuottientTemp;
wire [`WIDTH-1:0] wQuottientTemp;
wire  [`WIDTH-1:0] wAbsQuotient;
wire  [`WIDTH-1:0] wAbsQuotient;
 
 
assign Sign = iDividend[SIGN] ^ iDivisor[SIGN];
assign Sign = wDividend[SIGN] ^ wDivisor[SIGN];
 
 
assign wAbsDividend = ( iDividend[SIGN] == 1 )?
assign wAbsDividend = ( wDividend[SIGN] == 1 )?
                        ~iDividend + 1'b1 : iDividend;
                        ~wDividend + 1'b1 : wDividend;
 
 
assign wAbsDivisor = ( iDivisor[SIGN] == 1 )?
assign wAbsDivisor = ( wDivisor[SIGN] == 1 )?
                ~iDivisor + 1'b1 : iDivisor;
                ~wDivisor + 1'b1 : wDivisor;
 
 
wire DivReady;
wire DivReady;
 
 
 
 
UnsignedIntegerDivision UDIV
UnsignedIntegerDivision UDIV
Line 78... Line 106...
                .Clock(Clock),
                .Clock(Clock),
                .Reset( Reset ),
                .Reset( Reset ),
                .iDividend( wAbsDividend),
                .iDividend( wAbsDividend),
                .iDivisor( wAbsDivisor ),
                .iDivisor( wAbsDivisor ),
                .xQuotient(wQuottientTemp),
                .xQuotient(wQuottientTemp),
                .iInputReady( iInputReady ),
                .iInputReady( wInputReady ),
                .OutputReady( DivReady )
                .OutputReady( DivReady )
 
 
        );
        );
 
 
//Make sure the output from the 'unsigned' operation is really posity
//Make sure the output from the 'unsigned' operation is really posity

powered by: WebSVN 2.1.0

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