Number Systems
Number Systems
1
Objectives
2
Why Binary System?
Computers are made of a series of switches
Each state can be represented by a number 1 for “ON” and 0 for “OFF”
3
Converting Base-2 to Base-10
(1 0 0 1 1)2
OFF
OFF
ON/OFF
ON
ON
ON
Exponent: 24 23 22 21 20
Calculation: 16 + 0 + 0 + 2 + 1
= (19)10
4
Number Systems
Number systems include decimal, binary, octal and
hexadecimal
Each system have four number base
Number System Base Symbol
Binary Base 2 B
Octal Base 8 O
Decimal Base 10 D
Hexadecimal Base 16 H
5
Decimal Number System
The Decimal Number System uses base 10. It includes the digits {0, 1,2,…, 9}. The
weighted values for each position are:
Base
10^4 10^3 10^2 10^1 10^0 10^-1 10^-2 10^-3
6
Decimal Number System (cont.)
Each digit appearing to the left of the decimal point represents a value between zero and
nine times power of ten represented by its position in the number.
Digits appearing to the right of the decimal point represent a value between zero and
nine times an increasing negative power of ten.
=725.194
7
Binary Number System
Most modern computer system using binary logic. The computer represents
values(0,1) using two voltage levels (usually 0V for logic 0 and either +3.3 V or
+5V for logic 1).
The Binary Number System uses base 2 includes only the digits 0 and 1
32 16 8 4 2 1 0.5 0.25
8
Number Base Conversion
Binary to Decimal: multiply each digit by its weighted position, and add each
of the weighted values together or use expansion form directly.
1 * 128 + 1 * 64 + 0 * 32 + 0 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 =
128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 =202
9
Number Base Conversion (cont.)
Decimal to Binary: There are two methods, that may be used to convert from integer
number in decimal form to binary form:
• 1-Repeated Division By 2
When performing the division, the remainders which will represent the binary equivalent of
the decimal number are written beginning at the least significant digit (right) and each new
digit is written to more significant digit (the left) of the previous digit.
10
Number Base Conversion (cont.)
Decimal to Binary (cont.)
convert the number 333 to binary.
11
Octal Number System
Computer scientists are often looking for shortcuts to do things
One of the ways in which we can represent binary numbers is to use their octal
equivalents instead
12
Octal Number System (cont.)
Number: 2 4 1
“Sixty-Fours”
“Eights”
“Ones”
Placeholder Name:
13
Octal Number System (cont.)
Transform (44978)10 to Octal
44978 / 8 5622 2 2
5622 / 8 702 6 62
702/8 87 6 662
87/8 10 7 7662
10/8 1 2 27662
1/8 0 1 127662
14