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

Subversion Repositories uart6551

[/] [uart6551/] [trunk/] [trunk/] [rtl/] [uart6551BaudLUT.sv] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 robfinch
// ============================================================================
2
//        __
3
//   \\__/ o\    (C) 2005-2019  Robert Finch, Waterloo
4
//    \  __ /    All rights reserved.
5
//     \/_//     robfinch@finitron.ca
6
//       ||
7
//
8
//
9
// This source file is free software: you can redistribute it and/or modify
10
// it under the terms of the GNU Lesser General Public License as published
11
// by the Free Software Foundation, either version 3 of the License, or
12
// (at your option) any later version.
13
//
14
// This source file is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
// GNU General Public License for more details.
18
//
19
// You should have received a copy of the GNU General Public License
20
// along with this program.  If not, see .
21
//
22
// ============================================================================
23
//
24
module uart6551BaudLUT(a, o);
25
parameter pCounterBits = 24;
26
input [4:0] a;
27
output reg [pCounterBits-1:0] o;
28
 
29
// table for a 50.000MHz reference clock
30
// value = 50,000,000 / (baud * 16)
31
always @(a)
32
        case (a)        // synopsys full_case parallel_case
33
        5'd0:   o <= 0;
34
        5'd1:   o <= 24'd62500; // 50 baud
35
        5'd2:   o <= 24'd41667; // 75 baud
36
        5'd3:   o <= 24'd28617; // 109.92 baud
37
        5'd4:   o <= 24'd23220; // 134.58 baud
38
        5'd5:   o <= 24'd20833; // 150 baud
39
        5'd6:   o <= 24'd10417; // 300 baud
40
        5'd7:   o <= 24'd5208;  // 600 baud
41
        5'd8:   o <= 24'd2604;  // 1200 baud
42
        5'd9:   o <= 24'd1736;  // 1800 baud
43
        5'd10:  o <= 24'd1302;  // 2400 baud
44
        5'd11:  o <= 24'd868;   // 3600 baud
45
        5'd12:  o <= 24'd651;   // 4800 baud
46
        5'd13:  o <= 24'd434;   // 7200 baud
47
        5'd14:  o <= 24'd326;   // 9600 baud
48
        5'd15:  o <= 24'd163;   // 19200 baud
49
 
50
        5'd16:  o <= 24'd81;    // 38400 baud
51
        5'd17:  o <= 24'd54;    // 57600 baud
52
        5'd18:  o <= 24'd27;    // 115200 baud
53
        5'd19:  o <= 24'd14;    // 230400 baud
54
        5'd20:  o <= 24'd7;     // 460800 baud
55
        5'd21:  o <= 24'd3;     // 921600 baud
56
        default:        o <= 24'd326;   // 9600 baud
57
        endcase
58
 
59
endmodule
60
 
61
 

powered by: WebSVN 2.1.0

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