/
Plan
89 lines (69 loc) · 2.6 KB
/
Plan
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
overall state machine
- wait
- get inputs
- update
- erase
- draw
wait
- rate divider
get inputs
update
- detect end of row
erase
- erase old row
draw
- draw and move squares - 6 state machines to draw the rows
x draw score - HEX display?
speeding up
x controlled by wait counter
datapath
- random number generator
- shift register for column data - holds 7 numbers, shift on edge,
specs
datapath
- 000 blank
- 001 1st column
- 010 2nd column
- 011 3rd column
- 100 4th column
screen
- sides gray
- 320 x 240
- one row 40 pixels
- one column 20 pixels = 80 pixels wide (1/4 of screen) (120 -> 199 inclusive)
to do list
- create bitmap
datapath
Danny - shift register row input (input shift (edge), clock, resetn, output [1:0] line_0 - line_6)
- line_0 is top
Danny - counter for offset [how far down a row we are] (input resetn, edge, increment, output offset[5:0])
- should go from 0 to 39
Danny - wait counter (10 fps for now) (input clock, resetn, output enable)
datapath draw-ers
Anna - erase old row (input erase_enable, [3:0] line_id, input [1:0] line_above, input [5:0] offset, output x, y, #_erase_finished)
Anna - draw row (input draw_enable, [3:0] line_id, input [2:0] line_below, input [5:0] offset, output x, y, #_draw_finished)
Danny - reset screen (input clock, resetn (start), output x, y, colour, output enable/done)
control state machines
Anna - control (input clock, resetn, draw_done, wait_done, reset_screen_done, input [5:0] offset, output reset_screen_go, output draw_go, output wait_start, output edge_go)
- wait for reset
- reset screen
- detect edge
- edge things (shift shift register, set offset to 0)
- draw
- wait for next frame
- increment offset
Anna - draw_control (input clock, resetn, input erase_1_x, erase_1_y, draw_1_x, draw_1_y, input draw_go, input #_erase_finished x6, input #draw_finished x6, output #_erase_enable x6, #_draw_enable x6, output vga_enable, output [2:0] colour, output draw_done)
- erase line 0
- draw line 0
- erase line 1
- draw line 1
Week 2
Danny - modify the line register to remove the block (input correct)
Anna - clear the block from the screen on correct button (input correct, output done)
Anna - register to detect correct button press (input clock, reset, line register, edge, keys, output correct, incorrect)
Anna -add fail state (input incorrect)
Anna -draw fail state (input incorrect, done)
Anna -pause fail state
Anna -modify the master control to check ^ and reset it,
Danny - score register (clock, resetn, increment (correct), output number)
Danny - hex decimal number output (show ^ in decimal) (input number, output to hex)