r/ComputerEngineering • • Oct 19 '24

How does a computer convert binary to the things we see and interact with on the screen?

38 Upvotes

6 comments sorted by

7

u/hukt0nf0n1x Oct 19 '24

Screen is a 2 dimensional array of pixels. Each pixel has an address. When your computer puts things on the screen, it selectively lights up pixels (a 3x3 of adjacent pixels would look like a white square when "lit up") using their address. The screen refreshes (pixels get reloaded) periodically.

So, that's how the computer puts things on the screen. How does the computer decide what pixels need to be lit up? The operating system knows how to draw a window on your screen. Given a window of some size and location, the OS sends commands to the screen to light up the appropriate pixels. The screen controller takes the commands from the OS and converts them to a bunch of pixel addresses and corresponding values. When the screen is ready to refresh, the controller sends the data to the screen.

1

u/pang_yau_wee Oct 21 '24

It's called a look up table.

1

u/amy_the_cutie Oct 22 '24

short answer: it takes a goddamn computer science degree to understand it all, so don't expect an easy answer

long answer: well, so, it's like when you compress a file and decompress it, while if you try to open a compressed text file with a text editor you will get incomprehensible non-sense, if you decompress it you'll get back what you put in that compressor.

so, a keyboard acts like the compressor in that analogy, the keyboard has many keys, and there are transistors put in place inside the computer such as they let electricity flow in the binary combination for that key when the key is pressed, that binary combination is then read by the processor and triggers something called an interrupt, the processor then jumps to executing the code put on by the operating system to handle that interrupt and get the correct binary combination that actually represents the letter you meant to type, then it stores it in RAM in a place called "the standard output file", and then if you're using a text editor or the command line/command prompt, the app you're using reads the binary combination that corresponds to the letter you wanted to write, from the standard output file in the RAM, and triggers another interrupt, the operating systemhandling that interrupt looks up what character is supposed to be written by the binary combination it received from the interrupt, and reads the values of color and placement from the font files in it, using the default font most likely, and then sends the information about what pixels need to be on to another part of the operating system that figures out where the cursor is in the text editor/command line/command prompt, and updates the value of pixels in that position in the frame buffer, and when the frame buffer finishes being drawn, it contains the values of the colors of each pixel in the screen (by having 3 bytes for red, blue, and green, intensity per pixel), then the operating system sends a swap requist to the GPU, to tell it to swap from the frame that's currently on the screen, to the frame buffer we just drew in order to display it, and the operating system can draw on the frame it was displaying before now that it's not being used. the GPU takes the binary information about the colors of each pixel and has resistors put in place so that the voltage of each of the 8 wires representing 8-bits (1 byte) is divided based on how high a number they represent or how low, abd then the resulting voltages get combined in series, and sent as one of 3 wires, the same process gets done for the 3 bytes representing the red, green, and blue colors, and each pixel on the screen has 3 light that produce the red, green, and blue colors, due to the voltage difference on the red, green, and blue wires that we created using the information from the pixel we wanna draw, the lights light up in different intensity, and because the pixel is so small, we receive the 3 lights as one light of a light color combination of the three lights, the GPU also has 2 counters, for horizontal and vertical position of the pixel, and does that same process of sending a pixel to display over and over and over incrementing the counters each time accordingly, while also sending to the screen the info about when to go back to the start of a column and go down one row, and it sends the frame in two phases, the first phase drawing the odd columns, and the second drawing the even ones, the screen knows where to put each pixel because of a shared clock between the GPU and the screen that means the GPU's counter will increase with the screen's counter.

0

u/HONKACHONK Oct 20 '24

I'm only on this sub because I plan to do CE, but for now my education is YouTube University, so take everything I say with a grain of salt.

Computers by themselves are really really dumb. The only way they do things smart is when you tell them exactly what to do. It's like if I were telling you how to make a sandwich and starting with how to move the muscles in your legs.

There's some hardware attached to the computer that gives it simple things like keyboard input, or monitor output.

There's a ton of software telling the computer exactly what to do with these hardware inputs and outputs. 1 gigabyte of software is one billion little instructions telling the computer in mega detail what to do

25

u/[deleted] Oct 19 '24

[removed] — view removed comment

3

u/MixedTrailMix Oct 20 '24

Yep what this person said ^