Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Athokshay Ashok
VHDL-Maze
Commits
449e8438
Unverified
Commit
449e8438
authored
Apr 25, 2019
by
rmega12
Committed by
GitHub
Apr 25, 2019
Browse files
Creating pattern.vhd
Bricks are not implemented
parent
f61443f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
vhdl/pattern.vhd
0 → 100644
View file @
449e8438
--Pattern Module. Currently working for Ball and Paddle
library
IEEE
;
use
IEEE
.
std_logic_1164
.
all
;
use
IEEE
.
numeric_std
.
all
;
entity
pattern
is
Port
(
valid
:
in
std_logic
;
count_horz
:
in
unsigned
(
9
downto
0
);
count_vert
:
in
unsigned
(
9
downto
0
);
paddle_x
:
in
unsigned
(
9
downto
0
);
ball_x
:
in
unsigned
(
9
downto
0
);
ball_y
:
in
unsigned
(
9
downto
0
);
RGB_pattern
:
out
std_logic_vector
(
5
downto
0
)
);
end
pattern
;
architecture
synth
of
pattern
is
signal
RGB
:
std_logic_vector
(
5
downto
0
);
begin
RGB
<=
"111111"
when
(
count_horz
<
(
paddle_x
+
40
)
and
count_horz
>
(
paddle_x
-
40
)
and
count_vert
<
455
and
count_vert
>
445
)
--The paddle
or
(
count_horz
<
63
or
count_horz
>
576
or
count_vert
<
9
)
--The border
or
(
(
count_horz
=
ball_x
+
4
or
count_horz
=
ball_x
-
4
)
and
(
count_vert
<
ball_y
+
2
and
count_vert
>
ball_y
-
2
)
)
--Ball top/bottom row 1
or
(
(
count_horz
=
ball_x
+
3
or
count_horz
=
ball_x
-
3
)
and
(
count_vert
<
ball_y
+
3
and
count_vert
>
ball_y
-
3
)
)
--Ball top/bottom row 2
or
(
(
count_horz
=
ball_x
+
2
or
count_horz
=
ball_x
-
2
)
and
(
count_vert
<
ball_y
+
4
and
count_vert
>
ball_y
-
4
)
)
--Ball top/bottom row 3
or
(
(
count_horz
<
ball_x
+
2
and
count_horz
>
ball_x
-
2
)
and
(
count_vert
<
ball_y
+
5
and
count_vert
>
ball_y
-
5
)
)
--Ball center (3 rows)
else
"000000"
;
RGB_pattern
<=
RGB
;
end
synth
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment