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

Subversion Repositories i650

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

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
   output reg  [0:14] offset
36
   );
37 8 eightycc
 
38
   always @(*) begin
39
      case({addr_t[2:6], addr_u})
40
         12'b00001_01_00001: offset = 15'd0;
41
         12'b00001_01_00010: offset = 15'd12;
42
         12'b00001_01_00100: offset = 15'd24;
43
         12'b00001_01_01000: offset = 15'd36;
44
         12'b00001_01_10000: offset = 15'd48;
45
         12'b00001_10_00001: offset = 15'd60;
46
         12'b00001_10_00010: offset = 15'd72;
47
         12'b00001_10_00100: offset = 15'd84;
48
         12'b00001_10_01000: offset = 15'd96;
49
         12'b00001_10_10000: offset = 15'd108;
50 7 eightycc
 
51 8 eightycc
         12'b00010_01_00001: offset = 15'd120;
52
         12'b00010_01_00010: offset = 15'd132;
53
         12'b00010_01_00100: offset = 15'd144;
54
         12'b00010_01_01000: offset = 15'd156;
55
         12'b00010_01_10000: offset = 15'd168;
56
         12'b00010_10_00001: offset = 15'd180;
57
         12'b00010_10_00010: offset = 15'd192;
58
         12'b00010_10_00100: offset = 15'd204;
59
         12'b00010_10_01000: offset = 15'd216;
60
         12'b00010_10_10000: offset = 15'd228;
61 7 eightycc
 
62 8 eightycc
         12'b00100_01_00001: offset = 15'd240;
63
         12'b00100_01_00010: offset = 15'd252;
64
         12'b00100_01_00100: offset = 15'd264;
65
         12'b00100_01_01000: offset = 15'd276;
66
         12'b00100_01_10000: offset = 15'd288;
67
         12'b00100_10_00001: offset = 15'd300;
68
         12'b00100_10_00010: offset = 15'd312;
69
         12'b00100_10_00100: offset = 15'd324;
70
         12'b00100_10_01000: offset = 15'd336;
71
         12'b00100_10_10000: offset = 15'd348;
72 7 eightycc
 
73 8 eightycc
         12'b01000_01_00001: offset = 15'd360;
74
         12'b01000_01_00010: offset = 15'd372;
75
         12'b01000_01_00100: offset = 15'd384;
76
         12'b01000_01_01000: offset = 15'd396;
77
         12'b01000_01_10000: offset = 15'd408;
78
         12'b01000_10_00001: offset = 15'd420;
79
         12'b01000_10_00010: offset = 15'd432;
80
         12'b01000_10_00100: offset = 15'd444;
81
         12'b01000_10_01000: offset = 15'd456;
82
         12'b01000_10_10000: offset = 15'd468;
83 7 eightycc
 
84 8 eightycc
         12'b10000_01_00001: offset = 15'd480;
85
         12'b10000_01_00010: offset = 15'd492;
86
         12'b10000_01_00100: offset = 15'd504;
87
         12'b10000_01_01000: offset = 15'd516;
88
         12'b10000_01_10000: offset = 15'd528;
89
         12'b10000_10_00001: offset = 15'd540;
90
         12'b10000_10_00010: offset = 15'd552;
91
         12'b10000_10_00100: offset = 15'd564;
92
         12'b10000_10_01000: offset = 15'd576;
93
         12'b10000_10_10000: offset = 15'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.