Chapter - 2
Number System
( D ) Answer the following questions:-
Ques:-1 Describe Decimal number system with example ?
Ans:- Some examples of decimal numbers are:- A number system which uses digits from 0 to 9 to represent a number with base 10 is the decimal system number. The number is expressed in base-10 where each value is denoted by 0 or first nine positive integers.
Computer architecture supports following number systems.
- Binary number system
- Octal number system
- Decimal number system
- Hexadecimal (hex) number system
Table of the Numbers Systems with Base, Used Digits, Representation, C language representation:
Number system | Base | Used digits | Example | C Language assignment |
Binary | 2 | 0,1 | (11110000)2 | int val=0b11110000; |
Octal | 8 | 0,1,2,3,4,5,6,7 | (360)8 | int val=0360; |
Decimal | 10 | 0,1,2,3,4,5,6,7,8,9 | (240)10 | int val=240; |
Hexadecimal | 16 | 0,1,2,3,4,5,6,7,8,9, A,B,C,D,E,F | (F0)16 | int val=0xF0; |
Number System Conversions
There are three types of conversion:- Decimal Number System to Other Base
[for example: Decimal Number System to Binary Number System] - Other Base to Decimal Number System
[for example: Binary Number System to Decimal Number System] - Other Base to Other Base
[for example: Binary Number System to Hexadecimal Number System]
Decimal Number System to Other Base
To convert Number system from Decimal Number System to Any Other Base is quite easy; you have to follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which you want to convert the number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most Significant Bit (MSB).
Decimal to Binary Conversion | Result |
Decimal Number is : (12345)10 | Binary Number is (11000000111001)2 |
Decimal to Octal Conversion | Result |
Decimal Number is : (12345)10 | Octal Number is (30071)8 |
Decimal to Hexadecimal Conversion | Result |
Example 1 Decimal Number is : (12345)10 | Hexadecimal Number is (3039)16 |
Example 2 Decimal Number is : (725)10 |
1 comment:
Excellent data with lots of information. I have bookmarked this page for my future reference. Do share more updates.
Tally course in Chennai
Online Tally course
Tally Training in Coimbatore
Post a Comment