Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module top();
- //instantiere modul uart presupunem RX registru de trimis => fpga
- reg receive_byte;
- always@(posedge clk) begin
- receive_byte <= RX;
- end
- wire sq_a, sq_b, sq_c, sq_d, sq_e, sq_f, sq_g, sq_h;
- always@(posedge clk) begin
- // SET 1 DE BARE
- sq_a <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0; // pozitiile tale tb adaugate
- sq_b <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- sq_c <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- sq_d <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- // SET 2 DE BARE
- sq_e <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- sq_f <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- sq_g <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- sq_h <= ((x > 120) & (y > 40) & (x < 280) & (y < 200)) ? 1 : 0;
- case(receive_byte) // dc bitul trimis de uC e 1
- 1: begin
- // Bara 'a' e rosie, 'b' e verde, 'c' e albastra, 'd' e albastra si verde adica galben
- VGA_R[3] <= sq_a;
- VGA_G[3] <= sq_b | sq_d;
- VGA_B[3] <= sq_c | sq_d;
- end
- 2: begin // altfel dc e 2 intra setul 2
- VGA_R[3] <= sq_e; // 'e' e rosu si verde si albastru, f e verde, g e albastru, h e albastru
- VGA_G[3] <= sq_e | sq_f;
- VGA_B[3] <= sq_g | sq_e | sq_h;
- end
- endcase
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement