From 249e9bc4327170cac699a08c0b2c61c34e78d576 Mon Sep 17 00:00:00 2001 From: David Daniels <49681400+Tetricz@users.noreply.github.com> Date: Tue, 13 Sep 2022 12:58:12 -0500 Subject: [PATCH 1/5] update number systems (#1) * update number systems with bases and conversion * update main number systems * redo tables * update heading links * update number system main --- Number System/readme.md | 172 ++++++++++++++++++++-------------------- readme.md | 16 ++-- 2 files changed, 96 insertions(+), 92 deletions(-) diff --git a/Number System/readme.md b/Number System/readme.md index b4f625a4..d5a499fb 100644 --- a/Number System/readme.md +++ b/Number System/readme.md @@ -1,89 +1,93 @@ -# Number System -Number system is a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in a number system are called numerals. The symbols used in a number system are called numerals. - -## Types of Number Systems -- [Binary Number System](#binary-number-system) -- [Octal Number System](#octal-number-system) -- [Decimal Number System](#decimal-number-system) -- [Hexadecimal Number System](#hexadecimal-number-system) - -## Binary Number System -Binary Numbers only have two digits, 0 and 1. Binary numbers are used in computers because they are easy to represent using electronic circuits. Binary numbers are also used in digital electronics, such as digital cameras, digital watches, and digital televisions. - -| Decimal | Binary | -|---------|--------| -| 0 | 0 | -| 1 | 1 | -| 2 | 10 | -| 3 | 11 | -| 4 | 100 | -| 5 | 101 | -| 6 | 110 | -| 7 | 111 | -| 8 | 1000 | -| 9 | 1001 | -| 10 | 1010 | - -## Octal Number System -Octal Numbers have eight digits, 0, 1, 2, 3, 4, 5, 6, and 7. The main advantage of using octal numbers is that they uses less digits than decimal numbers. Octal numbers are used in Unix and Linux operating systems. - -| Decimal | Octal | -|---------|-------| -| 0 | 0 | -| 1 | 1 | -| 2 | 2 | -| 3 | 3 | -| 4 | 4 | -| 5 | 5 | -| 6 | 6 | -| 7 | 7 | -| 8 | 10 | -| 9 | 11 | -| 10 | 12 | - -## Decimal Number System -Decimal Numbers have ten digits, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Decimal numbers are used in everyday life. - -| Decimal | Decimal | -|---------|---------| -| 0 | 0 | -| 1 | 1 | -| 2 | 2 | -| 3 | 3 | -| 4 | 4 | -| 5 | 5 | -| 6 | 6 | -| 7 | 7 | -| 8 | 8 | -| 9 | 9 | -| 10 | 10 | - -## Hexadecimal Number System -Hexadecimal Numbers have sixteen digits, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The Hexadecimal, or Hex, numbering system is commonly used in computer and digital systems to reduce large strings of binary numbers into a sets of four digits for us to easily understand - -| Decimal | Hexadecimal | -|---------|-------------| -| 0 | 0 | -| 1 | 1 | -| 2 | 2 | -| 3 | 3 | -| 4 | 4 | -| 5 | 5 | -| 6 | 6 | -| 7 | 7 | -| 8 | 8 | -| 9 | 9 | -| 10 | A | -| 11 | B | -| 12 | C | -| 13 | D | -| 14 | E | -| 15 | F | - -## Number System Conversion -Number system conversion is the process of converting a number from one number system to another. There are many number system conversion tools available online. Here are some of them: +# [Number Systems](#number-systems) + +Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in the decimal number system are the Hindu-Arabic numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is base 10, which means that each place in the number represents a power of 10, also known as the base or the radix. + +## [Table of Contents](#table-of-contents) + +- [Number Systems](#number-systems) + - [Table of Contents](#table-of-contents) + - [Common Number Systems](#common-number-systems) + - [Binary](#binary) + - [Decimal](#decimal) + - [Decimal](#decimal-1) + - [Hexadecimal](#hexadecimal) + - [Base/Radix Conversion](#baseradix-conversion) + - [Radix to Decimal](#radix-to-decimal) + - [Decimal to Radix](#decimal-to-radix) + - [Mixed-Base Number Systems](#mixed-base-number-systems) + +## [Common Number Systems](#common-number-systems) + +### [Binary](#binary) + +Binary Numbers only have two v, 0 and 1. Binary numbers are used in computers because they are easy to represent using electronic circuits. Binary numbers are also used in digital electronics, such as digital cameras, digital watches, and digital televisions. + +| | | | | | | | | | | | | | | | | | +|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| +| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | +| Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 | + +### [Decimal](#decimal) + +Octal Numbers have eight characters, 0, 1, 2, 3, 4, 5, 6, and 7. The main advantage of using octal numbers is that they are easier to work with than binary numbers. Octal numbers are used in computer programming and in the Unix operating system. + +| | | | | | | | | | | | | | | | | | +|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| +| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | +| Octal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | + +### [Decimal](#decimal-1) + +Decimal Numbers have ten characters, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Decimal numbers are commonly used in everyday life. + +| | | | | | | | | | | | | | | | | | +|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| +| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | + +### [Hexadecimal](#hexadecimal) + +Hexadecimal Numbers have sixteen characters, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The Hexadecimal, or Hex, numbering system is commonly used in computer and digital systems to reduce large strings of binary numbers into a sets of four digits for us to easily read. + +| | | | | | | | | | | | | | | | | | +|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| +| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | +| Hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | + +## [Base/Radix Conversion](#baseradix-conversion) + +Base/Radix conversion is the process to convert the number from one base to another base. For example, converting a decimal number to binary number. These are some example videos on the common types. [Youtube Video Playlist](https://www.youtube.com/playlist?list=PL0o_zxa4K1BXCpQbUdf0htZE8SS0PYjy-) +### [Radix to Decimal](#radix-to-decimal) + +The basic formula for another radix to decimal conversion is: +$a = r_m b^m + r_{m-1}b^{m-1} + r_{m-2}b^{m-2} + r_{1}b^{1} + r_{0}b^{0}$ +where, m is a nonnegative integer and the r's are integers such that +$0 < r_m < b$ and $0 ≤ r_i < b for i = 0, 1, ... , m − 1$. + +Example: Convert 2212 from base 3 (radix_3) to decimal (radix_10) + +$a = (2)3^3+(2)3^2+(1)3^1+(2)3^0$ +$a = 77$ + +Thus $2212_{3} = 77_{10}$. + +### [Decimal to Radix](#decimal-to-radix) + +The basic algorithm for decimal to another radix conversion is to take the decimal number and divide it by the new base/radix. The remainder is the rightmost digit of the new number. The quotient is the new number to be converted. The process is repeated until the quotient is zero. + +Example: Convert 77 from decimal (radix_10) to base 5 (radix_5) + +$77/5 = 15b + 2$   the remainder is 2, so the rightmost digit of the new number is 2. The quotient is 15, so the new number to be converted is 15. +$a = 2$ +$15/5 = 3b + 0$    the remainder is 0, so the rightmost digit of the new number is 0. The quotient is 3, so the new number to be converted is 3. +$a = 02$ +$3/5 = 0b + 3$      the remainder is 3, so the rightmost digit of the new number is 3. The quotient is 0, so the new number to be converted is 0. +$a = 302$ + +Thus $77_{10} = 302_{5}$. +## [Mixed-Base Number Systems](#mixed-base-number-systems) +Mixed-base number systems are number systems that use more than one base. Such numerical representation applies when a quantity is expressed using a sequence of units that are each a multiple of the next smaller one, but not by the same factor. The easiet example of a mixed-base number system is from our timekeeping methods. 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day, 7 days in a week, 4 weeks in a month, 12 months in a year, 10 years in a decade, 10 decades in a century, 10 centuries in a millennium. All of these are different bases and they are all combined to make our timekeeping system. diff --git a/readme.md b/readme.md index 5dda4467..9030fa04 100644 --- a/readme.md +++ b/readme.md @@ -35,14 +35,14 @@ Boolean logic is a branch of mathematics that deals with the values of truth and | && | AND | Returns true if both operands are true. | | \|\| | OR | Returns true if either operand is true. | -## [Number Systems](Number%20System/readme.md) -A number system is a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in a number system are called numerals. The symbols used in a number system are called numerals. - -### Types of Number Systems -- [Binary Number System](Number%20System/readme.md#binary-number-system) -- [Octal Number System](Number%20System/readme.md#octal-number-system) -- [Decimal Number System](Number%20System/readme.md#decimal-number-system) -- [Hexadecimal Number System](Number%20System/readme.md#hexadecimal-number-system) +## [Number Systems](Number%20System/readme.md#number-systems) +Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. + +### [Common Types of Number Systems](Number%20System/readme.md#common-number-systems) +- [Binary](Number%20System/readme.md#binary) +- [Octal](Number%20System/readme.md#octal) +- [Decimal](Number%20System/readme.md#decimal) +- [Hexadecimal](Number%20System/readme.md#hexadecimal) ## [Registers and RAM](#registers-and-ram) Registers are small amounts of high-speed memory contained within the CPU. They are used by the processor to store small amounts of data that are needed during processing. Whereas RAM stands for random-access memory. It is essentially short term memory where data is stored as the processor needs it. From 11726ab9e8f0163011972faa6815226617d54a72 Mon Sep 17 00:00:00 2001 From: Tetricz Date: Tue, 13 Sep 2022 13:45:22 -0500 Subject: [PATCH 2/5] add positional and sign-value systems --- Number System/readme.md | 25 +++++++++++++++++++------ readme.md | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Number System/readme.md b/Number System/readme.md index d5a499fb..ad3c83c8 100644 --- a/Number System/readme.md +++ b/Number System/readme.md @@ -1,22 +1,35 @@ # [Number Systems](#number-systems) -Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in the decimal number system are the Hindu-Arabic numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is base 10, which means that each place in the number represents a power of 10, also known as the base or the radix. +Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. ## [Table of Contents](#table-of-contents) - [Number Systems](#number-systems) - [Table of Contents](#table-of-contents) - - [Common Number Systems](#common-number-systems) + - [Types of Number Systems](#types-of-number-systems) + - [Positional Numeral System](#positional-numeral-system) + - [Sign-value Notation System](#sign-value-notation-system) + - [Common Positional Number Systems](#common-positional-number-systems) - [Binary](#binary) + - [Octal](#octal) - [Decimal](#decimal) - - [Decimal](#decimal-1) - [Hexadecimal](#hexadecimal) - [Base/Radix Conversion](#baseradix-conversion) - [Radix to Decimal](#radix-to-decimal) - [Decimal to Radix](#decimal-to-radix) - [Mixed-Base Number Systems](#mixed-base-number-systems) -## [Common Number Systems](#common-number-systems) +## [Types of Number Systems](#types-of-number-systems) + +### [Positional Numeral System](#positional-numeral-system) + +Positional Notation most commonly uses the decinal system. The symbols used in the decimal number system are the Hindu-Arabic numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. It is positional numeral system and is base 10, which means that each place in the number represents a power of 10, also known as the radix. The place value of each digit is determined by its position in the number, with the most significant digit on the left and the least significant digit on the right. The value of a digit is multiplied by the radix raised to the power of its position. For example, in the number 123, the digit 1 is in the hundreds place, the digit 2 is in the tens place, and the digit 3 is in the ones place. The value of the digit 1 is 100, the value of the digit 2 is 20, and the value of the digit 3 is 3. The sum of these values is 123. + +### [Sign-value Notation System](#sign-value-notation-system) + +Sign-value notation represents numbers by a series of numeric signs that when added together give the value of the number. The most commonly known exmaple would be Roman Numerals, where I means 1, V means 5, X means 10. Thus IV means 4, IX means 9, and XI means 11. Sign-value notation is mostly historical and is not used commonly in the modern world. + +## [Common Positional Number Systems](#common-positional-number-systems) ### [Binary](#binary) @@ -27,7 +40,7 @@ Binary Numbers only have two v, 0 and 1. Binary numbers are used in computers be | Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | | Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 | -### [Decimal](#decimal) +### [Octal](#octal) Octal Numbers have eight characters, 0, 1, 2, 3, 4, 5, 6, and 7. The main advantage of using octal numbers is that they are easier to work with than binary numbers. Octal numbers are used in computer programming and in the Unix operating system. @@ -36,7 +49,7 @@ Octal Numbers have eight characters, 0, 1, 2, 3, 4, 5, 6, and 7. The main advant | Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | | Octal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -### [Decimal](#decimal-1) +### [Decimal](#decimal) Decimal Numbers have ten characters, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Decimal numbers are commonly used in everyday life. diff --git a/readme.md b/readme.md index 9030fa04..4ef6a54a 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ Boolean logic is a branch of mathematics that deals with the values of truth and | \|\| | OR | Returns true if either operand is true. | ## [Number Systems](Number%20System/readme.md#number-systems) -Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. +Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in the decimal number system are the Hindu-Arabic numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. ### [Common Types of Number Systems](Number%20System/readme.md#common-number-systems) - [Binary](Number%20System/readme.md#binary) From f3fc3da64e08af2ddd1dfb69925600286ca6d79c Mon Sep 17 00:00:00 2001 From: Tetricz Date: Tue, 13 Sep 2022 14:04:43 -0500 Subject: [PATCH 3/5] add positional-sign-value --- readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4ef6a54a..249c3482 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,15 @@ Boolean logic is a branch of mathematics that deals with the values of truth and | \|\| | OR | Returns true if either operand is true. | ## [Number Systems](Number%20System/readme.md#number-systems) -Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. The symbols used in the decimal number system are the Hindu-Arabic numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. + +Number systems are a mathematical system for expressing numbers. A number system consists of a set of symbols that are used to represent numbers, and a set of rules for manipulating those symbols. The symbols used in a number system are called numerals. + +### [Types of Number Systems](#types-of-number-systems) + +- [Positional Numeral System](Number%20System/readme.md#positional-numeral-system) +- [Sign-value Notation System](Number%20System/readme.md#sign-value-notation-system) + +### [Common Positional Number Systems](#common-positional-number-systems) ### [Common Types of Number Systems](Number%20System/readme.md#common-number-systems) - [Binary](Number%20System/readme.md#binary) From a63863b06d2f7995b2417b3c3e54afdf2c555146 Mon Sep 17 00:00:00 2001 From: Tetricz Date: Tue, 13 Sep 2022 14:05:25 -0500 Subject: [PATCH 4/5] remove common types --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index 249c3482..44d466cf 100644 --- a/readme.md +++ b/readme.md @@ -46,7 +46,6 @@ Number systems are a mathematical system for expressing numbers. A number system ### [Common Positional Number Systems](#common-positional-number-systems) -### [Common Types of Number Systems](Number%20System/readme.md#common-number-systems) - [Binary](Number%20System/readme.md#binary) - [Octal](Number%20System/readme.md#octal) - [Decimal](Number%20System/readme.md#decimal) From fb09a2993958d3fe192e156055ce09351f0605ba Mon Sep 17 00:00:00 2001 From: Tetricz Date: Tue, 13 Sep 2022 14:12:28 -0500 Subject: [PATCH 5/5] squash table into one --- Number System/readme.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Number System/readme.md b/Number System/readme.md index ad3c83c8..1b9c3741 100644 --- a/Number System/readme.md +++ b/Number System/readme.md @@ -35,36 +35,36 @@ Sign-value notation represents numbers by a series of numeric signs that when ad Binary Numbers only have two v, 0 and 1. Binary numbers are used in computers because they are easy to represent using electronic circuits. Binary numbers are also used in digital electronics, such as digital cameras, digital watches, and digital televisions. -| | | | | | | | | | | | | | | | | | -|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| -| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -| Binary | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 | - ### [Octal](#octal) Octal Numbers have eight characters, 0, 1, 2, 3, 4, 5, 6, and 7. The main advantage of using octal numbers is that they are easier to work with than binary numbers. Octal numbers are used in computer programming and in the Unix operating system. -| | | | | | | | | | | | | | | | | | -|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| -| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -| Octal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | - ### [Decimal](#decimal) Decimal Numbers have ten characters, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Decimal numbers are commonly used in everyday life. -| | | | | | | | | | | | | | | | | | -|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| -| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | - ### [Hexadecimal](#hexadecimal) Hexadecimal Numbers have sixteen characters, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The Hexadecimal, or Hex, numbering system is commonly used in computer and digital systems to reduce large strings of binary numbers into a sets of four digits for us to easily read. -| | | | | | | | | | | | | | | | | | -|:--------|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| -| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -| Hexadecimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | +| Deciaml | Binary | Octal | Hexadecimal | +|:-------:|:------:|:-----:|:-----------:| +| 0 | 0000 | 0 | 0 | +| 1 | 0001 | 1 | 1 | +| 2 | 0010 | 2 | 2 | +| 3 | 0011 | 3 | 3 | +| 4 | 0100 | 4 | 4 | +| 5 | 0101 | 5 | 5 | +| 6 | 0110 | 6 | 6 | +| 7 | 0111 | 7 | 7 | +| 8 | 1000 | 10 | 8 | +| 9 | 1001 | 11 | 9 | +| 10 | 1010 | 12 | A | +| 11 | 1011 | 13 | B | +| 12 | 1100 | 14 | C | +| 13 | 1101 | 15 | D | +| 14 | 1110 | 16 | E | +| 15 | 1111 | 17 | F | ## [Base/Radix Conversion](#baseradix-conversion)