Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
136 views

Decimal Numbers: These Are Easy To Operate A We Done Daily Calculations in This Number System

Uploaded by

MooN Rana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Decimal Numbers: These Are Easy To Operate A We Done Daily Calculations in This Number System

Uploaded by

MooN Rana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Decimal Numbers

 These numbers are represented in digits of 0 to 9.


 In mathematics, we called it as whole numbers.
 It is also known as Base 10.
 All the work done by humans are in decimal numbers.
 These are easy to operate a we done daily calculations in this
number system.

 Note: Decimal numbers are positive integers or


unsigned numbers.

© 2017 learncoal.com 1
Binary Numbers
 These numbers are represented in digits of 0
and 1 only.
 It is also known as Base 2.
 All the work done by computer system is in
binary numbers.
 These are difficult to operate by humans as
a single number ranges from 8bits to 64 bits
so its difficult to remember and to solve
daily calculations.

© 2017 learncoal.com 2
Hexadecimal Numbers
 These numbers are represented in digits of 0 to 15.
 Here, first ten are the same as decimal numbers while
the other six are alphabets used for numbers from 10
to 15 as A to F respectively.
 It is also known as Base 16.
 It is the direct mapping of binary numbers and
hence easy to convert from binary.
 These are comparatively easy to operate by humans
than binary as it shortens the length of numbers from
32 bits to 8 hexadigits.
 Each hexadecimal digit corresponds to 4 binary bits.

© 2017 learncoal.com 3
Hexadecimal Integers
 Binary values are represented in hexadecimal.

© 2017 learncoal.com 4
Conversion: Decimal Numbers
to Binary Numbers
 Repeatedly divide the decimal integer by 2.
 Each remainder is a binary digit in the
translated value. i.e. (37)10 = (100101)2

© 2017 learncoal.com 5
Conversion: Binary Numbers
to Decimal Numbers
 Weighted positional notation shows how to calculate the
decimal value of each binary bit:
( ) 10 = (Bn-1  2n-1) + (Bn-2  2n-2) + ... + (B1  21) + (B0  20)

B = Binary digit

i.e. (01001001)2 = ( 75 )10


(0  27) + (1  26) + (0  25) + (0  24) + (1  23) + (0  22) + (0  21) + (1  20)

= 0 + 64 + 0 + 0 + 8 + 0 + 0 + 1
=75

© 2017 learncoal.com 6
Conversion: Binary Numbers to
Hexadecimal Numbers Vice Versa
 Each hexadecimal digit corresponds to 4 binary
bits.
 Example: Translate the binary integer
000101101010011110010100 to hexadecimal:

(000101101010011110010100)2 = (16A794)16

© 2017 learncoal.com 7
Conversion: Decimal Numbers to
Hexadecimal Numbers
 Repeatedly divide the 16.
 Each remainder is a hexa digit in the
translated value.
 i.e. (422)10 = (1A6)16

© 2017 learncoal.com 8
Conversion: Hexadecimal
Numbers to decimal Numbers
 Multiply each digit by its corresponding
power of 16:
( ) 10 = (Dn  16n) + …(D3  163) + (D2  162) + (D1  161) + (D0 
160)

 Hex 1234 equals (1  163) + (2  162) + (3


 161) + (4  160), or decimal 4,660.

 Hex 3BA4 equals (3  163) + (11 * 162) +


(10  161) + (4  160), or decimal 15,268.
© 2017 learncoal.com 9
Binary Addition
 Starting with the LSB, add each pair of digits,
include the carry if present.

carry: 1

0 0 0 0 0 1 0 0 (4)

+ 0 0 0 0 0 1 1 1 (7)

0 0 0 0 1 0 1 1 (11)
bit position: 7 6 5 4 3 2 1 0

© 2017 learncoal.com 10
Hexadecimal Addition
 Divide the sum of two digits by the number base (16).
 The quotient becomes the carry value, and the
remainder is the sum digit.
1 1

66 35 48 5A
69 38 58 3B
CF 6D A0 95

21 / 16 = 1, rem 5
© 2017 learncoal.com 11
Hexadecimal Subtraction
 When a borrow is required from the digit to the
left, add 16 (decimal) to the current digit's value:

16 + 5 = 21

-1
DF 95
A6 57
39 3E

© 2017 learncoal.com 12
Integer Numbers
 In computer system, programmer should know that
the number usage is dependent on the programmers
the way they want to use.
 The range of the number varies for signed and
unsigned numbers having same size.
 Integer range is considered to be -∞ to +∞.
 While here the range depends on the number of bits used
by the data type.
 If the data type is BYTE than it uses 8 bits while if it is
WORD than it uses 16 bits and so on.

 Note: The smallest memory unit of computer system


is BYTE and every BYTE has an address.
© 2017 learncoal.com 13
Unsigned Integer Numbers
 Unsigned integers are same as Decimal
numbers.
 There conversion and working is similar to
decimal numbers.
 The range of unsigned integer is from 0 to +∞.
 While here the range depends on the number of
bits used by the data type.
 If the data type is BYTE than it uses 8 bits (0 to
28-1) while if it is WORD than it uses 16 bits (0 to
216-1) and so on.

© 2017 learncoal.com 14
Signed Integer Numbers
 In computer system, it is known that the most
significant bit shows whether the number is positive
or negative.
 Hence the range of positive number hold by signed
number reduces.
 Here, if the data type is BYTE than it uses 8 bits but
range is (-27 to 27-1) while if it is WORD than it uses
16 bits but range is (-215 to 215-1) and so on.
 Consider this number: 11001100. If the programmer
uses that value in a unsigned integer than it is a
positive number (204) while if the programmer uses it
in a signed integer than it is a negative number (-56).
© 2017 learncoal.com 15
Test your understanding!
Solve it.
1. Conversion
A. ( 110100111101 )2 = ( ) 10 = ( )16
B. ( 3B0BD1EF ) 16 = ( ) 10 = ( ) 2

2. Operation
A. Add ( 11010110 )2 and (10110011 ) 2

B. Subtract (10110011 ) 2 From (11010110 )2


C. Add ( AC9F2B8E )16 and (7D9B3AC) 16
D. Subtract (7D9B3AC ) 16 From (AC9F2B8E )16

16

© 2017 learncoal.com

You might also like