Week 2 - Number Systemssadffff

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Computing Fundamentals

1
Number System

Module 002 – Number System


At the end of this module you are expected to:
1. Know the Number System.
2. Familiarize the Conversion of Number System
3. Determine the steps on how to convert Number System to different bases.

Number System
In mathematics, a 'number system' is a set of numbers, with one or more operations that
can perform like addition and multiplication.

Bit & Byte


Computer uses the binary system. Any physical system that can exist in two distinct
states (e.g., 0-1, on-off, hi-lo, yes-no, up-down, north-south, etc.) has the potential of being
used to represent numbers or characters.
A binary digit is called a bit. There are two possible states in a bit, usually expressed
as 0 and 1.
A series of eight bits strung together makes a byte, much as 12 makes a dozen. With
8 bits, or 8 binary digits, there exist 2^8=256 possible combinations. The following table
shows some of these combinations. (The number enclosed in parentheses represents the
decimal equivalent.)
You may regard each digit as a box that can hold a number. In the binary system,
there can be only two choices for this number -- either a "0" or a "1".
In the octal system, there can be eight possibilities: "0", "1", "2", "3", "4", "5", "6",
"7".
In the decimal system, there are ten different numbers that can enter the digit box:
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9".
In the hexadecimal system, we allow 16 numbers: "0", "1", "2", "3", "4", "5", "6",
"7", "8", "9", "A", "B", "C", "D", "E", and "F".
Base 2 (Binary) Base 10 (Decimal) Base 8 (Octal) Base 16 (Hexadecimal)
0 0 0 0

Course Module
1 1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9
10 A
B
C
D
E
F

Conversion of Number System


Binary Decimal Octal Hexadecimal
Binary to Decimal Decimal to Binary Octal to Binary Hexadecimal to Binary
Binary to Octal Decimal to Octal Octal to Decimal Hexadecimal to Decimal
Binary to Decimal to Hexadecimal Octal to Hexadecimal Hexadecimal to Octal
Hexadecimal

Binary numeral system


Is the fundamental numbering system of computer based system. The number
system follow the same set rule of decimal number system, but unlike the decimal system
that uses power of 10, the binary system works on the power of 2.
The binary numeral system, or base-2 number system represents numeric
values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional
notation with a radix of 2. Owing to its straightforward implementation in digital electronic
circuitry using logic gates, the binary system is used internally by all modern computers.
In the binary number system , a binary such as 1011011 is expresses with a string of
0’s and 1’s with each digit along the string starting from right to left. As the decimal number
is known as the weighted number, covering from decimal to binary or base 10 to base 2,
this will also produce a binary number with the right-hand most bit being the least
Computing Fundamentals
3
Number System

significant bit or LSB, and the left-hand bit being the most significant bit or MSB. Below is
the representation of a binary number.
Table 1.0 Representation of a binary number
28 27 26 25 24 23 22 21 20
256 128 64 32 16 8 4 2 1
From the given table the value of number system increases by the power of two.

To convert Binary to Decimal follow the steps below.


1. Plot the given number in a table following the value of number system as shown in the
table 1.0. Start from number 1, then leave the other blank or put the zero 0’s values
2. Add all the values from right to left at the position that are represented by 1’s
3. The add base 2 in the final answer
Example: Convert 1010011 to decimal / base 10
Step 1: Plot the given number in the table
Decimal 256 128 64 32 16 8 4 2 1
Digit
Value
Binary 0 0 1 0 1 0 0 1 1
Digit
Value

Step 2: Add all decimal digit value where the binary digit value is 1
64 + 16 + 2 + 1 = 83
Step 3: add the base 10 in the final answer
8310

Therefore: 10100112= 8310

Another way to convert is to directly get the nth power of a binary number then add all the
decimal numbers to get the final results. See figure 1.0 for example

Course Module
Figure 1.0 Convert 1010011 base 2 to base 10

To convert Binary to Octal follow the steps below.


Binary and octal systems are different number systems commonly used in
computing. They have different bases -- binary is base-two and octal base-eight -- meaning
they must be grouped to convert. In Octal number system binary are group into 3. This is to
get the base 8 value. Below are the steps on how to convert binary to octal or base 8.

1. Group the given binary value into three starting from the right. Note that you have to
pad the digits to three in order to meet the requirement of 3 per group.
2. Add 4,2 and 1 underneath each binary number per group.
3. Add the octal value of a number system represented by 1’s
Example: Convert 1010011 to octal/ base 8
4. Then read the final answer from right to left.

Step 1: Group the given binary value into three starting from the right
1|010|011
Note that we have to left pad the value to three therefore the grouped value
is:
001 | 0 1 0 | 0 1 1– The zero’s in blue text are the added value
Step 2: Add 4,2 and 1 underneath the binary value
001 | 0 1 0 | 0 1 1
4 21 | 4 2 1 | 4 2 1
Step 3: Add all octal where the number system is 1’s. Note all text in red in step 2 are
the octal value with 1’s
4 21 | 4 2 1 | 4 2 1
1 2 3
Computing Fundamentals
5
Number System

Step 4: Read the value from right to left.


123
Therefore, 10100112= 1238
A shortcut version of converting binary to octal is to group the given binary number to 3
starting right then add all raise value that is equal to 1. The raise power is 4,2,and 1 to complete
the 8 values of octal including the 0. See figure 2.0 below for example.

Figure 2.0 Convert 1010011 base 2 to base 8

To convert Binary to Hexadecimal follow the steps below.


Binary and hexadecimal systems are different number systems commonly used in
computing. They have different bases -- binary is base-two and hexadecimal is base-sixteen
-- meaning they must be grouped to convert. In hexadecimal number system binary are
group into 4. This is to get the base 16 value. Below are the steps on how to convert binary
to hexadecimal or base 16.
1. Group the given binary value into four starting from the right. Note that you have to pad
the digits to four in order to meet the requirement of 4 per group.
2. Add 8,4,2 and 1 underneath each binary number per group.
3. Add the hexadecimal value of a number system represented by 1’s
Example: Convert 1010011 to hexadecimal / base 16
4. Then read the final answer from right to left.

Step 1: Group the given binary value into four starting from the right
1 01 |0 011
Note that we have to left pad the value to four therefore the grouped value is:
01 0 1 | 0 0 1 1– The zero’s in blue text are the added value
Step 2: Add 8,4,2 and 1 underneath the binary value
01 0 1 | 0 0 1 1
84 2 1 | 8 4 2 1
Step 3: Add all hexadecimal value where the number system is 1’s. Note all text in red in
step 2 are the hexadecimal value with 1’s

Course Module
84 2 1 | 8 4 2 1
5 3
Step 4: Read the value from right to left.
53
Therefore, 10100112= 5316

Decimal system
The decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for
each place-value.

To convert Decimal to Binary follow the steps below.

1. Write the decimal number as the dividend. Then add a slash (/) and write the base of the
destination system (in our case, "2" for binary) as the divisor outside the curve of the division
symbol.
2. Divide the decimal number to binary number and write the remainder as 0 or 1. Continue to
divide until you reach the last digit
3. Read the remainder upward from bottom to top.
Note: In converting decimal to binary every remainder that is greater than to zero is consider one.
Since binary only accept two values which is 0 and 1.

Example: Convert 206 to binary base 2


Step 1,2: Write the decimal number as the dividend in a division symbol and write the
base of the destination system which is base 2.
Division of 2 Quotient Remainder/Bit value
206/2 103 0
103/2 51.5 1
51/2 25.5 1
25/2 12.5 1
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1

Step 3: Read the remainder upward


Remainder/Bit value
0
Computing Fundamentals
7
Number System

1
1
1
0
0
1
1

Final answer is 11001110


Therefore: 20610= 110011102

To convert Decimal to Octal follow the steps below.

1. Divide the given decimal value to 8 until we reach 0 value. To get the remainder multiple the
quotient by 8 minus the given number. The result from the subtraction is the remainder.
2. Read the values upward

Example: Convert 206 to octal / base 8


Step 1. Divide the decimal value to 8
Division of 28 Quotient Remainder/Bit value
206/8 25.75 206 – 200 = 6
25*8 = 200 Remainder is 6
25/8 3.125 25-24 = 1
3*8=24 Remainder is 1
3/8 0.375 8-5 = 3
Remainder = 3

Step 2. Read the values upward


Remainder/Bit value
206 – 200 = 6
Remainder is 6

Course Module
25-24 = 1
Remainder is 1
Remainder = 3
Final answer is 316
Therefore: 20610= 3168

To convert Decimal to Hexadecimal follow the steps below.

1. Divide the given decimal value to 16 until we reach 0 value. To get the remainder multiple the
quotient by 16 minus the given number. The result from the subtraction is the remainder.
2. Read the values upward

Example: Convert 206 to hexadecimal/ base 16


Step 1. Divide the decimal value to 8
Division of 28 Quotient Remainder/Bit value
206/16 12.875 206 – 192 = 6
12*16 = 192 Remainder is 14
12/16 0.75 12-0 = 12
Remainder is 12

Step 2. Read the values upward


Remainder/Bit value
206 – 192 = 6
Remainder is 14
12-0 = 12
Remainder is 12
Final answer is C E
Therefore: 20610= C E16

Octal system
The Octal (base t8) numeral system has 8 possible values (0,1,2,3,4,5,6,7) for each place-
value. Below is the value of octal to binary.
Octal 0 1 2 3 4 5 6 7
value
Binary 000 001 010 011 100 101 110 111
Value

To convert Octal to Binary follow the steps below.


Computing Fundamentals
9
Number System

1. Get the binary values of the given octal per digit. Refer to the table above for the binary value
2. Readthe answerdownward
Example: Convert 206 to binary/ base 2
Step 1,2: Get the binary value
Given 4 2 1 = 7 or also known as base 8
2 010
0 000
6 110
Therefore: 2068= 010 000 1102

To convert Octal to Decimal follow the steps below.


1. Get the given octal value and find the value of 8 to the nth power. Multiply the given number to
base 8 nth power.
2. Add the values.
Step 1,2: Multiple and add
Example: Convert 206 to decimal / base 10
206
6 * 80 = 6
0 * 81 = 0
2 * 82 = 128

128 + 0 + 6 = 134
Therefore: 2068 = 13410

To convert Octal to Hexadecimal follow the steps below.


1. Convert the octal number to binary
2. Read the binary number downward then group into 4.
3. Convert the binary number grouped by 4 to hexadecimal. Grouping should start from right to
left.
4. Add all with positive values and or equal to 1.
Example: Convert 206 to hexadecimal/ base 16

Course Module
Given 4 2 1 = 7 or also known as base 8
2 010
0 000
6 110

8421 84218421
0|1000 |0110
0 86
Therefore: 2068 = 8616

Hexadecimal system
The hexadecimal (base 16) numeral system has 16 possible values (0,1,2,3,4,5,6,7,8,9 and
A,E,C,D,E,F) for each place-value. Below is the value of hexadecimal to binary.
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
value
Binary Value 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1110

To convert Hexadecimal to Binary follow the steps below.


1. Get the binary values of the given hexadecimal per digit. Refer to the table above for the binary
value
2. Readthe answer downward
Example: Convert 206 to binary / base 2
Step 1,2: Get the binary value
Given 8 4 2 1 = 15 or also known as base
16
2 0010
0 0000
6 0110
Therefore: 20616= 0010 0000 01102

To convert Hexadecimal to Decimal follow the steps below.


1. Get the given hexadecimal value and find the value of 16 to the nth power. Multiply the given
number to base 16 nth power.
2. Add the values.
Step 1,2: Multiple and add
Computing Fundamentals
11
Number System

Example: Convert 206 to decimal / base 10


206
6 * 160 = 6
0 * 161 = 0
2 * 162 = 512

512 + 0 + 6 = 518
Therefore: 20616 = 51810

To convert hexadecimal to octal follow the steps below.


1. Convert the octal number to binary
2. Read the binary number downward then group into 3.
3. Convert the binary number grouped by 3 to hexadecimal. Grouping should start from right to
left.
4. Add all with positive values and or equal to 1.

Example: Convert 206 to octal / base 8


Given 8 4 2 1 = 7 or also known as base 8
2 0 010
0 0000
6 01 1 0

421 421421 421


001|000|000|110
100 6
Therefore: 20616 = 10068

Summary:
 A 'number system' is a set of numbers, together with one or more operations, such as addition or
multiplication.
 A binary digit is called a bit. There are two possible states in a bit, usually expressed as 0 and 1.
 In the binary system, there can be only two choices for this number -- either a "0" or a "1".

Course Module
 In the octal system, there can be eight possibilities: "0", "1", "2", "3", "4", "5", "6", "7".
 In the decimal system, there are ten different numbers that can enter the digit box: "0", "1",
"2", "3", "4", "5", "6", "7", "8", "9".
 In the hexadecimal system, we allow 16 numbers: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", and "F".
 The binary numeral system, or base-2 number system represents numeric values using two
symbols, 0 and 1.
 The decimal (base ten) number system, used in mathematics for writing numbers and performing
arithmetic.

References and Supplementary Materials


Books and Journals
1. Denning, Peter J.; Martell, Craig H. (2015). Great principles of computing MIT Press
QA 76 D3483 2015
2. Oleary, Timothy J. (2015). Computing essentials: making IT work for you. QA 76.5 O42
2011
3. Oleary, Timothy J.; Oleary, Linda I. (2015). Computing essentials 2014 : making it
work for you WLB McGrawhill QA 76 O54 2014

Online Supplementary Reading Materials


1. What is number system; http://www.ma.utexas.edu/users/mks/326K04/what.html;
July 31, 2018
2. Binary Fractions; https://www.electronics-tutorials.ws/category/binary ; July 31,
2018
3. Number system conversion;
http://fourier.eng.hmc.edu/e85_old/lectures/arithmetic/node3.html ; July 31, 2018

Online Instructional Videos


1. Binary to octal; https://www.youtube.com/watch?v=2UwxdCLFW70 ; August 3, 2018
2. Binary Tutorial; https://www.youtube.com/watch?v=0qjEkh3P9RE ; August 3, 2018
3. Hexadecimal tutorial; https://www.youtube.com/watch?v=m1JtWKuTLR0; August 3,
2018
4. Hexadecimal to octal; https://www.youtube.com/watch?v=GnFo-k6vKlo; August 3,
2018
5. Octal to binary; https://www.youtube.com/watch?v=TRWNKbaMwmc&t=161s;
August 3, 2018

You might also like