OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [src/] [dsp/] [bpp3/] [pixel.v] - Blame information for rev 304

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 215 hellwig
//
2
// pixel.v -- last stage in display pipeline
3
//
4
 
5
 
6 290 hellwig
`timescale 1ns/10ps
7
`default_nettype none
8
 
9
 
10 215 hellwig
module pixel(clk, pixclk, attcode,
11
             pixel, blank, hsync_in, vsync_in, blink,
12
             hsync, vsync, r, g, b);
13
    input clk;
14
    input pixclk;
15
    input [7:0] attcode;
16
    input pixel;
17
    input blank;
18
    input hsync_in;
19
    input vsync_in;
20
    input blink;
21
    output reg hsync;
22
    output reg vsync;
23
    output reg r;
24
    output reg g;
25
    output reg b;
26
 
27
  wire blink_bit;
28
  wire bg_red;
29
  wire bg_green;
30
  wire bg_blue;
31
  wire invrs_bit;
32
  wire fg_red;
33
  wire fg_green;
34
  wire fg_blue;
35
  wire foreground;
36
  wire red;
37
  wire green;
38
  wire blue;
39
 
40
  assign blink_bit = attcode[7];
41
  assign bg_red = attcode[6];
42
  assign bg_green = attcode[5];
43
  assign bg_blue = attcode[4];
44
  assign invrs_bit = attcode[3];
45
  assign fg_red = attcode[2];
46
  assign fg_green = attcode[1];
47
  assign fg_blue = attcode[0];
48
 
49
  assign foreground =
50
    (pixel & ~(blink_bit & blink)) ^ invrs_bit;
51
 
52
  assign red = (foreground ? fg_red : bg_red);
53
  assign green = (foreground ? fg_green : bg_green);
54
  assign blue = (foreground ? fg_blue : bg_blue);
55
 
56
  always @(posedge clk) begin
57
    if (pixclk == 1) begin
58
      hsync <= hsync_in;
59
      vsync <= vsync_in;
60
      r <= blank & red;
61
      g <= blank & green;
62
      b <= blank & blue;
63
    end
64
  end
65
 
66
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.