Number Systems & Codes – The Language of Digital Electronics

Everything in digital electronics begins with numbers — but not the kind you use daily. Here, we deal with binary logic — a world of 0s and 1s that forms the backbone of computers, microcontrollers, and every smart system.

Let’s dive into the essential number systems and the interesting codes that help digital devices “think.”

Number Systems Used in Digital Electronics:

Binary Number System:

Base: 2

Digits Used: 0, 1

Common Use: Used in the core of digital electronics and computing systems.

Octal Number System:

Base: 8

Digits Used: 0 to 7

Common Use: Used for shorter representations of binary numbers.

Decimal Number System:

Base: 10

Digits Used: 0 to 9

Common Use: The number system we use daily in everyday counting and arithmetic.

Hexadecimal Number System:

Base: 16

Digits Used: 0 to 9, A to F

Common Use: Compact binary form, commonly used in memory addressing and color codes in computing.

Fun Fact: 1 Hex digit = 4 binary bits! That's why hex is used in programming and microcontroller registers.

Binary Arithmetic:
Arithmetic:
        0 + 0 = 0  
        0 + 1 = 1  
        1 + 0 = 1  
        1 + 1 = 0 (carry 1)
Subtraction: 
       0 - 0 = 0  
        1 - 0 = 1  
        1 - 1 = 0  
        0 - 1 = 1 (borrow 1)

Use 1’s complement or 2’s complement (for negative numbers):

Example:

Binary: 0101 (5)
1's complement: 1010
2's complement: 1011 (-5 in 2's complement)

Special Binary Codes You Must Know!

  • Binary Coded Decimal (BCD):
Each decimal digit is represented by its 4-bit binary equivalent.


Note: BCD is only valid for decimal digits 0 to 9.
Codes from 1010 to 1111 are invalid in BCD.

Used in: Calculators, digital clocks, 7-segment displays.

  • Gray Code – The No-Error Hero:

Only 0000 to 1001 are valid BCD digits (0–9). 1010 to 1111 are invalid!

Gray code changes only one bit at a time between values — reducing error in sensors and encoders.

Used in: Rotary encoders, analog-to-digital conversion

  • Excess-3 Code – Self-Completing Trickster:
This is BCD + 3. Each digit is increased by 3 and converted to binary.

Advantage: Easy subtraction and no negative values

Used in: Early digital systems, error detection

Binary Math at a Glance:

  • Binary = the heart of digital
  • Hex, Octal = shorthand for binary
  • 1’s & 2’s complement = represent negative numbers
  • BCD = 4-bit form of decimal digits
  • Gray Code = safe and reliable
  • Excess-3 = smart and self-complementary

Follow us on Instagram and Youtube for mini-explainers and circuit builds.

We’ll explore logic gates and build your foundation of combinational circuits.

Stay connected at hobitronics.blog




Comments

Popular posts from this blog

Why Does My Old Phone Charge Slowly But Heat Up More?

Controlling RGB LEDs with PWM Using Arduino

Why Do Phone Chargers Get Hot While Charging?

How MOSFETs Work with Arduino: PWM Control, Applications, and Pro Tips

Why Does Tea Taste Weird on an Induction Stove?

Understanding Masking, Enabling, and Disabling of Logic Gates

🎧 Sampling and Quantization Explained

Pulse Code Modulation (PCM): The Digital Backbone of Modern Communication