Академический Документы
Профессиональный Документы
Культура Документы
1
INCLUDES:
Number representation
✓ show understanding of the basis of different
number systems and use the binary, denary
and hexadecimal number system
AS ’C’ ROLL.NO.-1
018A065
1
Introduction:
From simple calculations on our fingertips, to complex machines, we have used
many forms of number system. Among these number systems, these number
systems have been widely used :
1044= 1✕103+0✕102+4✕101+4✕100
(1011101)2=1✕26+0✕25+ 1✕24+1✕23+1✕22+0✕21+1✕20=(93)10
This number system is also used to construct a truth table, 1 representing true and
0 representing false.
Octal number system
An octal number:
(10473)8= 1✕83+0✕82+4✕81+4✕80=(548)10
(9AAB)16= 9✕163+A(10)✕162+A(10)✕161+B(11)✕160=(39595)10
It is used as octal numbers as a digit can represent 4 bits, which is more than that
of the octal number system.
CONVERSION OF NUMBERS FROM
ONE SYSTEM TO ANOTHER
Example conversion:
Number system: Base: Example number: In base 10:
7 Simplify 8+4+0+1
7 Simplify 448+16+4
5 Raise the power of 16 from 0 starting with the right 2✕162 +7✕161 +3✕160
7 Simplify 512+112+3
Binary: 2 910 0
Answer
dividend 0. Also note the remainder in each case.
2 28 0
3. Since 0 cannot be divided by 2, we stop when the
dividend is zero. 2 14 0
4. The remainder, from top to bottom reads; 2 7 1
011000111. This is not the answer. To get the
2 3 1
answer, we simply reverse this digit. The answer is;
2 1 1
111000110
5. Answer:111000110 0
Conversion of Decimal to Number Remainder
Hexadecimal: 16 910 14
1. Get a number. 16 56 8
{910} 16 3 3
2. Divide the number several times, until you get the 0
Answer
dividend 0. Also note the remainder in each case.
3. Since divided by 16 returns 0 again, we stop when
the dividend is zero.
4. The remainder, from top to bottom reads; 14,8,3.
This is not the answer. To get the answer, we simply
reverse this digit. The answer is; 3,8,14
5. In the answer, numbers 10 - 15 are represented by
A,B,C,D,E,F respectively.
6. Answer: 38E
Conversion of Decimal to Number Remainder
Octal: 8 910 6
{910} 8 14 6
2. Divide the number several times, until you get the 8 1 1
Answer
dividend 0. Also note the remainder in each case.
0
3. Since divided by 16 returns 0 again, we stop when
the dividend is zero.
4. The remainder, from top to bottom reads; 6161. This
is not the answer. To get the answer, we simply
reverse this digit. The answer is; 1616
5. Answer: 1616
Conversion of Binary to Hexadecimal:
There are mainly two different ways to convert binary to hexadecimal and vice-
versa :-
1. Normal conversion:
a. Converting Hexadecimal into Decimal
b. Converting Decimal into Binary
1. Bit conversion:
a. Constructing a comparison table {explained with table}
Conversion of Binary to Octal:
There are mainly two different ways to convert binary to Octal and vice-versa :-
1. Normal conversion:
a. Converting Octal into Decimal
b. Converting Decimal into Binary
1. Bit conversion:
a. Constructing a comparison table {explained with table}
Bit conversion:
It a from of number conversion in which a number from a number system is
compared with equivalent number in another number system, usually done by
making a table. This type of conversion is not possible for all number systems, but
only for:
This is possible as the greatest 3 digit binary number is equal to the greatest 1
digit octal number and the greatest 4 digit binary number is equivalent to the
greatest 1 digit hexadecimal number. In case of decimal number system , it is not
so.
From Binary to Octal:
1. Get a number Octal digit: Equivalent
binary digit:
2. Make or obtain a table like the adjacent
0 000
one
3. Group the number into 3 digits, starting 1 001
from the last one.
4. If the first number from the left has less 2 010
than 3 digits, place 0s in front of the
number. 3 011
5. Compare the obtained number with the
4 100
ones in the table.
6. Join the numbers to get the answer. 5 101
6 110
7 111
Example conversion:
1 101101
2 * * *
3 101 101
4 101 101
5 5 5
6 Answer: 55
From Binary to Hexadecimal:
1. Get a number Hexadecima Equivalent Hexadeci Equivalent
2. Make or obtain a table like the adjacent l digit: binary digit: mal digit: binary digit:
one
0 0000 8 1000
3. Group the number into 4 digits, starting
from the last one. 1 0001 9 1001
4. If the first number from the left has less
than 4 digits, place 0s in front of the 2 0010 A 1010
number.
5. Compare the obtained number with the 3 0011 B 1011
ones in the table.
4 0100 C 1100
6. Join the numbers to get the answer.
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
Example conversion:
1 101101
2 * * *
3 10 1101
4 0010 1101
5 2 D(13)
6 Answer: 2D
1’ complement from:
It the system of representation off the binary digits , the the places off the 1s and
0s are interchanged. This is used to represent negative values, or in general
negative numbers.
Example:
35 {decimal}=0100011
-35 {decimal}=1011100
2’ complement form:
1. Two’s complement form is mathematical operation of binary numbers where
those numbers are turned into either positive or negative for calculations to be
performed on the numbers or any other reasons.
2. To determine the binary numbers as positive or negative:
a. A number is taken.
b. A 0 is inserted at the front of the number.
c. The 0s and 1s and switched.
d. 1 is added to the obtained number.
e. The number now represents the negative of the number it previously
represented.
Example:
1. Example 1:
a. Take a binary number 11 (0011). {equivalent decimal=3}
b. After changing 0s into 1, and vice versa,the number obtained is 1100
c. Adding 1 gives the number 1101, which represents the number,(-3)
2. Example 2:
a. A binary number: 1000111 (01000111)
b. Interchanging off the digits: 10111000
c. Adding 1: 10111001
BCD or Binary Coded Digits:
It is the encoding of digits of base 10 , directly converted into binary by
representing them in from of 8 bits.
Note#:
1. It is also called 4 to 1 code
2. It is the simplest binary code for decimal digits
3. Only encodes digits from 0 to 9 {binary numbers for 11,12,13,14 and 15 are
invalid}
4. BCD is a weighted code,meaning in a number, 1011 has weight of 8,4,2,1
starting from the left of the number. That is, 1 has weight of 8, 0 of 4, 1 of two
and 1 of 1. Adding these , we can get the equivalent decimal number of the
binary number.
BCD table comparison with binary table
Decimal value Binary value BCD value Decimal value Binary value BCD value
The problem with ASCII is that it only allows you to represent a small number of
characters (~128 or 256 for Extended ASCII). This is only practical for countries
with only english speaking citizens,like in USA, or the UK and also in some
countries, where there is the use of written English to represent the information,
like in Germany.
So, to store more larger numbers of characters we use unicode. There are
different versions of unicode with different bits. Example: UTF-8, UTF-16, UTF-32.
Any queries?
34
Thank you!
35