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

Subversion Repositories bu_pacman

[/] [bu_pacman/] [tags/] [arelease/] [Sources/] [ps2/] [ps2_decode.v] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 soloist_hu
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// Company: BU PACMAN TEAM
4
// Engineer: Huaxin Dai
5
// 
6
// Create Date:    21:02:09 11/14/2008 
7
// Design Name:          PS/2 Interface
8
// Module Name:    ps2_decode 
9
// Project Name:   BU PACMAN
10
// Target Devices: XC3S1000
11
// Tool versions:  ISE 10.1
12
// Description:    PS/2 interface, key decode part.
13
//
14
// Dependencies:   ps2_receive.v
15
//
16
// Revision: 
17
// Revision 0.01 - File Created
18
// Additional Comments: 
19
//
20
//////////////////////////////////////////////////////////////////////////////////
21
module ps2_decode(
22
         input in_clk,
23
    input in_reset,
24
    input [7:0]in_data,
25
    output reg [6:0]out_data
26
    );
27
always @(posedge in_clk)
28
if(in_reset)
29
        begin
30
        out_data <= 7'b0000001;
31
        end
32
else
33
        begin
34
                case(in_data)
35
                        8'h1C:begin//left, A
36
                                                out_data <= 7'b0010000;
37
                                        end
38
                        8'h1B:begin//down, S
39
                                                out_data <= 7'b0100000;
40
                                        end
41
                        8'h23:begin//right, D
42
                                                out_data <= 7'b0001000;
43
                                        end
44
                        8'h1D:begin//up, W
45
                                                out_data <= 7'b1000000;
46
                                        end
47
                        8'h2D:begin//reset, R
48
                                                out_data <= 7'b0000100;
49
                                        end
50
                        8'h4D:begin//pause, P
51
                                                out_data <= 7'b0000010;
52
                                        end
53
                default: begin//stop
54
                                                out_data <= 7'b0000001;
55
                                        end
56
                endcase
57
        end
58
 
59
endmodule

powered by: WebSVN 2.1.0

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