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

Subversion Repositories xilinx_virtex_fp_library

[/] [xilinx_virtex_fp_library/] [trunk/] [SinglePathFPAdderMappedConversions/] [special_cases.v] - Blame information for rev 15

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 constantin
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company: 
4
// Engineer: 
5
// 
6
// Create Date:    18:56:11 10/07/2013 
7
// Design Name: 
8
// Module Name:    special_cases_mul_acc
9
// Project Name: 
10
// Target Devices: 
11
// Tool versions: 
12
// Description: 
13
//
14
// Dependencies: 
15
//
16
// Revision: 
17
// Revision 0.01 - File Created
18
// Additional Comments: 
19
//
20
//////////////////////////////////////////////////////////////////////////////////
21
module special_cases            #(      parameter size_exception_field = 2'd2,
22
                                                                        parameter [size_exception_field - 1 : 0] zero                    = 0, //00
23
                                                                        parameter [size_exception_field - 1 : 0] normal_number= 1, //01
24
                                                                        parameter [size_exception_field - 1 : 0] infinity                = 2, //10
25
                                                                        parameter [size_exception_field - 1 : 0] NaN                             = 3) //11
26
                                                                (       input [size_exception_field - 1 : 0] sp_case_a_number,
27
                                                                        input [size_exception_field - 1 : 0] sp_case_b_number,
28
                                                                        output reg [size_exception_field - 1 : 0] sp_case_result_o);
29
 
30
        always
31
                @(*)
32
        begin
33
                case ({sp_case_a_number, sp_case_b_number})
34
                        {zero, zero}:                                                   sp_case_result_o = zero;
35
                        {zero, normal_number}:                          sp_case_result_o = normal_number;
36
                        {zero, infinity}:                                       sp_case_result_o = infinity;
37
                        {zero, NaN}:                                                    sp_case_result_o = NaN;
38
 
39
                        {normal_number,zero}:                           sp_case_result_o = normal_number;
40
                        {normal_number,normal_number}:  sp_case_result_o = normal_number;
41
                        {normal_number,infinity}:                       sp_case_result_o = infinity;
42
                        {normal_number,NaN}:                                    sp_case_result_o = NaN;
43
 
44
                        {infinity, zero}:                                       sp_case_result_o = infinity;
45
                        {infinity, normal_number}:              sp_case_result_o = infinity;
46
                        {infinity, infinity}:                           sp_case_result_o = infinity;
47
                        {infinity, NaN}:                                                sp_case_result_o = NaN;
48
 
49
                        {NaN, zero}:                                                    sp_case_result_o = NaN;
50
                        {NaN, normal_number}:                           sp_case_result_o = NaN;
51
                        {NaN, infinity}:                                                sp_case_result_o = NaN;
52
                        {NaN, NaN}:                                                     sp_case_result_o = NaN;
53
                        default:                                                                        sp_case_result_o = zero;
54
                endcase
55
        end
56
 
57
endmodule

powered by: WebSVN 2.1.0

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