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.
๐ก 1. What is a Pixel?
FoundationsThe 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.
๐จ 2. RGB Colour Representation & Binary Mathematics
Color TheoryDigital 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.
0 to 255 (256 discrete intensity levels).0 to 255. The human eye has highest sensitivity to green light wavelengths.0 to 255. Shortest wavelength, high-energy visible photon emitter.๐ฅ๏ธ 3. Interactive 1-Pixel Hardware Display
Live SimulationColor & Coordinate Input Controls
Adjust the 8-bit color intensity buses and 10-bit screen coordinates feeding into the pixel generator hardware.
๐๏ธ 4. Hardware Block Diagram & Register Pipeline
ArchitectureIn 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.
๐ป 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.
// Code loading...
โฑ๏ธ 6. Clock-by-Clock Live RTL Simulation
Hardware StepperClick 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!
| 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.
๐ฏ 8. Student Hands-On Challenges
0 / 6 CompletedComplete each hardware challenge by adjusting the controls and clocking the digital RTL design. The system automatically detects when your registered outputs satisfy each requirement.
๐ 9. What We Learned
Summary1. 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 NextExperiment 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.