Ugenz Academy/IoT Tutorial

Number Systems

9 min read1,614 words

Reading progress

Keep learning

Number Systems in Electronics

1. Introduction

A number system is a method of representing numbers using a set of digits and specific rules.

In electronics and digital systems, number systems are important because computers, microcontrollers, processors, and digital circuits process information using binary data.

The four commonly used number systems in digital electronics are:

  • Decimal (Base 10)
  • Binary (Base 2)
  • Octal (Base 8)
  • Hexadecimal (Base 16)

Each system represents numerical values differently, but the underlying value can be the same.

Example: The same value in four number systems

25

Decimal

Base 10

11001

Binary

Base 2

31

Octal

Base 8

19

Hexadecimal

Base 16

All four representations above have the same numerical value: twenty-five in decimal.

2. Decimal Number System (Base 10)

The decimal number system is the standard number system used in everyday counting and calculations.

It uses ten digits:

0,1,2,3,4,5,6,7,8,90,1,2,3,4,5,6,7,8,9

Its base is 10 because it contains ten different digits.

Place value in decimal

Each digit has a value determined by its position. From right to left, the place values are powers of 10.

Consider the number 538538:

538=5×102+3×101+8×100538=5\times10^2+3\times10^1+8\times10^0 =500+30+8=500+30+8 538_10\boxed{538\_{10}}

Here, the subscript 1010 indicates that the number is in decimal.

Uses: Everyday counting, measurements, calculations, and displaying numerical results to people.

3. Binary Number System (Base 2)

The binary number system uses only two digits:

0 and 1\boxed{0\text{ and }1}

Its base is 2. Binary is fundamental to digital electronics because digital circuits commonly represent information using two distinguishable states, such as LOW and HIGH.

  • 0 — often represents LOW or OFF.
  • 1 — often represents HIGH or ON.

The exact voltage associated with each state depends on the electronic system.

Place value in binary

Binary place values are powers of 2:

…,24,23,22,21,20\ldots,2^4,2^3,2^2,2^1,2^0

Consider the binary number 101121011_2:

10112=1×23+0×221011_2=1\times2^3+0\times2^2 +1×21+1×20\quad+1\times2^1+1\times2^0 =8+0+2+1=8+0+2+1 10112=11_10\boxed{1011_2=11\_{10}}

Binary digits and bits

A binary digit is called a bit.

UnitMeaning
1 bitOne binary digit
4 bitsOne nibble
8 bitsOne byte
16 bitsTwo bytes

A byte contains eight bits, and a bit can represent one of two possible values: 0 or 1.

4. Octal Number System (Base 8)

The octal number system uses eight digits:

0,1,2,3,4,5,6,7\boxed{0,1,2,3,4,5,6,7}

Its base is 8, so each position represents a power of 8.

Place value in octal

Consider the number 1578157_8:

1578=1×82+5×81+7×80157_8=1\times8^2+5\times8^1+7\times8^0 =64+40+7=64+40+7 1578=111_10\boxed{157_8=111\_{10}}

The digit 8 is not valid in octal because its digits range from 0 to 7.

Uses of octal

  • Compact representation of binary values.
  • Unix/Linux file permission notation, such as 755 and 644.
  • Some computer and digital-system applications.

Octal is especially convenient because one octal digit corresponds to exactly three binary bits.

For example:

1112=78111_2=7_8

5. Hexadecimal Number System (Base 16)

The hexadecimal number system uses sixteen symbols:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

The letters represent values from 10 to 15.

Hexadecimal digitDecimal value
A10
B11
C12
D13
E14
F15

Hexadecimal place values are powers of 16.

Example

Convert 2F_162F\_{16} to decimal.

2F_16=2×161+15×1602F\_{16}=2\times16^1+15\times16^0 =32+15=32+15 2F_16=47_10\boxed{2F\_{16}=47\_{10}}

Uses of hexadecimal

  • Representing memory addresses.
  • Displaying machine code and debugging information.
  • Representing colors in web development, such as #FF0000 for red.
  • Writing compact representations of binary data.

One hexadecimal digit represents exactly four binary bits. For example:

11112=F_161111_2=F\_{16}

6. Comparison of the Four Number Systems

FeatureDecimalBinaryOctalHexadecimal
Base102816
Digits used0–90–10–70–9, A–F
Place valuesPowers of 10Powers of 2Powers of 8Powers of 16
Main useHuman calculationsDigital circuitsCompact binary notationCompact binary notation
Bits per digitNot fixed134

7. Number System Conversion

Number system conversion means representing the same numerical value in another base.

How Does a Computer Add Two Numbers? - LivePhysics

Decimal to binary

Repeatedly divide the decimal number by 2 and record the remainders. Read the remainders from bottom to top.

PPT - Chapter 1 Digital Systems and Numbers System PowerPoint Presentation - ID:2426989

Binary to octal

Group binary digits into sets of three, starting from the right, then convert each group to one octal digit.

PPT - Hexadecimal PowerPoint Presentation, free download - ID:3242839

Binary to hexadecimal

Group binary digits into sets of four, starting from the right, then convert each group to one hexadecimal digit.

A. Decimal to Binary

Convert 25_1025\_{10} to binary by repeated division by 2.

DivisionQuotientRemainder
25÷225\div2121
12÷212\div260
6÷26\div230
3÷23\div211
1÷21\div201

Read the remainders from bottom to top:

25_10=110012\boxed{25\_{10}=11001_2}

B. Binary to Decimal

Convert 11001211001_2 to decimal.

110012=1(24)+1(23)+0(22)11001_2=1(2^4)+1(2^3)+0(2^2) +0(21)+1(20)\quad+0(2^1)+1(2^0) =16+8+0+0+1=16+8+0+0+1 110012=25_10\boxed{11001_2=25\_{10}}

C. Decimal to Octal

Convert 83_1083\_{10} to octal.

DivisionQuotientRemainder
83÷883\div8103
10÷810\div812
1÷81\div801

Read the remainders from bottom to top:

83_10=1238\boxed{83\_{10}=123_8}

D. Decimal to Hexadecimal

Convert 254_10254\_{10} to hexadecimal.

DivisionQuotientRemainder
254÷16254\div161514 (E)
15÷1615\div16015 (F)

Read the remainders from bottom to top:

254_10=FE_16\boxed{254\_{10}=FE\_{16}}

E. Binary to Octal

Convert 1101012110101_2 to octal.

Group the binary digits into sets of three from the right:

110101110\quad101

Convert each group:

  • 1102=68110_2=6_8
  • 1012=58101_2=5_8

Therefore:

1101012=658\boxed{110101_2=65_8}

F. Binary to Hexadecimal

Convert 11101101211101101_2 to hexadecimal.

Group the binary digits into sets of four:

111011011110\quad1101

Convert each group:

  • 11102=E_161110_2=E\_{16}
  • 11012=D_161101_2=D\_{16}

Therefore:

111011012=ED_16\boxed{11101101_2=ED\_{16}}

8. Octal and Hexadecimal to Binary

These conversions are simple because each octal digit corresponds to three bits and each hexadecimal digit corresponds to four bits.

A. Octal to Binary

Convert 7258725_8 to binary.

Octal digitThree-bit binary
7111
2010
5101

Combine the groups:

7258=1110101012\boxed{725_8=111010101_2}

B. Hexadecimal to Binary

Convert 3A_163A\_{16} to binary.

Hexadecimal digitFour-bit binary
30011
A1010

Combine the groups:

3A_16=001110102\boxed{3A\_{16}=00111010_2}

Leading zeros can be removed when the bit width does not need to be preserved, so this is also 1110102111010_2.

9. Binary Arithmetic

Digital circuits use binary arithmetic to perform calculations.

A. Binary addition

Binary addition follows these rules:

AdditionResult
0+00+00
0+10+11
1+01+01
1+11+110 (write 0, carry 1)

Example:

   101
 + 011
 -----
  1000

Thus,

1012+0112=10002101_2+011_2=1000_2

In decimal, this is 5+3=85+3=8.

B. Binary subtraction

Binary subtraction follows these rules:

SubtractionResult
0−00-00
1−01-01
1−11-10
0−10-1Borrow 1 from the next position

Example:

   101
 - 010
 -----
   011

Therefore,

1012−0102=0112101_2-010_2=011_2

In decimal, this is 5−2=35-2=3.

10. Why Number Systems Are Important in Digital Electronics

Cambridge Mechatronics expands innovation with new R&D centre in Copenhagen, Denmark

Digital logic

Logic gates and digital circuits process binary values to perform calculations and make decisions.

stm32调试-- 获取内存数据_stm32怎么在调试界面显示数组里面所有内容-CSDN博客

Memory and processors

Binary represents stored data, while hexadecimal makes long binary values easier to read.

Probots ESP32 38-Pin NodeMCU WROOM-32 Dev Board Buy Online India

Microcontrollers and IoT

Devices such as Arduino and ESP32 process binary data. Hexadecimal is useful for displaying register values, addresses, and identifiers.

Writing CSS code - simple html, body and paragraph styling element

Programming and web development

Hexadecimal is used for color codes, memory inspection, debugging, and low-level programming.

11. Summary

A number system represents numerical values using a particular base.

  • Decimal (base 10): Uses digits 0–9.
  • Binary (base 2): Uses digits 0 and 1.
  • Octal (base 8): Uses digits 0–7.
  • Hexadecimal (base 16): Uses digits 0–9 and A–F.

Important conversion rules:

  • Decimal to binary: repeatedly divide by 2 and read remainders in reverse.
  • Decimal to octal: repeatedly divide by 8 and read remainders in reverse.
  • Decimal to hexadecimal: repeatedly divide by 16 and read remainders in reverse.
  • Binary to octal: group bits in threes.
  • Binary to hexadecimal: group bits in fours.

Understanding number systems is essential for learning digital electronics, computer architecture, microcontrollers, and programming.

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy