Professional Documents
Culture Documents
Lecture_CSP05
Lecture_CSP05
Lecture_CSP05
4
What is Base?
• Decimal Number System
– Base is 10
– All numbers are represented by 0 to 9
• Binary Number System
– Base is 2
– All numbers are represented by 0 and 1
• Hexadecimal Number System
– Base is 16
– All numbers are represented by 0 to 15
• Inference
– Maximum digit value in any number system is Base -1
5
Decimal to Binary conversion
Decimal to Binary conversion
• Divide the number by 2 and take only the remainder, if division is
completed than take only the remainder which gives the binary number.
• the number is taken and counted from the last remainder
(87)10 = (1010111)2
Fraction Decimal Numbers to Binary
• For this the successive multiplication is done.
• The number which is to be converted is multiplied with base or radix
of binary number which is 2.
• The integer part or the carry of the product is taken out and the
same process is repeated until we get an integer.
2-1 = 0.5
2-2 = 0.25
Example: 2-3 = 0.125
11111110.110
11
Conversion from Binary to Decimal (Fractions)
12
Conversion of Decimal Point Number to Decimal
Example:
Binary Numbering System
• Decimal number is a weighted number, converting from decimal to binary
(base 10 to base 2) will also produce a weighted binary number with the
right-hand most bit being the Least Significant Bit(LSB), and the left-
hand most bit being the Most Significant Bit(MSB), as shown below:
28 27 26 25 24 23 22 21 20
256 128 64 32 16 8 4 2 1
(15605605)10 =(EE1F65)16
Hexadecimal to Decimal
Converting from Binary to Hexadecimal
• Every four bits is a hex digit.
– Start grouping from right-hand side
Example: 011101010001111010011010111
3 A 8 F 4 D 7
24
Hexadecimal is not a new machine representation, just a
convenient way to write the number.
Hexadecimal to Binary
• first of all we have to convert every digit of the hexadecimal
number into its equivalent binary numbers (making every group a
group of four by adding 0s to the left of the number).
Problem
How we convert a Hexadecimal Number into Binary Number?
Attempt following:
i. ADF6
ii. DB69
iii. CA36
iv. 5678
v. DABC
Convert the above given number into octal and decimal number
29
Binary Number Names & Prefixes
classification of individual bits into larger groups are generally
referred to by the following more common names of:
1 Bit
4 Nibble
8 Byte
16 Word
32 Double Word
64 Quad Word
Number of Bytes Common Name