Skip to main content

Introduce the number system

 .

Number  is a way to represent or express the numbers in a computer system which is known as the number system. Number system plays a great role in computing and electronics. Before numbers, people used stones and sticks for the purpose of counting. Decimal system was discovered by great Hindu philosophers, since then man are using it as their daily need. In our day to day activities we use decimal number system which uses symbols 0,1,2,3,4,5,6,7,8 and 9 to represent digits. However, computers only understand binary numbers which uses symbols 0 and 1 to represent the digit. 

Decimal Number System

The Decimal Number System has the base number 10 and this notation is called the decimal notation. This number system has its applications in computer and computer science. The decimal number are written with subscript 10 as (4532)10  or with suffix D as 3642D.
For example : (56425)10 or (56425)D

Binary Number System

Binary number system is used by computers and digital electronic devices. The base or radix of the binary number system is 2. So binary number system uses two symbols 0 and 1 to represent the digits. The digit 0 is represented by LOW voltage and digit 1 is represented by HIGH voltage. A binary number digit (either a 0  or 1) is  called bit. 
For example : (1101001.11)

Octal Number Number System 

Octal number system uses eight symbols 0,1,2,3,4,5,6 and 7 to represent the digits for octal number system.. As the octal number system uses eight symbols, its base or radix is eight. 
For example: (43673)8 or (43673)O

Hexadecimal Number System 

The hexadecimal number system uses sixteen different symbols to represent its digits, so its base or radix is sixteen. The symbols used in hexadecimal number system are 0,1,2,3,4,5,6,7,8 and 9 frim decimal number system and A,B,C,D,E and F from the alphabets. The symbols, A,B,C,D,E and F correspond to the decimal numbers 10,11,12,13,14 and 15 respectively.
For example :  (19B4DA)16 or (19B4DA)H


Conversion Binary to Decimal 

To convert a binary number to its decimal equivalent, we use the weight of each binary digit first. The weight of the nth bit of a number counted from right to left = 2n-1. The value of the digit = Digit * weight = nth  bit * 2n-1. After calculating the value of each bit, they are added to get the decimal values. let's see the following example.

(101101.001)2 = (?)10

= 1*25 + 0*24 + 1*23 + 1*22 +0*21 + 1*20 + 0*2-1 + 0*2-2 + 1*2-3

= 1*32 + 0 *16 + 1* 8 + 1 * 4 + 0 * 2 + 1*1 + 0 * 1/2 + 0 * 1/4 + 1* 1/8

=32 + 0 + 8 + 4 + 1 + 0 + 0 + 1/8

=  45/8

So (101101.001)2 = (45/8)10

Octal to Decimal

Similar to the conversion from binary to decimal, we use a similar conversion technique using the digit weight. The weight of the nth number from right to lest = 8n-1. The value of the digit is calculated as digit * weight = digit nth* 8n-1. After calculating value of each digit, we add them to get the decimal values. Let's see the following example.

(465.65)8 = (?)10

= 4 * 82 + 6 * 81 + 5 * 80 + 6 * 8-1 + 5 * 8-2

= 4 * 64  + 6 * 8 + 5 * 1 + 6 * 1/8 + 5 * 1/64

= 256 + 48 + 5 + 6/8 + 5/64

= 320/72               = 4.44

Hexadecimal to Decimal 

The conversion from hexadecimal to decimal is done in the same way as with binary to decimal or octal to decimal. The weight of nth number from right to left = 16n-1. The value of the digit = digit * weight =  nth digit *8n-1. After calculating the value of each digit, we add them to get the decimal values. Let's see the following example.

(B5D)16 = (?)16

= B * 162 +  5 * 161 + 13 * 160

= 11 * 256 + 5 * 16 + 13 * 1

= 2816 + 80 + 13

= 2909

So (CAB)16 = (2909)10



Home

Comments

Popular posts from this blog

Important Questions of Data Structure and Algorithm (DSA)

 . 1. What is Data structure? Explain different operations to be performed on data structure. 2. Define stack as ADT. Convert P+Q-(R*S/T+U) - V*W into infix expression to postfix. 3. Define Queue. Explain its type with example. 4.  Difference between stack and Queue. 5. Difference between Linear Queue and circular Queue. 6. Write an algorithm to enqueue and dequeue data element in a circular queue.                              7. Define Linked List. Explain its type. How does double linked List is different from circular linked   List. 8. What is recursion and recursive function? write a recursive function to compute Fibonacci number. 9. What is an AVL tree ? Create an  AVL tree from the following data:      18, 12, 14, 8, 85, 25, 31, 24, 27 10. Define B-tree? How to insertion and deletions of elements can be done in a B-tree. 11. Create an B-tree from the following Data:  ...

BCA Math II old question model solution

 . BCA Math II question model 2018: BCA Math II question model 2019: BCA Math II question model 2020:

Define LAN and WAN

 . Local Area Network (LAN)  A LAN is a network that is used for communicating among computer devices, usually within an office building or home.   LAN’s enable the sharing of resources such as files or hardware devices that may be needed by multiple users • • Is limited in size, typically spanning a few hundred meters, and no more than a mile.  Is fast, with speeds from 10 Mbps to 10 Gbps.  Requires little wiring, typically a single cable connecting to each device.  Has lower cost compared to MAN’s or WAN’s.  LAN’s can be either wired or wireless. Twisted pair, coax or fiber optic cable can be used in wired LAN’s. Advantages of LAN :    The data is transferred at an extremely faster rate in local Area Network.  Local area network (LAN) provides higher security. Disadvantages of LAN :   Initial cost of installing local area network is quite high.  Unauthorized user can access critical data of an organization in case LAN ad...