NUMBER SYSTEM AND CONVERSIO BOOLEAN LOGIC

 



NUMBER SYSTEM AND CONVERSIO BOOLEAN LOGIC

Number system and conversion

  • In general term computer represent information in different types of data forms I.e number, character, picture, audio, video etc.
  • The language we use to communicate with each other is comprised of words and characters. We understand numbers, characters and words. But this type of data is not suitable for computers. Computers only understand the numbers.
  •   Computers are made of a series of switches/ gates. Each switch has two states: ON(1) or OFF(0). that’s why computer works on the basis of binary number system(0/1). But for different purpose different number system are used in computer world to represent information.
  •  E.g: Octal, Decimal, Hexadecimal

 So, when we enter data, the data is converted into electronic pulse. Each pulse is identified as code and the code is converted into numeric format by ASCII. It gives each number, character and symbol a numeric value (number) that a computer understands. 

The Number Systems used in computers are:

  1. Binary number system
  2. Octal number system
  3. Decimal number system
  4. Hexadecimal number system


Binary Number System

In this number system, it carries only two digits, either 0 or 1. There are two types of electronic pulses present in a binary number system. The first one is the absence of an electronic pulse representing '0'and second one is the presence of electronic pulse representing '1'. Each digit is known as a bit. A four-bit collection (1101) is known as a nibble, and a collection of eight bits (11001010) is known as a byte. The location of a digit in a binary number represents a specific power of the base (2) of the number system. 

Characteristics:

1. It holds only two values, i.e., either 0 or 1.

2. It is also known as the base 2 number system.

3. The position of a digit represents the 0 power of the base(2). 

4. The position of the last digit represents the x power of the base(2).

Decimal Number System

This number system has ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) so its base is 10. In this number system, the maximum value of a digit is 9 and the minimum value of a digit is 0. This number system is widely used in our day to day life. It can represent any numeric value.

 Octal Number System

The octal number system has base 8(means it has only eight digits from 0 to 7). There are only eight possible digit values to represent a number. This number system is also used to shorten long binary numbers. With the help of only three bits, an octal number is represented. Each set of bits has a distinct value between 0 and 7.


Hexadecimal number system

It is another technique to represent the number in the digital system called the hexadecimal number system.This number system has 16 digits that ranges from 0 to 9 and A to F(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). So, its base is 16. The A to F alphabets represent 10 to 15 decimal numbers. Only 4 bits are required for representing a number in a hexadecimal number. Each set of bits has a distinct value between 0 and 15



Number Base Conversion

we learned different types of number systems such as binary, decimal, octal, and hexadecimal. 

As, we have four types of number systems so each one can be converted into the remaining three systems. There are the following conversions possible in Number System

1. Binary to other Number Systems. 

2. Decimal to other Number Systems. 

3. Octal to other Number Systems. 

4. Hexadecimal to other Number Systems.

Binary to other Number Systems

There are three conversions possible for binary number, i.e., binary to decimal, binary to octal, and binary to hexadecimal.

Binary to Decimal Conversion
The process of converting binary to decimal is quite simple. The process starts from multiplying the bits of binary number with its corresponding positional weights. And lastly, we add all those products. Let's take an example to understand how the conversion is done from binary to decimal. 
 Binary Number: 101012

Calculating Decimal Equivalent -

Binary to Octal Conversion

The base numbers of binary and octal are 2 and 8, respectively. In a binary number, the pair of three bits is equal to one octal digit. There are only two steps to convert a binary number into an octal number which are as follows:

1. In the first step, we have to make the pairs of three bits on both sides of the binary point. If there will be one or two bits left in a pair of three bits pair, we add the required number of zeros on extreme sides. 

2. In the second step, we write the octal digits corresponding to each pair.


Binary to Hexadecimal Conversion

The base numbers of binary and hexadecimal are 2 and 16, respectively. In a binary number, the pair of four bits is equal to one hexadecimal digit. There are also only two steps to convert a binary number into a hexadecimal number which are as follows:

1. In the first step, we have to make the pairs of four bits on both sides of the binary point. If there will be one, two, or three bits left in a pair of four bits pair, we add the required number of zeros on extreme sides.

 2. In the second step, we write the hexadecimal digits corresponding to each pair.

Subtraction of binary numbers using 1’s complement

1. Make both numbers have the same number of bits. 

2. Determine the 1’s complement of the number to be subtracted(subtrahend). 

3. Add the 1’s complement to the given number from which we subtract(minuend). 4. If there exists any additional bit (carry) in the result after addition, remove and add it to the result else (I.e if there exists no carry) determine the 1’s complement of the result and prefix by a negative sign to get the final result. 

Subtraction using 2’s complement

1. Make both numbers have a same number of bits.

 2. Determine the 2’s complement of the number to be subtracted(subtrahend).

 3. Add the 2’s complement to the given number from which we subtract(minuend)

4. If there exists any additional bit (carry) in the result after addition, neglect the carry and the remaining bits is the required answer else (I.e if there exists no carry) determine the 2’s complement of the result and prefix sign to get final result.




Author Spotlight

Santosh Chapagain
Gmail: chapagainsantoshcs@gmail.com
Phone no: +977-9863512955


Post a Comment

0 Comments