Sunday, April 18, 2021

                                       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. 

Ques:-2 Briefly explain the hexadecimal number system ?

Ans:- Number systems are the technique to represent numbers in the computer system architecture, every value that you are saving or getting into/from computer memory has a defined number system.

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 systemBaseUsed digitsExampleC Language assignment
Binary20,1(11110000)2int val=0b11110000;
Octal80,1,2,3,4,5,6,7(360)8int val=0360;
Decimal100,1,2,3,4,5,6,7,8,9(240)10int val=240;
Hexadecimal160,1,2,3,4,5,6,7,8,9,
A,B,C,D,E,F
(F0)16int 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 ConversionResult
Decimal Number is : (12345)10
decimal to binary conversion
Binary Number is
(11000000111001)2


                                                             Make by Aakash
Decimal to Octal ConversionResult
Decimal Number is : (12345)10
decimal to octal conversion
Octal Number is
(30071)8

Decimal to Hexadecimal ConversionResult
Example 1
Decimal Number is : (12345)10
decimal to octal hexadecimal
Hexadecimal Number is
(3039)16
Example 2
Decimal Number is : (725)10
decimal to octal hexadecimal

class 6

  What is computer virus? A computer virus is a type of malware that attaches to another program (like a document), which can replicate and ...