Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fpga_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mlinkó Péter
fpga_project
Commits
acc2b904
Commit
acc2b904
authored
6 years ago
by
vagle
Browse files
Options
Downloads
Patches
Plain Diff
middle is good
parent
e1435986
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd
+10
-10
10 additions, 10 deletions
...fe_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd
with
10 additions
and
10 deletions
game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd
+
10
−
10
View file @
acc2b904
...
...
@@ -158,7 +158,7 @@ begin
end
if
;
-- handle shift registers
--if switch_mode = '1' and frame_counter = 0 and horizontal_counter(
9 downto 3) < cell_number+2
and vertical_counter(9 downto 3) < cell_number+2 then
--if switch_mode = '1' and frame_counter = 0 and horizontal_counter(
2 downto 0) = 0 and horizontal_counter(9 downto 3) < cell_number+2 and vertical_counter(2 downto 0) = 0
and vertical_counter(9 downto 3) < cell_number+2 then
if
switch_mode
=
'1'
and
frame_counter
=
0
and
horizontal_counter
(
2
downto
0
)
=
0
and
horizontal_counter
(
9
downto
3
)
<
cell_number
and
vertical_counter
(
2
downto
0
)
=
0
and
vertical_counter
(
9
downto
3
)
<
cell_number
then
shift_register_top
<=
shift_register_top
(
1
to
cell_number
-1
)
&
shift_register_middle
(
0
);
...
...
@@ -185,19 +185,19 @@ begin
if
neighbours
(
4
)
=
'1'
then
if
neighbours_count
=
3
or
neighbours_count
=
4
then
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'1'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'1'
;
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'1'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'1'
;
else
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'0'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'0'
;
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'0'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'0'
;
end
if
;
else
if
neighbours_count
=
3
then
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'1'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'1'
;
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'1'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'1'
;
else
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'0'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
2
))
<=
'0'
;
cells
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'0'
;
cells_to_draw
(
to_integer
((
vertical_counter
(
9
downto
3
)
-1
)
*
to_unsigned
(
cell_number
,
8
)
+
horizontal_counter
(
9
downto
3
)
-
3
))
<=
'0'
;
end
if
;
end
if
;
...
...
@@ -251,7 +251,7 @@ begin
-- position changing
if
vertical_counter
=
VERTICAL_SYNC_PULSE
-1
then
vertical_counter
<=
(
others
=>
'0'
);
if
frame_counter
=
127
then
if
frame_counter
=
63
then
frame_counter
<=
(
others
=>
'0'
);
else
frame_counter
<=
frame_counter
+
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment