Summary of Binary and hexadecimal number systems

Binary and Hexadecimal Number Systems: A Complete Guide

Positional Number Systems: The Foundation of Digital Computing

Welcome to the fascinating world of positional number systems! These systems are the backbone of how numbers are represented and processed, especially in the digital realm of computers. Unlike older, non-positional systems (like Roman numerals, where 'I' always means one, regardless of its position in 'IV' or 'VI'), a positional system assigns value to a digit based on its position within the number. The most common example we use every day is the decimal system, but computers heavily rely on binary, octal, and hexadecimal.

Understanding Positional Systems

Every positional number system is defined by its base, also known as its radix. The base dictates the number of unique digits or symbols used in that system.

Base (Radix): The number of unique digits or symbols used in a positional number system. For example, base 10 (decimal) uses 10 digits ($0-9$).

The fundamental principle of any positional system is that the value of a number is the sum of each digit multiplied by its corresponding power of the base. The position of a digit is counted from right to left, starting with $0$ for the rightmost digit (the least significant digit).

For a number represented as $d_n d_{n-1} \ldots d_1 d_0 . d_{-1} d_{-2} \ldots d_{-m}$ in base $B$, its value is calculated as:

$$ \text{Value} = d_n \cdot B^n + d_{n-1} \cdot B^{n-1} + \ldots + d_1 \cdot B^1 + d_0 \cdot B^0 + d_{-1} \cdot B^{-1} + d_{-2} \cdot B^{-2} + \ldots + d_{-m} \cdot B^{-m} $$

The Decimal System (Base 10)

The decimal system is likely the most familiar number system to you, as it's what we use in our daily lives. It has a base of $10$ and employs ten distinct digits: $0, 1, 2, 3, 4, 5, 6, 7, 8, 9$. Each position within a decimal number represents a power of $10$.

Example: The number $345.25_{10}$ can be broken down to understand its value:

$$ 3 \cdot 10^2 + 4 \cdot 10^1 + 5 \cdot 10^0 + 2 \cdot 10^{-1} + 5 \cdot 10^{-2} $$

$$ = 3 \cdot 100 + 4 \cdot 10 + 5 \cdot 1 + 2 \cdot 0.1 + 5 \cdot 0.01 $$

$$ = 300 + 40 + 5 + 0.2 + 0.05 $$

$$ = 345.25 $$

The Binary System (Base 2)

The binary system is the fundamental language of computers and all digital electronics. It operates with a base of $2$ and uses only two digits: $0$ and $1$. These digits are famously known as bits (binary digits).

Bit: A binary digit, either $0$ or $1$, representing the smallest unit of data in computing.

Computers leverage binary because electronic circuits can easily represent these two states: for instance, an electrical signal being 'on' or 'off', or a voltage being 'high' or 'low'. Each position in a binary number represents a power of $2$.

Example: Let's convert the binary number $1101_2$ to its decimal equivalent:

$$ 1 \cdot 2^3 + 1 \cdot 2^2 + 0 \cdot 2^1 + 1 \cdot 2^0 $$

$$ = 1 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 $$

$$ = 8 + 4 + 0 + 1 $$

$$ = 13_{10} $$

💡 Did you know?Did you know that the word "bit" was coined by John Tukey in 1946, though the concept of binary coding goes back much further, with ancient cultures using binary systems for divination and philosophy?

The Octal System (Base 8)

The octal system has a base of $8$ and uses eight digits: $0, 1, 2, 3, 4, 5, 6, 7$. Historically, it found use in early computer systems as a more compact way to represent binary numbers. This is because three binary digits (bits) can represent exactly one octal digit ($2^3 = 8$).

While less prevalent in general computing today compared to hexadecimal, octal is still encountered in specific applications, such as setting file permissions in Unix-like operating systems.

Example: Converting the octal number $27_8$ to decimal:

$$ 2 \cdot 8^1 + 7 \cdot 8^0 $$

$$ = 2 \cdot 8 + 7 \cdot 1 $$

$$ = 16 + 7 $$

$$ = 23_{10} $$

The Hexadecimal System (Base 16)

The hexadecimal system, often shortened to "hex," has a base of $16$. To represent sixteen distinct values, it uses the dig

Sign up for the full summary
FlashcardsKnowledge testSummaryPodcastMindmap
Start for free

Already have an account? Sign in

Positional Number Systems

Klíčová slova: Positional Number Systems, Number System Conversions, Two's Complement

Klíčové pojmy: Positional number systems assign value to digits based on their position and the system's base., The base (radix) defines the number of unique digits used in a system., The value of a number is the sum of each digit multiplied by the base raised to its position's power., Decimal (base 10) uses digits $0-9$ and is our everyday system., Binary (base 2) uses digits $0$ and $1$ (bits) and is fundamental to computers., Octal (base 8) uses digits $0-7$ and groups three binary digits into one octal digit ($2^3=8$)., Hexadecimal (base 16) uses digits $0-9$ and letters $A-F$ (for $10-15$)., Hexadecimal groups four binary digits into one hex digit ($2^4=16$) for concise representation., Interactive simulations help visualize how changing a bit impacts the overall numerical value across different bases., Always remember the rightmost digit is at position $0$ in any base calculation., Correctly assign decimal values to hexadecimal letters ($A=10, B=11, C=12, D=13, E=14, F=15$)., Positional systems are crucial for understanding digital electronics and computer science.

## Positional Number Systems: The Foundation of Digital Computing Welcome to the fascinating world of positional number systems! These systems are the backbone of how numbers are represented and processed, especially in the digital realm of computers. Unlike older, non-positional systems (like Roman numerals, where 'I' always means one, regardless of its position in 'IV' or 'VI'), a positional system assigns value to a digit based on its position within the number. The most common example we use every day is the decimal system, but computers heavily rely on binary, octal, and hexadecimal. ### Understanding Positional Systems Every positional number system is defined by its **base**, also known as its **radix**. The base dictates the number of unique digits or symbols used in that system. > **Base (Radix):** The number of unique digits or symbols used in a positional number system. For example, base 10 (decimal) uses 10 digits ($0-9$). The fundamental principle of any positional system is that the value of a number is the sum of each digit multiplied by its corresponding power of the base. The position of a digit is counted from right to left, starting with $0$ for the rightmost digit (the least significant digit). For a number represented as $d_n d_{n-1} \ldots d_1 d_0 . d_{-1} d_{-2} \ldots d_{-m}$ in base $B$, its value is calculated as: $$ \text{Value} = d_n \cdot B^n + d_{n-1} \cdot B^{n-1} + \ldots + d_1 \cdot B^1 + d_0 \cdot B^0 + d_{-1} \cdot B^{-1} + d_{-2} \cdot B^{-2} + \ldots + d_{-m} \cdot B^{-m} $$ ### The Decimal System (Base 10) The decimal system is likely the most familiar number system to you, as it's what we use in our daily lives. It has a base of $10$ and employs ten distinct digits: $0, 1, 2, 3, 4, 5, 6, 7, 8, 9$. Each position within a decimal number represents a power of $10$. **Example:** The number $345.25_{10}$ can be broken down to understand its value: $$ 3 \cdot 10^2 + 4 \cdot 10^1 + 5 \cdot 10^0 + 2 \cdot 10^{-1} + 5 \cdot 10^{-2} $$ $$ = 3 \cdot 100 + 4 \cdot 10 + 5 \cdot 1 + 2 \cdot 0.1 + 5 \cdot 0.01 $$ $$ = 300 + 40 + 5 + 0.2 + 0.05 $$ $$ = 345.25 $$ ### The Binary System (Base 2) The binary system is the fundamental language of computers and all digital electronics. It operates with a base of $2$ and uses only two digits: $0$ and $1$. These digits are famously known as **bits** (binary digits). > **Bit:** A binary digit, either $0$ or $1$, representing the smallest unit of data in computing. Computers leverage binary because electronic circuits can easily represent these two states: for instance, an electrical signal being 'on' or 'off', or a voltage being 'high' or 'low'. Each position in a binary number represents a power of $2$. **Example:** Let's convert the binary number $1101_2$ to its decimal equivalent: $$ 1 \cdot 2^3 + 1 \cdot 2^2 + 0 \cdot 2^1 + 1 \cdot 2^0 $$ $$ = 1 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 $$ $$ = 8 + 4 + 0 + 1 $$ $$ = 13_{10} $$ Did you know that the word "bit" was coined by John Tukey in 1946, though the concept of binary coding goes back much further, with ancient cultures using binary systems for divination and philosophy? ### The Octal System (Base 8) The octal system has a base of $8$ and uses eight digits: $0, 1, 2, 3, 4, 5, 6, 7$. Historically, it found use in early computer systems as a more compact way to represent binary numbers. This is because three binary digits (bits) can represent exactly one octal digit ($2^3 = 8$). While less prevalent in general computing today compared to hexadecimal, octal is still encountered in specific applications, such as setting file permissions in Unix-like operating systems. **Example:** Converting the octal number $27_8$ to decimal: $$ 2 \cdot 8^1 + 7 \cdot 8^0 $$ $$ = 2 \cdot 8 + 7 \cdot 1 $$ $$ = 16 + 7 $$ $$ = 23_{10} $$ ### The Hexadecimal System (Base 16) The hexadecimal system, often shortened to "hex," has a base of $16$. To represent sixteen distinct values, it uses the dig