CresignSys Learn — Lesson 013

Written by

in

Course: From Basic Science to Web Hosting

Module 03 — Digital Information

What Is Binary?

Difficulty: Beginner → Intermediate
Prerequisites: Lesson 012 — How Does a Transistor Become a Switch?
Estimated time: 25 minutes


1. The Big Question

We have reached an important point.

We started with:

Matter
 ↓
Atoms
 ↓
Electrons
 ↓
Electricity
 ↓
Semiconductors
 ↓
Transistors
 ↓
Switching

Now we need to answer:

How does a physical electrical switch become information?

The answer begins with:

Binary


2. What Does Binary Mean?

Binary is a base-2 number system.

It uses only two symbols:

0
1

Compare this with decimal:

Decimal
0 1 2 3 4 5 6 7 8 9

Binary:

Binary
0 1

3. Why Do Computers Use Binary?

Computers are built from electronic circuits.

Electronic circuits can be designed to reliably distinguish between two broad states:

LOW
HIGH

These can be interpreted as:

LOW  → 0
HIGH → 1

So:

Physical voltage
      ↓
Electrical state
      ↓
Digital interpretation
      ↓
0 or 1

This is why binary is so useful.


4. Binary Is an Abstraction

Remember something very important:

A computer does not contain tiny physical objects labeled “0” and “1.”

The physical system contains things such as:

Voltage
Current
Charge
Electric fields
Transistors
Capacitances

The computer’s digital circuits interpret physical states as logical values.

Therefore:

Physical world
      ↓
Electrical state
      ↓
Logical abstraction
      ↓
0 / 1

5. What Is a Bit?

A bit is a binary digit.

It can have two logical values:

0
1

So:

1 bit
 ↓
2 possible states

For example:

0
1

6. Two Bits

Now use two bits:

00
01
10
11

There are:

2² = 4

possible combinations.


7. Three Bits

Three bits:

000
001
010
011
100
101
110
111

There are:

2³ = 8

possible combinations.


8. General Rule

For n bits:

Number of possible combinations = 2ⁿ

Examples:

1 bit  → 2 states
2 bits → 4 states
3 bits → 8 states
4 bits → 16 states
8 bits → 256 states

This is one of the most important formulas in digital computing.


9. What Is a Byte?

A byte is conventionally:

8 bits

Example:

10110101

This contains:

8 binary digits

Therefore:

1 byte = 8 bits

10. Why 8 Bits?

Eight bits provide:

2⁸ = 256

possible combinations.

These combinations can represent:

0 → 255

when interpreted as an unsigned binary integer.


11. Binary Place Values

Decimal uses powers of 10:

1000
100
10
1

Binary uses powers of 2:

8
4
2
1

For four bits:

Binary position:

8    4    2    1
↓    ↓    ↓    ↓
0    0    0    0

12. Example: Binary 1011

Take:

1011

Place values:

8   4   2   1
1   0   1   1

Calculate:

1×8
+
0×4
+
1×2
+
1×1

Therefore:

8 + 0 + 2 + 1 = 11

So:

1011₂ = 11₁₀

13. Binary 1010

8   4   2   1
1   0   1   0

Therefore:

8 + 0 + 2 + 0 = 10

So:

1010₂ = 10₁₀

14. Decimal to Binary

Suppose we want to represent:

13

Using powers of two:

8 + 4 + 1 = 13

Therefore:

8  4  2  1
1  1  0  1

So:

13₁₀ = 1101₂

15. Why Computers Need Binary

Consider an electronic switch:

OFF

or:

ON

We can abstract it as:

OFF → 0
ON  → 1

Now connect eight switching elements:

Switch Switch Switch Switch Switch Switch Switch Switch
   ↓      ↓      ↓      ↓      ↓      ↓      ↓      ↓
   1      0      1      1      0      0      1      0

We have:

10110010

That is a byte.


16. From Transistor to Bit

This is the critical connection:

MOSFET
 ↓
Switching behavior
 ↓
Electrical HIGH/LOW
 ↓
Logic state
 ↓
0/1
 ↓
Bit

This is how physical electronics becomes digital information.


17. Bits Can Represent Numbers

For example:

00000000 = 0
00000001 = 1
00000010 = 2
00000011 = 3

And:

11111111 = 255

for an unsigned 8-bit number.


18. Bits Can Represent Text

Computers also need to represent letters.

A character encoding assigns numerical values to characters.

For example, ASCII assigns:

A = 65

65 in binary is:

01000001

So conceptually:

A
 ↓
65
 ↓
01000001
 ↓
Bits
 ↓
Electrical states

19. Bits Can Represent Images

An image can be represented using numbers.

For a simple grayscale image:

Pixel
 ↓
Brightness value
 ↓
Number
 ↓
Binary

A color image can use multiple numerical values per pixel.

For example:

Red
Green
Blue

These values can all be represented using bits.


20. Bits Can Represent Audio

Sound is a physical phenomenon.

A microphone converts sound pressure variations into an electrical signal.

An analog-to-digital converter then samples and quantizes the signal.

Conceptually:

Sound
 ↓
Microphone
 ↓
Electrical signal
 ↓
Sampling
 ↓
Quantization
 ↓
Binary data

That binary data can be stored or transmitted.


21. Bits Can Represent Video

Video is essentially a sequence of images over time, usually accompanied by audio.

Conceptually:

Scene
 ↓
Camera
 ↓
Images + sound
 ↓
Digital representation
 ↓
Binary data
 ↓
File / stream

22. Bits Can Represent Programs

This is even more important.

A program is ultimately represented in a form the computer’s processor can execute.

Simplified:

Program
 ↓
Source code
 ↓
Compiler / interpreter / runtime
 ↓
Machine instructions
 ↓
Binary representation
 ↓
CPU

At the hardware level, instructions are encoded as bit patterns.


23. What Is Machine Code?

A CPU has an instruction set architecture (ISA).

Instructions are encoded into machine-readable bit patterns.

Conceptually:

Instruction
 ↓
Binary encoding
 ↓
CPU
 ↓
Decode
 ↓
Execute

For example, a processor might have instructions conceptually corresponding to:

LOAD
ADD
STORE
JUMP
COMPARE

The actual binary encodings depend on the processor architecture.


24. Binary Is Not the Same as Machine Code

This distinction is important.

Binary is a number representation system.

Machine code is encoded processor instructions/data interpreted according to a specific instruction set architecture.

So:

Binary
 ↓
General representation system

while:

Machine code
 ↓
Specific encoding understood by a CPU architecture

25. Bits in Memory

Suppose a memory system stores:

10110010

Physically, the memory cell isn’t simply a tiny box containing “10110010.”

It uses physical states.

Depending on memory technology, information may be represented through things such as:

Charge
Voltage
Transistor state
Magnetic state

Again:

Physical state
      ↓
Electrical interpretation
      ↓
Logical bit

26. Bits Traveling Through a Network

Now we reach networking.

Suppose your browser requests:

https://templates.cresignsys.com

The information must travel through networks.

Conceptually:

Computer
 ↓
Network interface
 ↓
Electrical / optical / radio signal
 ↓
Network
 ↓
Router
 ↓
Internet
 ↓
Server

The physical signals represent digital information.


27. The Signal Is Not Literally “1 and 0”

This is another important distinction.

An Ethernet cable doesn’t contain little physical 1s and 0s traveling through it as objects.

Instead:

Binary information
      ↓
Encoded signal
      ↓
Electrical waveform
      ↓
Cable

At the receiving end:

Electrical waveform
      ↓
Receiver
      ↓
Signal processing
      ↓
Decoded bits

28. Optical Fiber

For fiber:

Bits
 ↓
Electrical signal
 ↓
Optical transmitter
 ↓
Light modulation
 ↓
Fiber
 ↓
Photodetector
 ↓
Electrical signal
 ↓
Bits

Therefore the Internet combines:

Digital information
+
Physical signals

29. Wireless

Wi-Fi uses electromagnetic waves.

Conceptually:

Bits
 ↓
Digital processing
 ↓
Radio modulation
 ↓
Electromagnetic wave
 ↓
Air
 ↓
Radio receiver
 ↓
Demodulation
 ↓
Bits

So the same binary information can travel through:

Copper
Fiber
Radio

using different physical signaling technologies.


30. From Binary to Web Hosting

Now we can connect the entire chain:

Transistor
 ↓
Switch
 ↓
0 / 1
 ↓
Bit
 ↓
Byte
 ↓
Data
 ↓
Machine instructions
 ↓
CPU
 ↓
Operating system
 ↓
Network protocols
 ↓
Internet
 ↓
HTTP/HTTPS
 ↓
Web server
 ↓
Website
 ↓
Web hosting

31. Your WordPress Website

When WordPress serves a page, enormous amounts of digital information are being processed.

For example:

Browser request
      ↓
Network packets
      ↓
Server network interface
      ↓
Linux
      ↓
Nginx
      ↓
PHP
      ↓
WordPress
      ↓
MySQL
      ↓
HTML/CSS/JS
      ↓
Network
      ↓
Browser

At the lowest hardware level:

Software
 ↓
CPU instructions
 ↓
Transistors
 ↓
Electrical signals

32. The Big Picture

You have now crossed another major boundary:

PHYSICAL WORLD
       ↓
Electricity
       ↓
Electronics
       ↓
Transistors
       ↓
DIGITAL WORLD
       ↓
Bits
       ↓
Data
       ↓
Programs
       ↓
Operating systems
       ↓
NETWORK WORLD
       ↓
Packets
       ↓
Internet
       ↓
WEB
       ↓
WEB HOSTING

33. What You Should Remember

The most important chain from today’s lesson is:

Transistor
   ↓
Electrical state
   ↓
HIGH / LOW
   ↓
Logical 1 / 0
   ↓
Bit
   ↓
Byte
   ↓
Data

And:

Binary is the mathematical representation; the hardware uses physical electrical states to implement it.


34. Quick Check

What is binary?

A base-2 number system using 0 and 1.

What is a bit?

A binary digit representing one logical binary state.

How many states can 8 bits represent?

2⁸ = 256

How many values can an unsigned 8-bit number represent?

0–255

What is a byte?

8 bits.

Can binary represent text?

Yes, through character encodings.

Can binary represent images?

Yes.

Can binary represent programs?

Yes.

Does a network cable physically contain 0s and 1s?

No. It carries physical signals that encode digital information.


Next Lesson

Lesson 014 — What Is a Computer?

Now we assemble everything we have learned:

Transistors
      ↓
Logic gates
      ↓
Digital circuits
      ↓
ALU
      ↓
Registers
      ↓
CPU
      ↓
RAM
      ↓
Storage
      ↓
Motherboard
      ↓
Computer

Then we will continue:

Computer
 ↓
Operating System
 ↓
Linux
 ↓
Processes
 ↓
Files
 ↓
Networking
 ↓
Server
 ↓
Web Hosting

This is where the course starts moving from electronics into computer engineering and operating systems.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *