Sie sind auf Seite 1von 5

NUMBER SYSTEMS AND CONVERSION

Number System or Numeral System


➢ a system of naming or representing numbers
➢ a mathematical notation for representing numbers by using symbols such as digits or letters
➢ A number can be represented differently in different systems. For example, the decimal number 25
can be represented as 1916 or 318. The three numbers(2510, 1916 , 318 ) are equal in terms of
quantity.
Base or Radix(r)
➢ The base of a number system corresponds to the number of symbols used to represent a number
in the said system. For example, the decimal number system uses 10 symbols.
➢ The name of a number system is usually named after its base.
➢ It also plays a role in the representation of numbers in the positional notation.
➢ In writing the number, the base should be written in subscript form after the number, examples :
13310, 1101102, 1FAB.CD16. When the base is not written, the default base is 10.

Types of Number System


➢ The four most common number systems are:
1. Decimal (Base 10)
2. Binary (Base 2)
3. Octal (Base 8)
4. Hexadecimal (Base 16)

Positional and Nonpositional Number Systems


➢ In positional notation, the value of a digit depends on its position. For examples :
321 – digit 1 has a value of one
312 – digit 1 has a value of ten
123 – digit 1 has a value of one hundred

➢ In non-positional numeral system, the value of a digit/symbol does not depend on its position. For
example, in a Roman numeral system:
C : symbol 'C' means 100
CCC : triple ‘C’s means 300 because each symbol has a value of 100.

Decimal Number System (Base 10)


➢ It uses 10 numeric symbols , 0 to 9
➢ the positions successive to the left of the decimal point represent units, tens, hundreds, thousands
and so on

Binary Number System (Base 2)


➢ It only uses 2 digits, 0 and 1
➢ The symbols used are often referred to as binary digits or bits.
➢ A number in binary system is known as binary number.

Octal Number System (Base 8)


➢ it uses the numeric symbols, 0 to 7
➢ A number in Octal system is known as an octal number.

Hexadecimal Number System (Base 16)


➢ It uses the numeric symbols, 0 to 9, and the letters A, B, C, D, E, F
➢ The symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15, respectively. The symbols
are referred to as hexadecimal digits and a number represented in this system is called a
hexadecimal number.
The First 16 numbers in Decimal, Binary, Octal, and Hexadecimal
Decimal Binary Octal Hexadecimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 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

Some Standard Positional Number Systems


Number System Name Base/Radix Symbols Used Example
Base 2 Binary 2 0,1 10112
Base 3 Ternary 3 0,1,2 212.213
Base 4 Quaternary 4 0,1,2,3 312234
Base 5 Quinary 5 0,1,2,3,4 4213.445
Base 6 Senary 6 0,1,2,3,4,5 2345.236
Base 7 Septenary 7 0,1,2,3,4,5,6 6231247
Base 8 Octal 8 0,1,2,3,4,5,6,7 63755.4548
Base 9 Nonary 9 0,1,2,3,4,5,6,7,8 7852.6769
Base 10 Decimal 10 0,1,2,3,4,5,6,7,8,9 54675.5610
Base 11 Undecimal 11 0,1,2,3,4,5,6,7,8,9,A A878.6711
Base 12 Duodecimal 12 0,1,2,3,4,5,6,7,8,9,A,B BABA.AB12
Base 13 Tridecimal 13 0,1,2,3,4,5,6,7,8,9,A,B,C ABC.AB313
Base 14 Tetradecimal 14 0,1,2,3,4,5,6,7,8,9,A,B,C,D DAB.DAB14
Base 15 Pentadecimal 15 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E E767.AB15
Base 16 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F FAF.3FD16

Number System Conversions


➢ A number in base r can be converted to base 10 or any other base.

A. Base r to Base 10 Conversion


➢ In converting a number in base r to base 10, we use the formula below:

(dndn-1dn-2…d1d0.d-1d-2..d-n)r = (dn x rn) + (dn-1 x rn-1)+ (dn-2x rn-2)+…+ (d1 x r1)+ (d0 x r0) +(d-1 x r-1)
+ (d-2 x r-2)+…..+ (d-n x r-n)

Examples
Convert the following to base 10. Round off results to 3 decimal places.
1. 1011.012

Solution:
Note: r = 2
1011.012 = (1x23)+(0x22)+(1x21)+(1x20)+(0x2-1)+(1x2-2) = 11.2510
1011.012 = 11.25010
2. A2E. 3C16
Solution:
note: r = 16
A2E. 3C16 = (A x 162) + (2 x 161) + (E x 160) + (3 x 16-1) + (C x 16-2)
replace the letter symbols with its decimal equivalent
A2E. 3C16 = (10 x 162) + (2 x 161) + (14 x 160) + (3 x 16-1) + (12 x 16-2)
A2E. 3C16 = 2606.23410

Exercise 1:
Convert the following to base 10. Round off results to 3 decimal places.
1. 2356.658
2. 2356.659
3. 67A5.6511
4. 101111.1112
5. CABD.A3B14

B. Base 10 to Base r Conversion


➢ In converting a number in Base 10 to Base r, separate the integer part and fraction part and
convert each part separately. (let N – the integer part ; F – the fraction part)
➢ The integer part is converted by repeated division by r and collecting the remainders. The process
ends when quotient is 0.
➢ The fraction part is converted by repeated multiplication of the fraction part of the product by r and
collecting the integer part of the product. The process ends when the product is 0.

Examples
Convert the following decimal numbers to base r. Perform 4 multiplications(fraction part)

1. 25.7910 to base 2

Solution: r = 2, integer part, N = 25, fraction part F = 0.79


Integer part Fraction part
N Remainder Multiplicand Multiplier Product
Quotient(N/r) Excess
(Dividend) (Excess*r) (F) (r) (F x r)
25 12 0.5 1 0.79 2 1.58
12 6 0 0 0.58 2 1.16
6 3 0 0 0.16 2 0.32
3 1 0.5 1 0.32 2 0.64
1 0 0.5 1
Note:
Note:
1. after the first multiplication, the new
1. after the first division, your N is the current
multiplicand is the fraction part of
quotient
the current product.
2. you can get the answer by collecting the
2. to get the answer, collect the integer
remainders starting from the bottom;
part of the products starting from
in this example the answer is
the top; in this example the answer
110012
is 11002
Final Answer : 25.7910 = 11001.11002 (3 decimal places as required)
2. 6895.8710 to hexadecimal
Solution: r = 16, N = 6895, F = 0.87

Integer part Fraction part


N N/r Excess Remainder F r Product
6895 430 0.9375 15 – F 0.87 16 13.92 (D)
430 26 0.875 14 - E 0.92 16 14.72 (E)
26 1 0.625 10 - A 0.72 16 11.52 (B)
1 0 0.0625 1 0.52 16 8.32
Note:
If the value of the remainder or integer part of the product is greater than 9, replace the value with its
hexadecimal equivalent
Final Answer : 6895.8710 = 1AEF.DEC816

Exercise 2:
Convert the following numbers to base r. Perform 4 multiplications(fraction part)
1. 2356.6510 to octal
2. 7356.61510 to hexadecimal
3. 347.6510 to binary
4. 1011.1115 to base 9

C. Base 2 to Base 8/16 (and vice versa) Conversion


➢ Conversion from binary to octal is done by partitioning the binary number into groups of three
bits each, starting from the binary point and proceeding to the left and to the right. The
corresponding octal digit is then assigned to each group.
➢ Conversion from binary to hexadecimal is done by partitioning the binary number into groups of
4 bits each, starting from the binary point and proceeding to the left and to the right. The
corresponding hexadecimal digit is then assigned to each group.
➢ Conversion from octal to binary is done by giving each octal digit its 3-bit binary equivalent.
➢ Conversion from hexadecimal to binary is done by giving each hexadecimal digit its 4-bit binary
equivalent.

Examples
Convert the following to the indicated base:
1. 163.1248 to base 2
2. 365A.5C16 to base 2
3. 11011010010001.10110112 to base 8 and 16

Solutions:
1.
Octal 1 6 3 . 1 2 4
Binary 001 110 011 . 001 010 100
Binary : 001110011.001010100
Final Answer : 1110011.001012
Note: remove insignificant bits(0s at the rightmost and leftmost)

2.
Hexadecimal 3 6 5 A . 5 C
Binary 0011 0110 0101 1010 . 0101 1100
Binary : 0011011001011010.01011100
Final Answer : 11011001011010.0101112

3.
Binary 11011010010001.1011011

Octal 11 011 010 010 001 . 101 101 1 //partition the number into groups of 3 bits
011 011 010 010 001 . 101 101 100 //add zeros to groups with less than 3 bits
33221.554 // convert each binary group to its octal equivalent
Final Answer : 33221.5548

Hexa 0011 0110 1001 0001 . 1011 0110 //partition the number into groups of 4 bits then
add zeros to groups with less than 4 bits
3 691.B6 //convert each group to its hexadecimal equivalent
Final Answer : 3691.B616

Exercise 3:
Convert the following numbers to the indicated base.
1. 3125.2348 = _______2
2. 52AD.5C816 = ______2
3. 10110111100100011.10101011012 = _______8 = ________16
4. 2673.67410 = _________16 =_________8 = __________2

References
1. https://byjus.com/maths/number-system/#what-is-number-system
2. https://www.c-programming-simple-steps.com/number-systems.html
3. https://en.wikipedia.org/wiki/List_of_numeral_systems
4. https://www.tutorialspoint.com/computer_logical_organization/digital_number_system.htm

Videos:
1. https://youtu.be/EewV3RBhiao

Das könnte Ihnen auch gefallen