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

Subversion Repositories vtach

[/] [vtach/] [trunk/] [io_input.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wd5gnr
`timescale 1us/1ns
2
// This input module reads from the input switches
3
// This isn't of great use since
4
// we only have 8 input switches you can't
5
// enter negative #s or #s >99
6
// However, you could work out software to read
7
// everything (e.g., PB2 is negative,
8
// PB1 is enter 3rd  digit, PB0 is
9
// enter 1st digit and go
10
// Or something like that if you wanted to
11
 
12
module io_input(input clk, input oe, inout [12:0] value, input rst, input [7:0] sw);
13
   reg [12:0] v;
14
// Only drive output when asked
15
   assign value=oe?v:13'bz;
16
 
17
        // set v to next input value based on addr
18
   always @(posedge clk)
19
     begin
20
                v<={ 6'b0, sw };
21
     end
22
 
23
 
24
endmodule

powered by: WebSVN 2.1.0

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