NUMBER
SYSTEM
&
BINARY
ARITHMETIC
UNIT I
CHAPTER 1
DIGITAL
ELECTRONICS
UNIT I:CONTENTS
◾ Number System:
◾ Analog System,digital system,
◾ Numbering system,binary number system,octal number system,hexadecimal number system,conversion from one number
system to another
◾ Weighted codes binary coded decimal,non-weighted codes Excess – 3 code,Gray code,
◾ Alphanumeric codes – ASCII Code, EBCDIC, ISCII Code
◾ Code conversion.
◾ Binary Arithmetic:
◾ Binary addition,Binary subtraction,
◾ Negative number representation,
◾ Subtraction using 1’s complement and 2’s complement,Binary multiplication and division,Arithmetic in octal number system,
Arithmetic in hexadecimal number system,
◾ BCD and Excess – 3 arithmetic.
C
H
A
P
T
E
R
I
C
H
A
P
T
E
R
II
ANALOG AND DIGITAL SYSTEMS
◾ Analog and digital signals are used to transmit information (such as any audio or video),usually through electric
signals.In digital technology,translation of information is into binary format (either 0 or 1) and information is
translated into electric pulses of varying amplitude in analog technology.
Analogue signal Analogue meter display
Digital (logic) signal
Digital meter display
NUMBER SYSTEMS
◾ A computer can understand the positional
number system where there are only a few
symbols called digits and these symbols
represent different values depending on the
position they occupy in the number.
◾ The value of each digit in a number can be
determined using :
◾ The digit
◾ The position of the digit in the number
◾ The base of the number system (where the base is
defined as the total number of digits available in
the number system)
NUMBER SYSTEMS: DECIMAL
◾ The number system that we use in our day-to-
day life is the decimal number system.
◾ Decimal number system has base 10 as it uses
10 digits from 0 to 9.
◾ In decimal number system,the successive
positions to the left of the decimal point
represent units,tens,hundreds,thousands,and
so on.
◾ Each position represents a specific power of the
base (10).
For example,
The decimal number 1234 consists of the digit
4 in the units position,
3 in the tens position,
2 in the hundreds position,and
1 in the thousands position.
Its value can be written as
(1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)
(1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00)
1000 + 200 + 30 + 4
1234
NUMBER SYSTEMS: BINARY
◾ Characteristics of the binary number system are
as follows :
◾ Uses two digits,0 and 1
◾ Also called as base 2 number system
◾ Each position in a binary number represents
a 0 power of the base (2).
◾ Example 20
◾ Last position in a binary number represents a
x power of the base (2).
◾ Example 2x where x represents the last
position - 1.
For example,
Binary Number:101012
Calculating Decimal Equivalent :
Step Binary
Number
Decimal Number
Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x
21) + (1 x 20))10
Step 2 101012 (16 + 0 + 4 + 0 + 1)10
Step 3 101012 2110
Note − 101012 is normally written as 10101.
NUMBER SYSTEMS: OCTAL
◾ Characteristics of the octal number system are
as follows :
◾ Uses eight digits,0,1,2,3,4,5,6,7
◾ Also called as base 8 number system
◾ Each position in an octal number represents a
0 power of the base (8).
◾ Example 80
◾ Last position in an octal number represents a
x power of the base (8).
◾ Example 8x where x represents the last
position - 1
For example,
Octal Number:125708
Calculating Decimal Equivalent:
Step Binary
Number
Decimal Number
Step 1 125708 ((1 x 84) + (2 x 83) + (5 x 82) + (7 x
81) + (0 x 80))10
Step 2 125708 (4096 + 1024 + 320 + 56 + 0)10
Step 3 125708 549610
Note − 125708 is normally written as 12570.
NUMBER SYSTEMS: HEXADECIMAL
◾ Characteristics of hexadecimal number system
are as follows:
◾ Uses 10 digits and 6 letters,0,1,2,3,4,5,6,7,8,9,
A,B,C, D,E,F
◾ Letters represent the numbers starting from 10.A
= 10.B = 11,C = 12,D = 13,E = 14,F = 15
◾ Also called as base 16 number system
◾ Each position in a hexadecimal number represents
a 0 power of the base (16).Example,160
◾ Last position in a hexadecimal number represents
a x power of the base (16).
◾ Example 16x where x represents the last position
- 1
For example,
Hexadecimal Number: 19FDE16
Calculating Decimal Equivalent:
Step Binary
Number
Decimal Number
Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) +
(D x 161) + (E x 160))10
Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) +
(13 x 161) + (14 x 160))10
Step 3 19FDE16 (65536+ 36864 + 3840 + 208 +
14)10
Step 4 19FDE16 10646210
Note − 19FDE16 is normally written as 19FDE.
CONVERSION FROM ONE NUMBER SYSTEM TO ANOTHER
◾ Decimal to Binary System
◾ Decimal to Octal System
◾ Decimal to Hexadecimal System
◾ Binary to Decimal System
◾ Octal to Decimal System
◾ Hexadecimal to Decimal System
◾ Binary to Octal System
◾ Octal to Binary System
◾ Binary to Hexadecimal System
◾ Hexadecimal to Binary System
◾ Octal to Hexadecimal System
◾ Hexadecimal to Octal System
DECIMAL TO OTHER BASE SYSTEM
◾ Step 1 − Divide the decimal number to be converted by the value of the new base.
◾ Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit) of the new base
number.
◾ Step 3 − Divide the quotient of the previous divide by the new base.
◾ Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new base number.
◾ Repeat Steps 3 and 4,getting remainders from right to left,until the quotient becomes zero in Step 3.
◾ The last remainder thus obtained will be the Most Significant Digit (MSD) of the new base number.
CONVERSION FROM DECIMAL TO BINARY SYSTEM
◾ Example:Decimal Number:2910
◾ Calculating Binary Equivalent :
Step Operation Result Remainder
Step 1 29 /2 14 1
Step 2 14 /2 7 0
Step 3 7 /2 3 1
Step 4 3 /2 1 1
Step 5 1 /2 0 1
As mentioned in Steps 2 and 4,the remainders have to be arranged in the reverse order so that the first remainder
becomes the Least Significant Digit (LSD) and the last remainder becomes the Most Significant Digit (MSD).
Decimal Number :2910 = Binary Number :111012.
DECIMAL TO BINARY TABLE:4-BIT BINARY REPRESENTATION
◾ When a number is stored in an electronic system, it is
stored in a memory location having a fixed number of
binary bits.
◾ Some of these memory locations are used for general
storage whilst others, having some special function, are
called registers.
◾ Wherever a number is stored, it will be held in some form
of binary,and must always have a set number of bits.
CONVERSION OF DECIMAL TO BINARY EXAMPLES
Conversion of Decimal to Binary method can easily be
understood by considering an example which is
explained below.
For example – Consider the conversion of the decimal
number 25 into its equivalent binary.
Divide by 2 Result Remainder Binary Value
294 ÷ 2 147 0 0 (LSB)
147 ÷ 2 73 1 1
73 ÷ 2 36 1 1
36 ÷ 2 18 0 0
18 ÷ 2 9 0 0
9 ÷ 2 4 1 1
4 ÷ 2 2 0 0
2 ÷ 2 1 0 0
1 ÷ 2 0 1 1 (MSB)
Convert the decimal number 294 into a binary number.
Therefore,the binary equivalent for the given decimal number 29410 is 1001001102
CONVERSION OF DECIMAL TO BINARY FOR FRACTION
NUMBER
◾ For fractional decimal numbers,multiply it by 2 and record the carry in the integral position.The carries when read
down produces the equivalent binary fraction as explained by the example given.
Thus the fractional binary number is .01011,i.e.,0.01011.
The process of multiplication by 2 will continue till the
desired accuracy is achieved.
Here is another example of such conversion using the
fraction 0.375.
Now,let’s just write out the resulting integer part at each
step — 0.011.
So,0.375 in decimal system is represented as 0.011 in
binary.
Consider the fractional binary number 0.35
CONVERSION OF BINARY FRACTION TO DECIMAL
NUMBER
◾ Divide each digit from right side of radix point till the end by 21,22,23,… respectively.
◾ Add all the result coming from step 1.
◾ Equivalent fractional decimal number would be the result obtained in step 2.
Step 2:Conversion of .101 to decimal
0.1012 = (1*1/2) + (0*1/22) + (1*1/23)
0.1012 = 1*0.5 + 0*0.25 + 1*0.125
0.1012 = 0.625
So equivalent decimal of binary fractional is 0.625
Number
Base
as Power
102 101 100 . 10-1 10-2 10-3
Equivalent 100 10 1 . 1/10 1/100 1/1000
Decimal Fractions
Binary Fractions
Number Base
as Power
24 23 22 21 20 . 2-1 2-2 2-3
Equivalent 16 8 4 2 1 . 1/2 1/4 1/8
CONVERSION FROM DECIMAL TO OCTAL SYSTEM
◾ Write the given decimal number
◾ If the given decimal number is less than 8 the
octal number is the same.
◾ If the decimal number is greater than 7 then
divide the number by 8.
◾ Note the remainder we get after division
◾ Repeat step 3 and 4 with the quotient till it is
less than 8
◾ Now,write the remainders in reverse
order(bottom to top)
◾ The resultant is the equivalent octal number to
the given decimal number.
For example: Convert 1792 into octal number.
Decimal
Number
Operation
Quotient Remainder
Octal
Number
1792 ÷ 8 224 0 0
224 ÷ 8 28 0 00
28 ÷ 8 3 4 400
3 ÷ 8 0 3 3400
Decimal to Octal Examples
Example 1:Convert (127)10 to Octal.
Example 2:Convert 5210 to octal.
Example 3:Convert 10010 to octal.
CONVERSION FROM DECIMAL TO OCTAL SYSTEM
◾ Example 1:Convert (127)10 to Octal.
◾ Solution: Divide 127 by 8
◾ 127 ÷ 8= 15(Quotient) and
(7)Remainder
◾ Divide 15 by 8 again.
◾ 15 ÷ 8 = 1(Quotient) and (7) Remainder
◾ Divide 1 by 8,we get;
◾ 1 ÷ 8 = 0(Quotient) and (1) Remainder
◾ Since the quotient is zero now,no more
division can be done.So by taking the
remainders in reverse order,we get the
equivalent octal number.
◾ Hence,(127)10 = (177)8
◾ Example 2: Convert 5210
to octal.
◾ Solution: Divide 52 by 8
◾ 52 ÷ 8 = 6(Quotient) and
(4)Remainder
◾ Divide 6 by 8 again.
◾ 6 ÷ 8 = 0(Quotient) and (6)
Remainder
◾ Since the quotient is zero now,
no more division can be done.
So by taking the remainders in
reverse order,we get the
equivalent octal number.
◾ Hence,(52)10 = (64)8
◾ Example 3:Convert 10010 to
octal.
◾ Solution: Divide 100 by 8
◾ 100 ÷ 8= 12(Quotient) and
(4)Remainder
◾ Divide 12 by 8 again.
◾ 12 ÷ 8 = 1(Quotient) and (4)
Remainder
◾ Divide 1 by 8,we get;
◾ 1 ÷ 8 = 0(Quotient) and (1)
Remainder
◾ Since the quotient is zero now,no
more division can be done.So by
taking the remainders in reverse
order,we get the equivalent octal
number.
◾ Hence,(100)10 = (144)8
CONVERSION FROM DECIMAL FRACTION TO OCTAL
SYSTEM
◾ Take decimal number as multiplicand.
◾ Multiple this number by 8 (8 is base of octal so multiplier here).
◾ Store the value of integer part of result in an array (it will be:0,1,2,3,4,5,6,and 7 because of multiplier 8).
◾ Repeat the above two steps until the number became zero
◾ Example − Convert decimal fractional number 0.140869140625 into octal number.
Multiplication Resultant integer part
0.140869140625 x 8=0.12695313 1
0.12695313 x 8=0.01562504 1
0.01562504 x 8=0.12500032 0
0.12500032 x 8=0.00000256 1
0.00000256 x 8=0.000020544 0
and so on ....
Now,write these resultant integer
part,this will be approximate 0.11010
which is equivalent octal fractional
number of decimal fractional
0.140869140625.
CONVERSION FROM DECIMAL TO HEXADECIMAL SYSTEM
◾ Take decimal number as dividend.
◾ Divide this number by 16 (16 is base of
hexadecimal so divisor here).
◾ Store the remainder in an array (it will be: 0
to 15 because of divisor 16,replace 10,11,
12,13,14,15 byA,B,C, D,E,F respectively).
◾ Repeat the above two steps until the
number is greater than zero.
◾ Print the array in reverse order (which will
be equivalent hexadecimal number of given
decimal number).
Example − Convert decimal number 540 into hexadecimal
number.
Division Remainder (R)
540 /16 = 33 12 = C
33 /16 = 2 1
2 /16 = 0 2
0 /16 = 0 0
CONVERSION FROM DECIMAL FRACTION TO
HEXADECIMAL
◾ Take decimal number as multiplicand.
◾ Multiple this number by 16 (16 is base of
hexadecimal so multiplier here).
◾ Store the value of integer part of result in an
array (it will be:0 to 15,because of
multiplier 16,replace 10,11,12,13,14,15 by
A,B,C, D,E,F respectively).
◾ Repeat the above two steps until the
number became zero.
◾ Print the array (which will be equivalent
fractional hexadecimal number of given
decimal fractional number).
Example − Convert decimal fractional number 0.06640625
into hexadecimal number.
Multiplication Resultant integer part
0.06640625 x 16=1.0625 1
0.0625 x 16 =1.0 1
0 x 16=0.0 0
CONVERSION FROM BINARY TO DECIMAL SYSTEM
◾ Converting from binary to decimal involves multiplying
the value of each digit (i.e.1 or 0) by the value of the
placeholder in the number
◾ Write down the number.
◾ Starting with the LSB,multiply the digit by the value
of the place holder.
◾ Continue doing this until you reach the MSB.
◾ Add the results together.
Placeholder Value in the Decimal Numbering System Most Significant Bit (MSB) and Least Significant Bit (LSB)
Placeholder Value in the Binary Numbering System
STEPSTO CONVERT BINARY TO DECIMAL
For example,
Binary Number:101012
Calculating Decimal Equivalent :
Step Binary
Number
Decimal Number
Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x
21) + (1 x 20))10
Step 2 101012 (16 + 0 + 4 + 0 + 1)10
Step 3 101012 2110
CONVERSION FROM OCTAL TO DECIMAL SYSTEM
◾ Converting octal to decimal can be done as
following:
◾ Write the powers of 8 (1,8,64,512,4096,and
so on) beside the octal digits from bottom to
top.
◾ Multiply each digit by it's power.
◾ Add up the answers.This is the solution.
For example if the given octal number is 50173:
Digit Power Multiplication
5 4096 20480
0 512 0
1 64 64
7 8 56
3 1 3
Then the decimal solution (20480 + 64 + 56 + 3) is: 20603
 The octal numeral system,or oct for short,is the base-8 number system,and uses the digits 0 to 7.
 It has the advantage of not requiring any extra symbols as digits.
 It is also used for digital displays.
CONVERSION FROM HEXADECIMAL TO DECIMAL SYSTEM
◾ Follow these steps to convert a hexadecimal number into
decimal form:
◾ Write the powers of 16 (1,16,256,4096,65536,and
so on) beside the hex digits from bottom to top.
◾ Convert any letters (A to F) to their corresponding
numerical form.
◾ Multiply each digit by it's power.
◾ Add up the answers.This is the solution.
For example if the given hexadecimal
number is 6FC7:
Digit Power Multiplication
6 4096 24576
F (15) 256 3840
C (12) 16 192
7 1 7
Then the decimal solution (24576 + 3840 +
192 + 7) is: 28615
 Hexadecimal is a positional system that represents numbers using a base of 16.
 Unlike the common way of representing numbers with ten symbols,it uses sixteen distinct symbols,most often the
symbols "0"-"9" to represent values zero to nine,and "A"-"F" to represent values ten to fifteen.
 Hexadecimal numerals are widely used by computer system designers and programmers,as they provide a human-
friendly representation of binary-coded values.
CONVERSION FROM BINARY TO OCTAL SYSTEM
◾ Follow these steps to convert a binary
number into octal form:
◾ Start from the right side of the
binary number and divide it up into
groups of 3 digits.Add extra zeros
to the front of the first number if it
is not three digits.
◾ Convert each group of 3 binary
digits to its equivalent octal value
from the conversion table below.
◾ Concatenate the results together.
This is the solution.
Conversion table:
Binary Octal
000 0
001 1
010 2
011 3
100 4
101 5
110 6
111 7
For example if the given binary number is
10110111010001:
Binary (0)10 110 111 010 001
Octal 2 6 7 2 1
Then the octal solution is:26721
CONVERSION FROM OCTAL TO BINARY SYSTEM
◾ Follow these steps to convert a
octal number into binary form:
◾ Write down the octal number
and represent each digit by its
binary equivalent from the
conversion table below.
◾ Concatenate the results
together.Discard any leading
zeros at the left of the binary
number.This is the solution.
Conversion table:
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
For example if the given octal number is 21073:
Octal 2 1 0 7 3
Binary 010 001 000 111 011
Then the binary solution is:(0)10001000111011
CONVERSION FROM BINARY TO HEXADECIMAL SYSTEM
◾ Follow these steps to convert a
binary number into hexadecimal
form:
◾ Start from the right side of the binary
number and divide it up into groups of
4 digits.Add extra zeros to the front
of the first number if it is not four
digits.
◾ Convert each group of 4 binary digits
to its equivalent hex value from the
conversion table below.
◾ Concatenate the results together.This
is the solution.
Conversion table:
Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
For example if the given binary
number is 11011010100111:
Binary (00)11 0110 1010 0111
Hexad
ecimal
3 6 A 7
Then the hexadecimal solution is:
36A7
CONVERSION FROM HEXADECIMAL TO BINARY SYSTEM
◾ Follow these steps to convert a
hexadecimal number into binary
form:
◾ Write down the hex number
and represent each digit by its
binary equivalent from the
conversion table below.
◾ Concatenate the results
together.Discard any leading
zeros at the left of the binary
number.This is the solution.
Conversion table:
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
For example if the given hexadecimal
number is 3CF8:
Hexadecimal 3 C F 8
Binary 0011 1100 1111 1000
Then the binary solution is:
(00)11110011111000
CONVERSION FROM OCTAL TO HEXADECIMAL SYSTEM
◾ While converting from octal to
hexadecimal unit,it is a usual practice
to convert the octal to hexadecimal by
converting the octal number into
binary digit and then further to from
binary to hexadecimal.
For example to convert the number 536 from
octal to hexadecimal.
Convert 536(octal) into its binary equivalent we get
(536)8 = (101) (011) (110)
=(101011110)2
Now forming the group of 4 binary bits to obtain its hexadecimal
equivalent,
(101011110)2= (0001) (0101) (1110)
= (15E)16
So the hexadecimal number of 536 is 15E.
CONVERSION FROM HEXADECIMAL TO OCTAL SYSTEM
◾ Method to Convert Hex to Octal
◾ For each given hexadecimal number digit,
write the equivalent binary number.If any
of the binary equivalents are less than 4
digits,add 0’s to the left side.
◾ Combine and make the groups of binary
digits from right to left,each containing 3
digits.Add 0’s to the left if there are less
than 3 digits in the last group.
◾ Find the octal equivalent of each binary
group.
Example: Convert 1BC16 into an octal number.
Solution:
Given,1BC16 is a hexadecimal number.
1 → 0001,B → 1011,C →1100
Now group them from right to left,each having 3 digits.
000,110,111,100
000→0, 110 →6,111→7, 100→4
Hence,1BC16 = 6748
EXERCISES (NUMBER SYSTEMS CONVERSION)
1.Convert the following decimal numbers into binary and hexadecimal
numbers:
1.108
2.4848
3.9000
2.Convert the following binary numbers into hexadecimal and decimal
numbers:
1.1000011000
2.10000000
3.101010101010
3.Convert the following hexadecimal numbers into binary and decimal
numbers:
1.ABCDE
2.1234
3. 80F
4.Convert the following decimal numbers into binary equivalent:
1.19.25D
2.123.456D
1.1101100B, 1001011110000B, 10001100101000B, 6CH,
12F0H, 2328H.
2.218H, 80H, AAAH, 536D, 128D, 2730D.
3.10101011110011011110B, 1001000110100B,
100000001111B, 703710D, 4660D, 2063D.
4.?? (You work it out!)
THANK YOU!

1. Digital Electronics - Number System PART 1.pptx

  • 1.
  • 2.
    UNIT I:CONTENTS ◾ NumberSystem: ◾ Analog System,digital system, ◾ Numbering system,binary number system,octal number system,hexadecimal number system,conversion from one number system to another ◾ Weighted codes binary coded decimal,non-weighted codes Excess – 3 code,Gray code, ◾ Alphanumeric codes – ASCII Code, EBCDIC, ISCII Code ◾ Code conversion. ◾ Binary Arithmetic: ◾ Binary addition,Binary subtraction, ◾ Negative number representation, ◾ Subtraction using 1’s complement and 2’s complement,Binary multiplication and division,Arithmetic in octal number system, Arithmetic in hexadecimal number system, ◾ BCD and Excess – 3 arithmetic. C H A P T E R I C H A P T E R II
  • 3.
    ANALOG AND DIGITALSYSTEMS ◾ Analog and digital signals are used to transmit information (such as any audio or video),usually through electric signals.In digital technology,translation of information is into binary format (either 0 or 1) and information is translated into electric pulses of varying amplitude in analog technology. Analogue signal Analogue meter display Digital (logic) signal Digital meter display
  • 4.
    NUMBER SYSTEMS ◾ Acomputer can understand the positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number. ◾ The value of each digit in a number can be determined using : ◾ The digit ◾ The position of the digit in the number ◾ The base of the number system (where the base is defined as the total number of digits available in the number system)
  • 5.
    NUMBER SYSTEMS: DECIMAL ◾The number system that we use in our day-to- day life is the decimal number system. ◾ Decimal number system has base 10 as it uses 10 digits from 0 to 9. ◾ In decimal number system,the successive positions to the left of the decimal point represent units,tens,hundreds,thousands,and so on. ◾ Each position represents a specific power of the base (10). For example, The decimal number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in the hundreds position,and 1 in the thousands position. Its value can be written as (1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l) (1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00) 1000 + 200 + 30 + 4 1234
  • 6.
    NUMBER SYSTEMS: BINARY ◾Characteristics of the binary number system are as follows : ◾ Uses two digits,0 and 1 ◾ Also called as base 2 number system ◾ Each position in a binary number represents a 0 power of the base (2). ◾ Example 20 ◾ Last position in a binary number represents a x power of the base (2). ◾ Example 2x where x represents the last position - 1. For example, Binary Number:101012 Calculating Decimal Equivalent : Step Binary Number Decimal Number Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10 Step 2 101012 (16 + 0 + 4 + 0 + 1)10 Step 3 101012 2110 Note − 101012 is normally written as 10101.
  • 7.
    NUMBER SYSTEMS: OCTAL ◾Characteristics of the octal number system are as follows : ◾ Uses eight digits,0,1,2,3,4,5,6,7 ◾ Also called as base 8 number system ◾ Each position in an octal number represents a 0 power of the base (8). ◾ Example 80 ◾ Last position in an octal number represents a x power of the base (8). ◾ Example 8x where x represents the last position - 1 For example, Octal Number:125708 Calculating Decimal Equivalent: Step Binary Number Decimal Number Step 1 125708 ((1 x 84) + (2 x 83) + (5 x 82) + (7 x 81) + (0 x 80))10 Step 2 125708 (4096 + 1024 + 320 + 56 + 0)10 Step 3 125708 549610 Note − 125708 is normally written as 12570.
  • 8.
    NUMBER SYSTEMS: HEXADECIMAL ◾Characteristics of hexadecimal number system are as follows: ◾ Uses 10 digits and 6 letters,0,1,2,3,4,5,6,7,8,9, A,B,C, D,E,F ◾ Letters represent the numbers starting from 10.A = 10.B = 11,C = 12,D = 13,E = 14,F = 15 ◾ Also called as base 16 number system ◾ Each position in a hexadecimal number represents a 0 power of the base (16).Example,160 ◾ Last position in a hexadecimal number represents a x power of the base (16). ◾ Example 16x where x represents the last position - 1 For example, Hexadecimal Number: 19FDE16 Calculating Decimal Equivalent: Step Binary Number Decimal Number Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x 160))10 Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x 160))10 Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10 Step 4 19FDE16 10646210 Note − 19FDE16 is normally written as 19FDE.
  • 9.
    CONVERSION FROM ONENUMBER SYSTEM TO ANOTHER ◾ Decimal to Binary System ◾ Decimal to Octal System ◾ Decimal to Hexadecimal System ◾ Binary to Decimal System ◾ Octal to Decimal System ◾ Hexadecimal to Decimal System ◾ Binary to Octal System ◾ Octal to Binary System ◾ Binary to Hexadecimal System ◾ Hexadecimal to Binary System ◾ Octal to Hexadecimal System ◾ Hexadecimal to Octal System
  • 10.
    DECIMAL TO OTHERBASE SYSTEM ◾ Step 1 − Divide the decimal number to be converted by the value of the new base. ◾ Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit) of the new base number. ◾ Step 3 − Divide the quotient of the previous divide by the new base. ◾ Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new base number. ◾ Repeat Steps 3 and 4,getting remainders from right to left,until the quotient becomes zero in Step 3. ◾ The last remainder thus obtained will be the Most Significant Digit (MSD) of the new base number.
  • 11.
    CONVERSION FROM DECIMALTO BINARY SYSTEM ◾ Example:Decimal Number:2910 ◾ Calculating Binary Equivalent : Step Operation Result Remainder Step 1 29 /2 14 1 Step 2 14 /2 7 0 Step 3 7 /2 3 1 Step 4 3 /2 1 1 Step 5 1 /2 0 1 As mentioned in Steps 2 and 4,the remainders have to be arranged in the reverse order so that the first remainder becomes the Least Significant Digit (LSD) and the last remainder becomes the Most Significant Digit (MSD). Decimal Number :2910 = Binary Number :111012.
  • 12.
    DECIMAL TO BINARYTABLE:4-BIT BINARY REPRESENTATION ◾ When a number is stored in an electronic system, it is stored in a memory location having a fixed number of binary bits. ◾ Some of these memory locations are used for general storage whilst others, having some special function, are called registers. ◾ Wherever a number is stored, it will be held in some form of binary,and must always have a set number of bits.
  • 13.
    CONVERSION OF DECIMALTO BINARY EXAMPLES Conversion of Decimal to Binary method can easily be understood by considering an example which is explained below. For example – Consider the conversion of the decimal number 25 into its equivalent binary. Divide by 2 Result Remainder Binary Value 294 ÷ 2 147 0 0 (LSB) 147 ÷ 2 73 1 1 73 ÷ 2 36 1 1 36 ÷ 2 18 0 0 18 ÷ 2 9 0 0 9 ÷ 2 4 1 1 4 ÷ 2 2 0 0 2 ÷ 2 1 0 0 1 ÷ 2 0 1 1 (MSB) Convert the decimal number 294 into a binary number. Therefore,the binary equivalent for the given decimal number 29410 is 1001001102
  • 14.
    CONVERSION OF DECIMALTO BINARY FOR FRACTION NUMBER ◾ For fractional decimal numbers,multiply it by 2 and record the carry in the integral position.The carries when read down produces the equivalent binary fraction as explained by the example given. Thus the fractional binary number is .01011,i.e.,0.01011. The process of multiplication by 2 will continue till the desired accuracy is achieved. Here is another example of such conversion using the fraction 0.375. Now,let’s just write out the resulting integer part at each step — 0.011. So,0.375 in decimal system is represented as 0.011 in binary. Consider the fractional binary number 0.35
  • 15.
    CONVERSION OF BINARYFRACTION TO DECIMAL NUMBER ◾ Divide each digit from right side of radix point till the end by 21,22,23,… respectively. ◾ Add all the result coming from step 1. ◾ Equivalent fractional decimal number would be the result obtained in step 2. Step 2:Conversion of .101 to decimal 0.1012 = (1*1/2) + (0*1/22) + (1*1/23) 0.1012 = 1*0.5 + 0*0.25 + 1*0.125 0.1012 = 0.625 So equivalent decimal of binary fractional is 0.625 Number Base as Power 102 101 100 . 10-1 10-2 10-3 Equivalent 100 10 1 . 1/10 1/100 1/1000 Decimal Fractions Binary Fractions Number Base as Power 24 23 22 21 20 . 2-1 2-2 2-3 Equivalent 16 8 4 2 1 . 1/2 1/4 1/8
  • 16.
    CONVERSION FROM DECIMALTO OCTAL SYSTEM ◾ Write the given decimal number ◾ If the given decimal number is less than 8 the octal number is the same. ◾ If the decimal number is greater than 7 then divide the number by 8. ◾ Note the remainder we get after division ◾ Repeat step 3 and 4 with the quotient till it is less than 8 ◾ Now,write the remainders in reverse order(bottom to top) ◾ The resultant is the equivalent octal number to the given decimal number. For example: Convert 1792 into octal number. Decimal Number Operation Quotient Remainder Octal Number 1792 ÷ 8 224 0 0 224 ÷ 8 28 0 00 28 ÷ 8 3 4 400 3 ÷ 8 0 3 3400 Decimal to Octal Examples Example 1:Convert (127)10 to Octal. Example 2:Convert 5210 to octal. Example 3:Convert 10010 to octal.
  • 17.
    CONVERSION FROM DECIMALTO OCTAL SYSTEM ◾ Example 1:Convert (127)10 to Octal. ◾ Solution: Divide 127 by 8 ◾ 127 ÷ 8= 15(Quotient) and (7)Remainder ◾ Divide 15 by 8 again. ◾ 15 ÷ 8 = 1(Quotient) and (7) Remainder ◾ Divide 1 by 8,we get; ◾ 1 ÷ 8 = 0(Quotient) and (1) Remainder ◾ Since the quotient is zero now,no more division can be done.So by taking the remainders in reverse order,we get the equivalent octal number. ◾ Hence,(127)10 = (177)8 ◾ Example 2: Convert 5210 to octal. ◾ Solution: Divide 52 by 8 ◾ 52 ÷ 8 = 6(Quotient) and (4)Remainder ◾ Divide 6 by 8 again. ◾ 6 ÷ 8 = 0(Quotient) and (6) Remainder ◾ Since the quotient is zero now, no more division can be done. So by taking the remainders in reverse order,we get the equivalent octal number. ◾ Hence,(52)10 = (64)8 ◾ Example 3:Convert 10010 to octal. ◾ Solution: Divide 100 by 8 ◾ 100 ÷ 8= 12(Quotient) and (4)Remainder ◾ Divide 12 by 8 again. ◾ 12 ÷ 8 = 1(Quotient) and (4) Remainder ◾ Divide 1 by 8,we get; ◾ 1 ÷ 8 = 0(Quotient) and (1) Remainder ◾ Since the quotient is zero now,no more division can be done.So by taking the remainders in reverse order,we get the equivalent octal number. ◾ Hence,(100)10 = (144)8
  • 18.
    CONVERSION FROM DECIMALFRACTION TO OCTAL SYSTEM ◾ Take decimal number as multiplicand. ◾ Multiple this number by 8 (8 is base of octal so multiplier here). ◾ Store the value of integer part of result in an array (it will be:0,1,2,3,4,5,6,and 7 because of multiplier 8). ◾ Repeat the above two steps until the number became zero ◾ Example − Convert decimal fractional number 0.140869140625 into octal number. Multiplication Resultant integer part 0.140869140625 x 8=0.12695313 1 0.12695313 x 8=0.01562504 1 0.01562504 x 8=0.12500032 0 0.12500032 x 8=0.00000256 1 0.00000256 x 8=0.000020544 0 and so on .... Now,write these resultant integer part,this will be approximate 0.11010 which is equivalent octal fractional number of decimal fractional 0.140869140625.
  • 19.
    CONVERSION FROM DECIMALTO HEXADECIMAL SYSTEM ◾ Take decimal number as dividend. ◾ Divide this number by 16 (16 is base of hexadecimal so divisor here). ◾ Store the remainder in an array (it will be: 0 to 15 because of divisor 16,replace 10,11, 12,13,14,15 byA,B,C, D,E,F respectively). ◾ Repeat the above two steps until the number is greater than zero. ◾ Print the array in reverse order (which will be equivalent hexadecimal number of given decimal number). Example − Convert decimal number 540 into hexadecimal number. Division Remainder (R) 540 /16 = 33 12 = C 33 /16 = 2 1 2 /16 = 0 2 0 /16 = 0 0
  • 20.
    CONVERSION FROM DECIMALFRACTION TO HEXADECIMAL ◾ Take decimal number as multiplicand. ◾ Multiple this number by 16 (16 is base of hexadecimal so multiplier here). ◾ Store the value of integer part of result in an array (it will be:0 to 15,because of multiplier 16,replace 10,11,12,13,14,15 by A,B,C, D,E,F respectively). ◾ Repeat the above two steps until the number became zero. ◾ Print the array (which will be equivalent fractional hexadecimal number of given decimal fractional number). Example − Convert decimal fractional number 0.06640625 into hexadecimal number. Multiplication Resultant integer part 0.06640625 x 16=1.0625 1 0.0625 x 16 =1.0 1 0 x 16=0.0 0
  • 21.
    CONVERSION FROM BINARYTO DECIMAL SYSTEM ◾ Converting from binary to decimal involves multiplying the value of each digit (i.e.1 or 0) by the value of the placeholder in the number ◾ Write down the number. ◾ Starting with the LSB,multiply the digit by the value of the place holder. ◾ Continue doing this until you reach the MSB. ◾ Add the results together. Placeholder Value in the Decimal Numbering System Most Significant Bit (MSB) and Least Significant Bit (LSB) Placeholder Value in the Binary Numbering System
  • 22.
    STEPSTO CONVERT BINARYTO DECIMAL For example, Binary Number:101012 Calculating Decimal Equivalent : Step Binary Number Decimal Number Step 1 101012 ((1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20))10 Step 2 101012 (16 + 0 + 4 + 0 + 1)10 Step 3 101012 2110
  • 23.
    CONVERSION FROM OCTALTO DECIMAL SYSTEM ◾ Converting octal to decimal can be done as following: ◾ Write the powers of 8 (1,8,64,512,4096,and so on) beside the octal digits from bottom to top. ◾ Multiply each digit by it's power. ◾ Add up the answers.This is the solution. For example if the given octal number is 50173: Digit Power Multiplication 5 4096 20480 0 512 0 1 64 64 7 8 56 3 1 3 Then the decimal solution (20480 + 64 + 56 + 3) is: 20603  The octal numeral system,or oct for short,is the base-8 number system,and uses the digits 0 to 7.  It has the advantage of not requiring any extra symbols as digits.  It is also used for digital displays.
  • 24.
    CONVERSION FROM HEXADECIMALTO DECIMAL SYSTEM ◾ Follow these steps to convert a hexadecimal number into decimal form: ◾ Write the powers of 16 (1,16,256,4096,65536,and so on) beside the hex digits from bottom to top. ◾ Convert any letters (A to F) to their corresponding numerical form. ◾ Multiply each digit by it's power. ◾ Add up the answers.This is the solution. For example if the given hexadecimal number is 6FC7: Digit Power Multiplication 6 4096 24576 F (15) 256 3840 C (12) 16 192 7 1 7 Then the decimal solution (24576 + 3840 + 192 + 7) is: 28615  Hexadecimal is a positional system that represents numbers using a base of 16.  Unlike the common way of representing numbers with ten symbols,it uses sixteen distinct symbols,most often the symbols "0"-"9" to represent values zero to nine,and "A"-"F" to represent values ten to fifteen.  Hexadecimal numerals are widely used by computer system designers and programmers,as they provide a human- friendly representation of binary-coded values.
  • 25.
    CONVERSION FROM BINARYTO OCTAL SYSTEM ◾ Follow these steps to convert a binary number into octal form: ◾ Start from the right side of the binary number and divide it up into groups of 3 digits.Add extra zeros to the front of the first number if it is not three digits. ◾ Convert each group of 3 binary digits to its equivalent octal value from the conversion table below. ◾ Concatenate the results together. This is the solution. Conversion table: Binary Octal 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 For example if the given binary number is 10110111010001: Binary (0)10 110 111 010 001 Octal 2 6 7 2 1 Then the octal solution is:26721
  • 26.
    CONVERSION FROM OCTALTO BINARY SYSTEM ◾ Follow these steps to convert a octal number into binary form: ◾ Write down the octal number and represent each digit by its binary equivalent from the conversion table below. ◾ Concatenate the results together.Discard any leading zeros at the left of the binary number.This is the solution. Conversion table: Octal Binary 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 For example if the given octal number is 21073: Octal 2 1 0 7 3 Binary 010 001 000 111 011 Then the binary solution is:(0)10001000111011
  • 27.
    CONVERSION FROM BINARYTO HEXADECIMAL SYSTEM ◾ Follow these steps to convert a binary number into hexadecimal form: ◾ Start from the right side of the binary number and divide it up into groups of 4 digits.Add extra zeros to the front of the first number if it is not four digits. ◾ Convert each group of 4 binary digits to its equivalent hex value from the conversion table below. ◾ Concatenate the results together.This is the solution. Conversion table: Binary Hexadecimal 0000 0 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F For example if the given binary number is 11011010100111: Binary (00)11 0110 1010 0111 Hexad ecimal 3 6 A 7 Then the hexadecimal solution is: 36A7
  • 28.
    CONVERSION FROM HEXADECIMALTO BINARY SYSTEM ◾ Follow these steps to convert a hexadecimal number into binary form: ◾ Write down the hex number and represent each digit by its binary equivalent from the conversion table below. ◾ Concatenate the results together.Discard any leading zeros at the left of the binary number.This is the solution. Conversion table: Hexadecimal Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 1010 B 1011 C 1100 D 1101 E 1110 F 1111 For example if the given hexadecimal number is 3CF8: Hexadecimal 3 C F 8 Binary 0011 1100 1111 1000 Then the binary solution is: (00)11110011111000
  • 29.
    CONVERSION FROM OCTALTO HEXADECIMAL SYSTEM ◾ While converting from octal to hexadecimal unit,it is a usual practice to convert the octal to hexadecimal by converting the octal number into binary digit and then further to from binary to hexadecimal. For example to convert the number 536 from octal to hexadecimal. Convert 536(octal) into its binary equivalent we get (536)8 = (101) (011) (110) =(101011110)2 Now forming the group of 4 binary bits to obtain its hexadecimal equivalent, (101011110)2= (0001) (0101) (1110) = (15E)16 So the hexadecimal number of 536 is 15E.
  • 30.
    CONVERSION FROM HEXADECIMALTO OCTAL SYSTEM ◾ Method to Convert Hex to Octal ◾ For each given hexadecimal number digit, write the equivalent binary number.If any of the binary equivalents are less than 4 digits,add 0’s to the left side. ◾ Combine and make the groups of binary digits from right to left,each containing 3 digits.Add 0’s to the left if there are less than 3 digits in the last group. ◾ Find the octal equivalent of each binary group. Example: Convert 1BC16 into an octal number. Solution: Given,1BC16 is a hexadecimal number. 1 → 0001,B → 1011,C →1100 Now group them from right to left,each having 3 digits. 000,110,111,100 000→0, 110 →6,111→7, 100→4 Hence,1BC16 = 6748
  • 31.
    EXERCISES (NUMBER SYSTEMSCONVERSION) 1.Convert the following decimal numbers into binary and hexadecimal numbers: 1.108 2.4848 3.9000 2.Convert the following binary numbers into hexadecimal and decimal numbers: 1.1000011000 2.10000000 3.101010101010 3.Convert the following hexadecimal numbers into binary and decimal numbers: 1.ABCDE 2.1234 3. 80F 4.Convert the following decimal numbers into binary equivalent: 1.19.25D 2.123.456D 1.1101100B, 1001011110000B, 10001100101000B, 6CH, 12F0H, 2328H. 2.218H, 80H, AAAH, 536D, 128D, 2730D. 3.10101011110011011110B, 1001000110100B, 100000001111B, 703710D, 4660D, 2063D. 4.?? (You work it out!)
  • 32.