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

Subversion Repositories i650

[/] [i650/] [trunk/] [rtl/] [ram_word_offset.v] - Blame information for rev 18

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

Line No. Rev Author Line
1 7 eightycc
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// IBM 650 Reconstruction in Verilog (i650)
4
// 
5
// This file is part of the IBM 650 Reconstruction in Verilog (i650) project
6
// http:////www.opencores.org/project,i650
7
//
8
// Description:
9
//   Convert dynamic portion of 650 address into a word offset in general
10
//   storage RAM.
11
// 
12
// Additional Comments: 
13
//
14
// Copyright (c) 2015 Robert Abeles
15
//
16
// This source file is free software; you can redistribute it
17
// and/or modify it under the terms of the GNU Lesser General
18
// Public License as published by the Free Software Foundation;
19
// either version 2.1 of the License, or (at your option) any
20
// later version.
21
//
22
// This source is distributed in the hope that it will be
23
// useful, but WITHOUT ANY WARRANTY; without even the implied
24
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
25
// PURPOSE.  See the GNU Lesser General Public License for more
26
// details.
27
//
28
// You should have received a copy of the GNU Lesser General
29
// Public License along with this source; if not, download it
30
// from http://www.opencores.org/lgpl.shtml
31
//////////////////////////////////////////////////////////////////////////////////
32
 
33
module ram_word_offset (
34
   input [0:6] addr_t, addr_u,
35 9 eightycc
   output reg  [0:9] offset
36 7 eightycc
   );
37 8 eightycc
 
38
   always @(*) begin
39
      case({addr_t[2:6], addr_u})
40 9 eightycc
         12'b00001_01_00001: offset = 10'd0;
41
         12'b00001_01_00010: offset = 10'd12;
42
         12'b00001_01_00100: offset = 10'd24;
43
         12'b00001_01_01000: offset = 10'd36;
44
         12'b00001_01_10000: offset = 10'd48;
45
         12'b00001_10_00001: offset = 10'd60;
46
         12'b00001_10_00010: offset = 10'd72;
47
         12'b00001_10_00100: offset = 10'd84;
48
         12'b00001_10_01000: offset = 10'd96;
49
         12'b00001_10_10000: offset = 10'd108;
50 7 eightycc
 
51 9 eightycc
         12'b00010_01_00001: offset = 10'd120;
52
         12'b00010_01_00010: offset = 10'd132;
53
         12'b00010_01_00100: offset = 10'd144;
54
         12'b00010_01_01000: offset = 10'd156;
55
         12'b00010_01_10000: offset = 10'd168;
56
         12'b00010_10_00001: offset = 10'd180;
57
         12'b00010_10_00010: offset = 10'd192;
58
         12'b00010_10_00100: offset = 10'd204;
59
         12'b00010_10_01000: offset = 10'd216;
60
         12'b00010_10_10000: offset = 10'd228;
61 7 eightycc
 
62 9 eightycc
         12'b00100_01_00001: offset = 10'd240;
63
         12'b00100_01_00010: offset = 10'd252;
64
         12'b00100_01_00100: offset = 10'd264;
65
         12'b00100_01_01000: offset = 10'd276;
66
         12'b00100_01_10000: offset = 10'd288;
67
         12'b00100_10_00001: offset = 10'd300;
68
         12'b00100_10_00010: offset = 10'd312;
69
         12'b00100_10_00100: offset = 10'd324;
70
         12'b00100_10_01000: offset = 10'd336;
71
         12'b00100_10_10000: offset = 10'd348;
72 7 eightycc
 
73 9 eightycc
         12'b01000_01_00001: offset = 10'd360;
74
         12'b01000_01_00010: offset = 10'd372;
75
         12'b01000_01_00100: offset = 10'd384;
76
         12'b01000_01_01000: offset = 10'd396;
77
         12'b01000_01_10000: offset = 10'd408;
78
         12'b01000_10_00001: offset = 10'd420;
79
         12'b01000_10_00010: offset = 10'd432;
80
         12'b01000_10_00100: offset = 10'd444;
81
         12'b01000_10_01000: offset = 10'd456;
82
         12'b01000_10_10000: offset = 10'd468;
83 7 eightycc
 
84 9 eightycc
         12'b10000_01_00001: offset = 10'd480;
85
         12'b10000_01_00010: offset = 10'd492;
86
         12'b10000_01_00100: offset = 10'd504;
87
         12'b10000_01_01000: offset = 10'd516;
88
         12'b10000_01_10000: offset = 10'd528;
89
         12'b10000_10_00001: offset = 10'd540;
90
         12'b10000_10_00010: offset = 10'd552;
91
         12'b10000_10_00100: offset = 10'd564;
92
         12'b10000_10_01000: offset = 10'd576;
93
         12'b10000_10_10000: offset = 10'd588;
94 7 eightycc
 
95 8 eightycc
         default:      offset = 15'd0;
96
      endcase;
97
   end;
98 7 eightycc
 
99
endmodule

powered by: WebSVN 2.1.0

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