0% found this document useful (0 votes)
26 views

Unit Two - Number System

Data description

Uploaded by

Tesfaye Kifle
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Unit Two - Number System

Data description

Uploaded by

Tesfaye Kifle
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Unit Two: Number System

Computer Organization and Architecture


Proposed with: Computer Science and Technology Studios
2.1 The Number System
• Basically, there are two types of number systems:
I. Non-positional number system: The value of a symbol (digit) in a number does
not depend on the position of the digit in number.
II. Positional number system: The value of a symbol in the number is determined by
its position, the symbol and the base of the number system.
- Decimal number system: The decimal number system, also called the base 10 number
system, is the number system we use in our day-to-day life. The decimal number
system has 10 different symbols identified as 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
- Binary number system: The binary number system, also known as base 2 number
system, has two digits 0 and 1. The two digits of the binary number system correspond
to the two distinct states of the digital electronics.
2.1 The Number System
• Data Representation: Data in computers is represented in binary form.
• The represented data can be number, text, movie, color (picture), sound, or anything
else. We enter data into a computer using letters, digits & special symbols. But inside
the computer, there is no color, letter, digit or any other character inside the computer
system unit.
• Computers understand and respond to only the flow of electrical charge. They also have
storage devices that work based on magnetism.
• This shows that the overall structure of computers work only in binary conditions (the
semiconductors are conducting or not conducting, a switch is closed or opened, a
magnetic spot is magnetized or demagnetized).
• Hence, data must be represented in the form of binary code that has a corresponding
electrical signal. The form of binary data representation system we are seeking is
similar to the binary number system in mathematics.
2.1 The Number System
• Decimal number system: The decimal number system, also called the base 10 number system,
is the number system we use in our day-to-day life.
• The decimal number system has 10 different symbols identified as 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
• Binary number system: The binary number system, also known as base 2 number system, has
two digits 0 and 1.
• The two digits of the binary number system correspond to the two distinct states of the digital
electronics.
• Octal number system: The octal number system, also called base 8 number system, has 8
different symbols: 0, 1, 2, 3, 4, 5, 6, and 7.
• Hexadecimal number system: The hexadecimal number system, also called base 16 number
system, has 16 different symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. It is used to write
binary numbers in short form.
• Memory addresses and MAC addresses are usually written in hex.
2.1 The Number System
I. Conversion from Decimal to Base m
• Step 1: Divide the given decimal number by m (the desired base). The result will have
a quotient and a remainder.
• Step 2: Repeat step 1 until the quotient becomes 0, the quotient is 0 whenever the
number < m.
• Step 3: Collect and arrange the remainders in such a way that the first remainder is
the least significant digit and the last remainder is the most significant digit.
2.1 The Number System
Example 2.1: Convert the following decimal number 47 into binary, octal, and
hexadecimal.
A. Conversion to binary In order to convert the given decimal numbers into binary (base
2), they are divided by 2.

Quotient Remainder

Result: 101111
2.1 The Number System
B. Conversion to octal: Here the numbers are divided by 8 because the required base is
octal (base 8).
Quotient Remainder
Result: 57

C. Conversion to hexadecimal Since the conversion now is into hexadecimal (base 16) the
given decimal numbers are divided by 16.
Quotient Remainder
Result: 2F

The hexadecimal equivalent for the decimal 15 is F and that of 2 is 2.


2.1 The Number System
II. Conversion from Base m to Decimal
• Step 1: Multiply each digit by its positional value.
• Step 2: Calculate the sum of the products you get in step 1.

Example 2.2: Convert the binary number 110001 into decimal.


2.1 The Number System
Example 2.3: Convert the octal number 22 into decimal.

Example 2.4: Convert the hexadecimal number D1 into decimal.


2.1 The Number System
III. Conversion from Binary to Octal
• It is possible to use decimal number system as an intermediate base to convert from
any base to any other base.
• However, for conversion from binary to octal or vice versa, there is a very simple
method.
• Step 1: Group the binary digits (bits) starting from the rightmost dig into 3 bits. If the
remaining bits at the leftmost position are fewer than 3, add 0s at the front.
• Step 2: For each 3-bit binary string, find the corresponding octal number.
2.1 The Number System
Example 2.5: Convert the binary numbers 110011 to octal.

=
011
6 3
2.1 The Number System
IV. Conversion from Octal to Binary
• Step 1: For each octal digit, find the equivalent three digit binary number.
• Step 2: If there are leading 0s for the binary equivalent of the leftmost octal digit,
remove them.

Example 2.6: Find the binary equivalent for the octal numbers 73.

111 011
2.1 The Number System
V. From Binary to Hexadecimal
• One possible way to convert a binary number to hexadecimal, is first to convert the
binary number to decimal and then from decimal to hexadecimal.
• The simple steps states are stated below.
• Step 1: Starting from the rightmost bit, group the bits in 4. If the remaining bits at the
leftmost position are fewer than 4, add 0s at the front.
• Step 2: For each 4-bit group, find the corresponding hexadecimal number.
2.1 The Number System
Example 2.7: Convert the binary numbers 10011110 to hexadecimal.

1001 1110
9 E
2.1 The Number System
Binary Octal
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7
2.1 The Number System
Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
2.1 The Number System
Binary Hexadecimal
1000 8
1001 9
1010 A - (10 in decimal)
1011 B - (11 in decimal)
1100 C - (12 in decimal)
1101 D - (13 in decimal)
1110 E - (14 in decimal)
1111 F - (15 in decimal)
To Be Continued...
Computer Organization and Architecture
Proposed with: Computer Organization and Architecture

You might also like