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

Subversion Repositories sv_dir_tb

[/] [sv_dir_tb/] [trunk/] [examples/] [internal/] [sv/] [arb.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sckoarn
 
2
module bus_arb (
3
  rst_n, // reset not
4
  clk,   // input clock
5
  addr,  // address
6
  sel    // selects
7
);
8
 
9
 
10
input        rst_n;
11
input        clk;
12
input  [3:0] addr;
13
output [15:0] sel;
14
 
15
reg [15:0] tsel;
16
assign sel = tsel;
17
 
18
  always @(addr) begin
19
    case (addr)
20
      0:  tsel = 16'h0001;
21
      1:  tsel = 16'h0002;
22
      2:  tsel = 16'h0004;
23
      3:  tsel = 16'h0008;
24
      4:  tsel = 16'h0010;
25
      5:  tsel = 16'h0020;
26
      6:  tsel = 16'h0040;
27
      7:  tsel = 16'h0080;
28
      8:  tsel = 16'h0100;
29
      9:  tsel = 16'h0200;
30
      10: tsel = 16'h0400;
31
      11: tsel = 16'h0800;
32
      12: tsel = 16'h1000;
33
      13: tsel = 16'h2000;
34
      14: tsel = 16'h4000;
35
      15: tsel = 16'h8000;
36
    endcase
37
  end
38
 
39
 
40
endmodule

powered by: WebSVN 2.1.0

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