Binary System and Data Presentation In Computer


Understanding the Binary System in Computers


Computers are electronic devices that work entirely using electricity β€” signals that are either ON or OFF.

Because of this, they can only understand two states: 1 (ON) and 0 (OFF).

This fundamental concept is the basis of everything a computer does β€” numbers, letters, images, and sounds are all represented in binary form.

Understanding the binary system is the first step toward mastering computer logic and programming.


πŸ”Ή 1️⃣ How Computers Work?

  • A computer processes information using electrical signals.
  • It understands only 0s and 1s (binary digits).
  • These digits represent electrical states β€” Off (0) or On (1).
  • Billions of these tiny electrical switches called transistors form the CPU and handle all computations.
  • Inside the CPU (Central Processing Unit), there are hundreds of millions β€” or even billions β€” of transistors.
  • A transistor is a microscopic binary switch that either allows or blocks the flow of electricity.
  • Every calculation, text, sound, or image you see on your screen is made possible by these transistors switching ON and OFF billions of times per second.

πŸ’‘ Example:
When you press a key on your keyboard, your CPU processes the electrical signal (a pattern of 0s and 1s) to decide what to display.



πŸ”Ή 2️⃣ The Binary System

  • The binary system is a base-2 numbering system.
  • It uses only two digits: 0 and 1.
  • Every binary position represents a power of 2 (1, 2, 4, 8, 16, 32, 64, 128 …).


  • Example:
Decimal:  13
Binary:   00001101
(8 + 4 + 1 = 13)


πŸ”Ή 3️⃣ Bit and Byte


  • Bit = β€œBinary Digit” β†’ the smallest piece of information (either 0 or 1).


  • Byte = group of 8 bits.


  • Each bit in a byte has a positional value:


128  64  32  16  8  4  2  1

  • Example:
Binary: 01000001 β†’ Decimal 65 β†’ Letter β€˜A’


πŸ”Ή 4️⃣ Converting Between Decimal and Binary

Decimal β†’ Binary:
Divide the decimal number by 2 repeatedly and note the remainders (bottom to top).
Example:

Decimal 20 β†’ Binary 10100



Binary β†’ Decimal:
Multiply each bit by its positional value and add them.
Example:

Binary 00010100 β†’ 16 + 4 = 20



πŸ”Ή β€œOnly One Way” to Represent a Number in Binary

  • In binary, every non-negative integer has exactly one representation (if you ignore leading zeros).
  • This means there is one unique set of bits (MSB…LSB) whose weighted sum equals the number.
  • You cannot choose a different combination of bit positions to get the same number β€” each power of two (1, 2, 4, 8, 16, …) is either used once or not used.
  • So in the above example the number 20 only comes from 4 + 16 bits, while in decimal system 20 can come from 10 + 10 , or 18 + 2 , or 15 + 5 ...etc.


πŸ”Ή 5️⃣ Capacity of Bytes

  • 1 byte = 8 bits β†’ max number = 255 (11111111).

  • 2 bytes = 16 bits β†’ max number = 65,535 (1111111111111111).



  • 8 bytes (64 bits) β†’ Value on 64th square = 9,223,372,036,854,775,808.
  • Total sum (1 to 64) β†’ 18,446,744,073,709,551,615



πŸ”Ή 6️⃣ Representing Characters – ASCII

  • Computers use codes to represent letters and symbols.
  • ASCII (American Standard Code for Information Interchange) assigns a unique binary code to each character.

  • Example:
    • β€˜A’ = 65 = 01000001
    • β€˜B’ = 66 = 01000010
    • Space = 32 = 00100000
  • Limitation: ASCII supports only English letters and limited symbols (128 or 256 codes).


πŸ”Ή 7️⃣ Unicode – A Universal Standard

  • To represent all world languages, Unicode was developed.
  • Unicode supports:
    • UTF-8 β†’ 256 characters
    • UTF-16 β†’ 65,536 characters
    • UTF-32 β†’ 4,294,967,296 characters
  • Example: Arabic letters such as β€œΩ…Ψ­Ω…Ψ―β€ require Unicode because ASCII cannot represent them.


πŸ”Ή Unicode vs ASCII



πŸ”— Interconnections


πŸ”Ή Binary System β†’ Foundation for all digital data.
πŸ”Ή Bits & Bytes β†’ Determine data size and capacity.
πŸ”Ή ASCII β†’ Enables computers to represent text in English.
πŸ”Ή Unicode β†’ Expands capability to represent global languages.


By understanding how binary underlies all computer data, you gain insight into how programs, storage, and communication truly work! ⚑


03 Programming Foundations - Binary System.pdf
Complete and Continue  
Discussion

47 comments