-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaggerMod.v
More file actions
49 lines (43 loc) · 1.54 KB
/
Copy pathtaggerMod.v
File metadata and controls
49 lines (43 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 11/22/2017 11:50:45 AM
// Design Name:
// Module Name: taggerMod
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module taggerMod(
input [9:0] hOutQ,
input [9:0] vOutQ,
input frame, syncFlash, activeGreen,
input clk, upDownLD, leftRightLD, cntUp, cntDown, cntLeft, cntRight,
output greenSquare,
output [9:0] xPos,
output [9:0] yPos,
output topHit, bottomHit, leftHit, rightHit //collisions against the wall
);
wire [9:0] loadxD;
wire [9:0] loadyD;
wire xStop, yStop;
tenBitCount horizontal (.clk(clk), .enable( frame & (cntLeft | cntRight)), .up(cntRight), .down(cntLeft), .LD(upDownLD), .reset(1'b0),
.loadD(10'd320), .outQ(xPos));
tenBitCount vertical (.clk(clk), .enable( frame & (cntDown | cntUp)), .up(cntDown), .down(cntUp), .LD(upDownLD), .reset(1'b0),
.loadD(10'd240), .outQ(yPos));
assign topHit = (yPos == 10'd16);
assign bottomHit = (yPos == 10'd463);
assign rightHit = (xPos == 10'd623);
assign leftHit = (xPos == 10'd16);
assign greenSquare = (activeGreen | syncFlash) & ((hOutQ >= xPos-10'd8) & (hOutQ <= xPos+10'd8)) & ((vOutQ >= yPos-10'd8) & (vOutQ <= yPos+10'd8));
endmodule