Home / GPU Master / Experiment 01: 1-Pixel GPU

GPU Master โ€“ Experiment 01: Understanding a Single Pixel

How does a graphics processing unit generate and represent visual imagery? Explore additive RGB color mathematics, binary channel quantization, 2D coordinate spaces, and synthesizable Verilog RTL register pipelines.

EXPERIMENT 01 OF 07 โ— SYNTHESIZABLE VERILOG RTL 24-BIT TRUECOLOR REGISTERED 1-CYCLE LATENCY ICARUS VERILOG VERIFIED

๐Ÿ’ก 1. What is a Pixel?

Foundations

The word Pixel is a portmanteau of Picture Element (PIX + EL). It is the smallest controllable unit of color and light that can be rendered on a computer display, smartphone screen, or digital television.

When you look at a photograph or 3D video game, you are not viewing continuous analog paint. Instead, your screen is a physical grid of millions of microscopic square pixels placed edge-to-edge. When viewed from a standard distance, the human visual system fuses these microscopic squares into a seamless, high-resolution image.

Underneath every LCD or OLED screen, each pixel is manufactured from three microscopic sub-pixel emitters: Red, Green, and Blue. By controlling the electrical intensity of each sub-pixel emitter with digital hardware circuits, the GPU produces any perceived color in the human visible spectrum.

Physical Sub-Pixel Architecture
R
G
B
Sub-pixels combine optically to form 1 Single Pixel

๐ŸŽจ 2. RGB Colour Representation & Binary Mathematics

Color Theory

Digital graphics use the Additive Light Color Model. Unlike paint pigments (which absorb light subtractively), digital sub-pixels emit light rays. When Red, Green, and Blue light beams combine at full intensity, they produce pure white light. When turned off completely, they produce black.

๐Ÿ”ด Red Component (8-Bit)
Range: 0 to 255 (256 discrete intensity levels).
Binary: 00000000โ‚‚ to 11111111โ‚‚
๐ŸŸข Green Component (8-Bit)
Range: 0 to 255. The human eye has highest sensitivity to green light wavelengths.
Binary: 00000000โ‚‚ to 11111111โ‚‚
๐Ÿ”ต Blue Component (8-Bit)
Range: 0 to 255. Shortest wavelength, high-energy visible photon emitter.
Binary: 00000000โ‚‚ to 11111111โ‚‚
Current Input Binary & Hexadecimal Quantization:
R: 255 (11111111)
G: 0 (00000000)
B: 0 (00000000)
Result: #FF0000

๐Ÿ–ฅ๏ธ 3. Interactive 1-Pixel Hardware Display

Live Simulation
Visualized Output Pixel (Magnified ร—200 for Inspection)

*Note: This square represents 1 single pixel magnified for engineering study. In reality, on a standard 1080p screen, this pixel occupies a microscopic 0.25mm area.

Screen Coordinates
(0, 0)
Hardware Status
โ— VALID (Active)
Decimal RGB
rgb(255, 0, 0)
Hexadecimal Code
#FF0000
24-Bit Binary Hardware Register
11111111_00000000_00000000

Color & Coordinate Input Controls

Adjust the 8-bit color intensity buses and 10-bit screen coordinates feeding into the pixel generator hardware.

๐Ÿ”ด Red Channel (red_in[7:0]): 255
๐ŸŸข Green Channel (green_in[7:0]): 0
๐Ÿ”ต Blue Channel (blue_in[7:0]): 0
Color Presets:

๐Ÿ—๏ธ 4. Hardware Block Diagram & Register Pipeline

Architecture

In real graphics hardware, signals do not jump instantly to the display. They pass through synchronous digital flip-flops clocked by a high-frequency system oscillator (e.g. 50 MHz). This registered pipeline stage prevents timing glitches and allows the GPU to run at GHz clock speeds.

INPUT SIGNALS (Wires) red_in [7:0] green_in [7:0] blue_in [7:0] pixel_x_in [9:0] pixel_y_in [9:0] pixel_valid_in 255,0,0 (0,0) valid=1 pixel_generator (RTL) Synchronous D-FF Array Clocked on @(posedge clk) Latch Enable: if(valid_in) Synchronous Reset (rst) Overrides & Clears all Regs to 0 clk OUTPUTS (1-Cycle Latency) red_out [7:0] green_out [7:0] blue_out [7:0] pixel_x_out [9:0] pixel_y_out [9:0] pixel_valid_out 255,0,0 (0,0) valid=1

๐Ÿ’ป 5. Synthesizable Verilog RTL Source Code

Below is the authentic, synthesizable Verilog HDL module. It features clean non-blocking (<=) register assignments, active-high synchronous reset, and clock gating through the pixel_valid_in qualification strobe.

Verilog HDL ยท pixel_generator.v ยท Synthesizable IEEE 1364-2001 โ— 100% Verified with Icarus Verilog
// Code loading...

โฑ๏ธ 6. Clock-by-Clock Live RTL Simulation

Hardware Stepper

Click Step 1 Clock Edge to advance time by one rising edge of the system clock. Watch how input values are captured into the output registers exactly one cycle later!

Cycle: 0
Signal Name Direction Bit-Width Current Simulated Value Hardware Description
clk Input 1-bit 0 Master oscillator clock pulse (50 MHz)
rst Input 1-bit 0 Synchronous active-high reset line
pixel_valid_in Input 1-bit 1 Input qualification valid strobe
pixel_{x,y}_in Input 10-bit x 2 (0, 0) Input screen coordinate bus
{red,green,blue}_in Input 8-bit x 3 #FF0000 (255,0,0) 24-bit input Truecolor RGB data
pixel_valid_out Output (Reg) 1-bit 0 1-cycle delayed registered valid flag
pixel_{x,y}_out Output (Reg) 10-bit x 2 (0, 0) Registered latched output coordinates
{red,green,blue}_out Output (Reg) 8-bit x 3 #000000 (0,0,0) Registered output pixel RGB values to display

Genuine Icarus Verilog Compilation & Execution

Compile and simulate this module in genuine Icarus Verilog 2012.

Click "Run Genuine Icarus Verilog Engine" to compile pixel_generator_tb.v...

๐Ÿ“ˆ 7. Digital Timing Diagram (Signal Waveforms)

Waveforms

Below is the real-time timing waveform. Notice how pixel_valid_out and rgb_out update exactly one clock edge after the input changes. This is the hallmark of clocked synchronous registers in digital silicon.

Digital Signal Traces ยท Step-Synchronized Waveform View 1-Clock Cycle Registered Latency Highlighted
Zoom: 100%
Hover waveform to inspect signal values at clock edge
Move cursor over waveform to inspect cycle-accurate signal states

๐ŸŽฏ 8. Student Hands-On Challenges

0 / 6 Completed

Complete each hardware challenge by adjusting the controls and clocking the digital RTL design. The system automatically detects when your registered outputs satisfy each requirement.

Challenge 1: Pure Red Pixel Pending
Set Red=255, Green=0, Blue=0, with pixel_valid_in=1, then step the clock edge.
Challenge 2: Pure Blue Pixel Pending
Set Red=0, Green=0, Blue=255, with pixel_valid_in=1, then step the clock edge.
Challenge 3: Yellow Light Synthesis Pending
Add pure Red (255) and pure Green (255) together with Blue=0 to produce pure yellow (#FFFF00).
Challenge 4: Maximum Intensity White Pending
Combine all three additive primary light components at maximum intensity (255, 255, 255).
Challenge 5: Coordinate Addressing Pending
Change the input coordinates to X=10 and Y=20, then step the clock to latch them into the output registers.
Challenge 6: Valid Deassertion Hold Pending
Turn OFF pixel_valid_in (0), change input sliders, and step the clock. Notice how outputs retain previous color while valid goes LOW!

๐ŸŽ“ 9. What We Learned

Summary

1. Additive RGB Model

Colors on electronic displays combine through additive light rays. Red + Green makes Yellow; Red + Blue makes Magenta; Red + Green + Blue makes White.

2. 24-Bit Truecolor Quantization

Each color channel uses 8 bits (256 discrete integer levels). 3 channels ร— 8 bits = 24 bits total, allowing 16.7 million distinct visual colors.

3. Synchronous D-FF Registers

Outputs are held stable by clocked flip-flops. Inputs are latched only on the rising clock edge (posedge clk), introducing exactly 1 cycle of pipeline latency.

4. Valid Strobe Handshaking

When pixel_valid_in is LOW, downstream graphics hardware ignores the output bus, preserving previous pixel values and saving dynamic power.

๐Ÿš€ 10. Next Experiment โ€“ 2ร—2 Pixel GPU Grid

Coming Up Next

Experiment 02: Building a 2ร—2 Pixel GPU Grid

Now that you understand how a single pixel works, how do we arrange four pixels into a 2ร—2 grid? In Experiment 02, we will design:

  • A 4-pixel spatial coordinate decoder (Pixels (0,0), (1,0), (0,1), (1,1)).
  • A quad-register memory bank to store independent colors per pixel.
  • Raster scan beam addressing from top-left to bottom-right.
Launch Experiment 02: 2ร—2 Pixel GPU →
Upcoming 2ร—2 Grid Architecture
(0,0)
(1,0)
(0,1)
(1,1)
4 Addressable Subsystem Registers