How Computers Understand and Solve Problems

A beginner-friendly explanation of how computers process information — from binary and bytes to how text, images, videos, and audio are represented and stored.

2024-06-30

How to solve Problems in Computer?

So to solve the problems of compter, we need to know the language computer understands, and tell the computer in that language some certain instructions to follow. So it solves the problem. But how does it work?

So Generally Computer takes some input, performs the instructions and gives the output. For that we need to give it instructions in binary language as it supports the binary language.

Wait whats binary language? So binary is the language of 0’s and 1’s we represent it with only 0’s and 1’s.

Wait how can we decide how many 0’s and 1’s to take and what it indicates?

  • So each 0 or 1 in binary can be called a bit. So each 0 or 1 is a bit.
  • Generally it depends on the architecture of the processor that how many bits it takes, or we can say how many bytes it can take (byte = 8 bits.) so to represents the 8 bits in a compact manner we have byte.

So what can we represent with it? Like numbers, images, audios? How?

  • So ever since we started learning the number system in schools, we were taught the number system of decimal or i can say base-10 in the computer language.
  • So base-10 consists of 0-9 digits, it can be used as a digit value between 0-9.
  • So lets say we have number 123, you all know its one hundred twenty three, but how? As you know base-10 typically represents base of the each digit, so as to say, the digit on the right most which is the smallest digit represents the 10^0 then the digit next to it represents 10^1 and so on….
  • Like 10^0 + 10^1 + 10^2
  • So we have taken an example of 123 so we can write it as 10^0 * 3 + 10^1 * 2 + 10^2 * 1 = 3+20+100 = 123, which is how the decimal number system works.

So how does binary number works?

  • We represent each value with 0’s and 1’s, so just like the decimal had 10 possible values, we have 2 possible values for each digit in binary. We represent the binary number from right to left as in 2^0, 2^1, 2^2 and so on…..
  • So we can write the decimal numbers in the binary as well, how tho?
    • Lets say i want to write 1 ? 01
    • I want to write 2 = 10
    • I want to write 3 = 11
    • And 0 = 00
  • This makes the permutation of the 2 digits and all possible combination represnt a decimal digits.
  • So just like that we can write 0-7 and so on.
  • Like if i were to explain how did you write 2 - then 2^1 = 1, 2^0 = 0, where 0 and 1 represnt that we have not used that bit and used the bit respectively. So i hope its clear how to represent the binary number system.

Next question is how do we represent this bits in a compact manner?

  • We cant represent it in compact manner but for larger information we increase the number bit and for understanding of humans we call the byte as a group of the 8 bits. Basically bit is fundamental unit while byte is combination of 8 bits to represent this bits.

Now as per how computer Stores the text information?

  • We have ASCII code if you somewhat heard about it, then yes ASCII code is used to represent characters and each character is assigned a unique ascii value for it to be uniquely represented.

  • Wait how do i know which code is what?

  • We can also understand its working by binary digits.

  • For ex- A=65 ? How do you represent it in binary

    • 01000001 = 65 = A
    • 01000010 = 66 = B
    • And soo on….
    • 01100001 = 97 = a
    • 01100010 = 98 = b
    • …..
  • So you understand that after 64 each increase represent the Capital A & similary from 97 small a. and before and after of each of them there are also other letters that are described with the numbers.

  • Now this is how computers works inside we dont generally need to know this but we are comp eng. We must know thiss.

  • So for word “BA” = 01000010 01000001, internally written in byte stream. Fascinating isnt it?

Image, video & audios.

  • For images we represent each pixel with RGB, and for each RGB we take 3 bytes 1 byte value for RED, 1 Byte value for Green and 1 Byte value got the Blue.

  • And the image is made up of the pixels where each pixel represent these 3 bytes.

  • So for uncompressed image, where the image is raw, if the 3 megaBytes Image is taken than we can say that 1 megabytes Pixels are there, as each pixel is of 3 bytes.

  • So 3 mb from each 3 bytes of 1 pixel we have 1 mb pixels.

  • Each Video is generated of these images, so we can say lets say 30 frames per seconds is nothing but 30 images per second and images are represented as above.

    • Similary we can apply it for audio and viceversa. Like 1 byte for note and so….
  • That’s it folks.

Conclusion & Summary

Here's a quick overview of the topics we covered in this post:

How to solve Problems in Computer?

So how does binary number works?

Next question is how do we represent this bits in a compact manner?

Image, video & audios.

@albidotwt

Select Theme