Understanding the Binary Number System and Digital Data Representation
I am a Student, who finds beauty in simple things. I like to teach sometimes.
Search for a command to run...
I am a Student, who finds beauty in simple things. I like to teach sometimes.
No comments yet. Be the first to comment.
A step-by-step series for absolute beginners to learn how computers work, how to install and use an operating system, and how to start programming.
A functional computer system is an assembly of various hardware components, each performing specific tasks to process data and execute instructions. This document outlines the core internal components, essential peripherals, and common interfaces tha...
There is a distinct heaviness that descends when life proceeds smoothly on the surface. Externally, everything may be stable, yet the desire to die can persist not because of tragedy, but because of a realization regarding the future. If the destinat...
"I must not fear abstraction. Abstraction is the mind-killer. Abstraction is the little-death that brings total obliteration. I will face my abstraction. I will permit it to pass over me and through me. And when it has gone past I will turn the inner...
Ever wondered how the Python or JavaScript code you write actually makes your computer's fans spin up? How do abstract commands like print("Hello, World!") get turned into physical actions? The magic lies in a fundamental, deeply interconnected relat...
I'll speed through setting up an ASIC synthesis flow for the Ibex RISC-V core using entirely open-source tools. Tools Python 3.12.8 (for environment management) Yosys (logic synthesis) sv2v (SystemVerilog to Verilog conversion) OpenSTA (static ti...
Imagine this scene: A dimly lit room, humming with the quiet thrum of advanced technology. Three alien scientists are hunched over a console, staring intently at a string of data flashing across a screen: 0101010100... Alien Scientist #1: "It isn't r...
Modern computing systems rely entirely on the binary number system. Unlike the decimal system which uses ten symbols (0–9), the binary system uses only two: 0 and 1. These two symbols are sufficient to represent all forms of data in digital electronics, including numbers, text, images, and machine instructions. This post covers the core aspects of binary computation, the relationship between binary and decimal systems, how bits and bytes work, and how computers encode various types of data.
Humans use the decimal (base-10) number system by default. It is structured around ten digits, and place values increase by powers of 10. For example:
253 (base-10) = 2×10² + 5×10¹ + 3×10⁰
Computers, however, operate using the binary (base-2) system, where each digit (bit) is a 0 or a 1. A binary number like 1101 represents:
1101 (base-2) = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13 (base-10)
Conversion between binary and decimal is foundational in computer science and digital electronics. Every software program, web page, or media file you use is ultimately stored and manipulated as a sequence of binary digits.
A bit (binary digit) is the smallest unit of data in computing. It can represent two states—on or off, true or false, 1 or 0. While individual bits can represent simple conditions, modern systems process data in larger units.
A group of 8 bits forms a byte. This unit is widely used in memory storage, data transfer, and encoding standards. One byte can represent 256 unique values (2⁸), ranging from 0 to 255. Larger groupings include:
1 kilobyte (KB) = 1024 bytes
1 megabyte (MB) = 1024 KB
1 gigabyte (GB) = 1024 MB
Memory sizes and file sizes are expressed using these byte-based units.
Textual data is stored using character encoding schemes. The simplest such system is ASCII (American Standard Code for Information Interchange), which uses 7 or 8 bits to represent English letters, numbers, and symbols. For instance:
‘A’ → 01000001 (65 in decimal)
‘a’ → 01100001 (97 in decimal)
For broader language support, UTF-8 is commonly used. UTF-8 is a variable-length encoding system that can represent over a million characters, including symbols, emojis, and scripts from many world languages. It remains backward-compatible with ASCII for the first 128 characters.
Images are stored as arrays of pixels, where each pixel has color values that are typically stored using binary codes. In RGB (Red-Green-Blue) color space:
Each channel (R, G, B) is usually represented by 8 bits
A single pixel needs 24 bits (3 bytes) for full color
For example, pure red is stored as:
Red: 11111111, Green: 00000000, Blue: 00000000 → 0xFF0000 in hexadecimal
Image file formats like PNG, JPEG, and BMP include metadata, compression schemes, and color profiles—all encoded as binary data.
At the hardware level, a CPU executes machine instructions directly. These instructions are binary codes that control operations such as arithmetic, data movement, and branching. For example, in a simple architecture:
10110000 01100001
might mean: “Move the value 97 into register AL”.
Assembly language serves as a human-readable mapping to these binary machine codes. Compilers and assemblers convert higher-level code into these binary instructions.
Computers operate on binary data because it maps directly to the physical states of digital circuits. From numbers and characters to images and executable code, everything in a digital system is a structured sequence of 0s and 1s. Understanding how binary works and how it's used to represent different types of data is fundamental to programming, system design, and digital electronics.