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:
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 :
Here, the subscript 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:
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:
Consider the binary number :
Binary digits and bits
A binary digit is called a bit.
| Unit | Meaning |
|---|---|
| 1 bit | One binary digit |
| 4 bits | One nibble |
| 8 bits | One byte |
| 16 bits | Two 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:
Its base is 8, so each position represents a power of 8.
Place value in octal
Consider the number :
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
755and644. - Some computer and digital-system applications.
Octal is especially convenient because one octal digit corresponds to exactly three binary bits.
For example:
5. Hexadecimal Number System (Base 16)
The hexadecimal number system uses sixteen symbols:
The letters represent values from 10 to 15.
| Hexadecimal digit | Decimal value |
|---|---|
| A | 10 |
| B | 11 |
| C | 12 |
| D | 13 |
| E | 14 |
| F | 15 |
Hexadecimal place values are powers of 16.
Example
Convert to decimal.
Uses of hexadecimal
- Representing memory addresses.
- Displaying machine code and debugging information.
- Representing colors in web development, such as
#FF0000for red. - Writing compact representations of binary data.
One hexadecimal digit represents exactly four binary bits. For example:
6. Comparison of the Four Number Systems
| Feature | Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|---|
| Base | 10 | 2 | 8 | 16 |
| Digits used | 0–9 | 0–1 | 0–7 | 0–9, A–F |
| Place values | Powers of 10 | Powers of 2 | Powers of 8 | Powers of 16 |
| Main use | Human calculations | Digital circuits | Compact binary notation | Compact binary notation |
| Bits per digit | Not fixed | 1 | 3 | 4 |
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 to binary by repeated division by 2.
| Division | Quotient | Remainder |
|---|---|---|
| 12 | 1 | |
| 6 | 0 | |
| 3 | 0 | |
| 1 | 1 | |
| 0 | 1 |
Read the remainders from bottom to top:
B. Binary to Decimal
Convert to decimal.
C. Decimal to Octal
Convert to octal.
| Division | Quotient | Remainder |
|---|---|---|
| 10 | 3 | |
| 1 | 2 | |
| 0 | 1 |
Read the remainders from bottom to top:
D. Decimal to Hexadecimal
Convert to hexadecimal.
| Division | Quotient | Remainder |
|---|---|---|
| 15 | 14 (E) | |
| 0 | 15 (F) |
Read the remainders from bottom to top:
E. Binary to Octal
Convert to octal.
Group the binary digits into sets of three from the right:
Convert each group:
Therefore:
F. Binary to Hexadecimal
Convert to hexadecimal.
Group the binary digits into sets of four:
Convert each group:
Therefore:
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 to binary.
| Octal digit | Three-bit binary |
|---|---|
| 7 | 111 |
| 2 | 010 |
| 5 | 101 |
Combine the groups:
B. Hexadecimal to Binary
Convert to binary.
| Hexadecimal digit | Four-bit binary |
|---|---|
| 3 | 0011 |
| A | 1010 |
Combine the groups:
Leading zeros can be removed when the bit width does not need to be preserved, so this is also .
9. Binary Arithmetic
Digital circuits use binary arithmetic to perform calculations.
A. Binary addition
Binary addition follows these rules:
| Addition | Result |
|---|---|
| 0 | |
| 1 | |
| 1 | |
| 10 (write 0, carry 1) |
Example:
101
+ 011
-----
1000
Thus,
In decimal, this is .
B. Binary subtraction
Binary subtraction follows these rules:
| Subtraction | Result |
|---|---|
| 0 | |
| 1 | |
| 0 | |
| Borrow 1 from the next position |
Example:
101
- 010
-----
011
Therefore,
In decimal, this is .
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.