hneemann / Digital

A digital logic designer and circuit simulator.
GNU General Public License v3.0
4.31k stars 436 forks source link

gpu doesnt work #1269

Closed aimnrt closed 5 months ago

aimnrt commented 6 months ago

my gpu doesnt work (for the 3rd time) and idk how to fix it. expected: https://github.com/hneemann/Digital/assets/158768107/aa8a1bed-68f1-42eb-82e9-fe9edfe517c8

unexpected: https://github.com/hneemann/Digital/assets/158768107/5b0d06dc-f209-4d32-adea-3122321b7dd3

i disconnected the rgb for the first one but enabled it for the last gpu_acard10.zip The zip file for the project

mengstr commented 6 months ago

I'm confused over the purpose of the NAND gate. All it does is to turn off the ROM when both the horizontal and vertical D0 bits are high (I.E every other pixel on alternating lines).

When the ROM is off (disconnected) the RGB signals are just outputting random values since nothing is driving them - giving the nice random coloured noise on the screen. ^__^

If you want to display a steady color while the ROM is off then you need to have pull ups or downs on the wires to keep them at a defined level when the ROM is not outputting anything.

But what is this circuit supposed to do? How many horizontal and vertical pixels are you expecting to be shown on the display? You are only having 8 bits of address from the horizontal counter. So that's 256 pixels. Then the same 256 pixels will be repeated for the rest of the line. (2.5 times)

You probably should have all 10 horizontal counter bits from the horizontal section going in to the ROM to avoid repeats. For the vertical 9 bits is enough to uniquely identify 480 lines. (9 bits=512 combinations)

Screenshot 2024-03-04 at 15 47 27
aimnrt commented 6 months ago

I'm confused over the purpose of the NAND gate. All it does is to turn off the ROM when both the horizontal and vertical D0 bits are high (I.E every other pixel on alternating lines).

When the ROM is off (disconnected) the RGB signals are just outputting random values since nothing is driving them - giving the nice random coloured noise on the screen. ^__^

If you want to display a steady color while the ROM is off then you need to have pull ups or downs on the wires to keep them at a defined level when the ROM is not outputting anything.

But what is this circuit supposed to do? How many horizontal and vertical pixels are you expecting to be shown on the display? You are only having 8 bits of address from the horizontal counter. So that's 256 pixels. Then the same 256 pixels will be repeated for the rest of the line. (2.5 times)

You probably should have all 10 horizontal counter bits from the horizontal section going in to the ROM to avoid repeats. For the vertical 9 bits is enough to uniquely identify 480 lines. (9 bits=512 combinations)

Screenshot 2024-03-04 at 15 47 27

i fixed it, but now when i try to import hex images to the rom it becomes random pixels again

hneemann commented 5 months ago

@aimnrt The processor/VGAExample contains a working pixel generator which can serve as an example.