0% found this document useful (0 votes)
24 views

Lecture-1 - Number System and Conversion

Numbers system and conversion

Uploaded by

subratyadav01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lecture-1 - Number System and Conversion

Numbers system and conversion

Uploaded by

subratyadav01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

UNIT-1

NUMBER SYSTEM AND COMBINATIONAL LOGIC


LECTURE-1
Number System and Conversions:

A number system is defined as a system of writing to express numbers. A number system is a


mathematical system with base n, where n represents total numbers present in that system.

Eg: In decimal number system, the number of digits is 10

Radix Point:

Radix point is a base point used to separate the integer part and the fractional part of a number.

Base or radix:

The number of symbols used in a number system is called base or radix of the number system.

Eg: In decimal number system – Base is 10


In Binary number system – Base is 2
In Hexadecimal number system – Base is 16 etc.

Most significant bit (MSB):


The left most bit of a binary number which has the highest place value is called most significant bit.
Least significant bit (LSB):

The right most bit of a binary number which has the least place value is called least significant bit.

Bit:
A binary digit is called a bit.
Example: 0 or 1

Nibble:
A group of four bits is called a Nibble.
Example: 0110, 1110 etc.

Byte:
A group of eight bits is called a byte.
Example: 01101101, 11010011 etc.

Types of number systems


➢ Binary number system
➢ Octal number system
➢ Decimal number system
➢ Hexadecimal number system

Number system Base(Radix) Used digits Example


Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
0,1,2,3,4,5,6,7,8,9,
Hexadecimal 16 (F0)16
A,B,C,D,E,F
Binary number system:
The base of binary number system is 2. The digits used are 0 and 1.
Example: 11001(2), 0101(2)

Octal number system:


The base of octal number system is 8.
The digits used are 0, 1, 2, 3, 4, 5, 6 and 7.
Example: 157(8), 2312(8), 110(8)

Table representing decimal, Octal and binary number

Decimal Number Octal Number Binary Number


0 0 000
1 1 001
2 2 010
3 3 011
4 4 100
5 5 101
6 6 110
7 7 111

Decimal number system:


The base of decimal number system is 10.
The digits used are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Example: 0157(10), 6587(10), 0110(10)

Hexadecimal number system:


The base of hexadecimal number system is 16.
The digits used are 0, 1, 2, 3, 4, 5, 6, 7, 8 9, A, B, C, D, E and F.
Example: 0157(16), 2312(16), 0110(16), ABC5(16), BDEF(16)

Table representing decimal, hexadecimal and binary number

Decimal Number Hexadecimal Number Binary Number


0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
NUMBER SYSTEM CONVERSIONS

DECIMAL TO OTHER

1. DECIMAL TO BINARY

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).
2. DECIMAL TO OCTAL

3. DECIMAL TO HEXADECIMAL

BINARY TO OTHER

A) Multiply the digit with 2(with place value exponent). Eventually add all the multiplication
becomes the Decimal number.
1. BINARY TO DECIMAL

2. BINARY TO OCTAL

An easy way to convert from binary to octal is to group binary digits into sets of three, starting
with the least significant (rightmost) digits.

Binary: 11100101 = 11 100 101


011 100 101 Pad the most significant digits with zeros if
necessary to complete a group of three.

Then, look up each group in a table:

Binary: 000 001 010 011 100 101 110 111


Octal: 0 1 2 3 4 5 6 7

3. BINARY TO HEXADECIMAL

An equally easy way to convert from binary to hexadecimal is to group binary digits into sets of
four, starting with the least significant (rightmost) digits.

Binary: 11100101 = 1110 0101


Then, look up each group in a table:

Binary: 0000 0001 0010 0011 0100 0101 0110 0111


Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101


Hexadecimal = E 5 = E5
hex
OCTAL TO OTHER

1. OCTAL TO BINARY
Converting from octal to binary is as easy as converting from binary to octal. Simply look upeach octal
Digit to obtain the equivalent group of three binary digits

2. OCTAL TO HEXADECIMAL

When converting from octal to hexadecimal, it is often easier to first convert the octal number
into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex:

(from the previous example)


Octal = 3 4 5

Binary = 011 100 101 = 011100101 binary

Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits.

Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals
hexadecimal E5.
3. OCTAL TO DECIMAL

The conversion can also be performed in the conventional mathematical way, by showing each
digit place as an increasing power of 8.
345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

OR

Converting octal to decimal can be done with repeated division.

1. Start the decimal result at 0.


2. Remove the most significant octal digit (leftmost) and add it to the result.
3. If all octal digits have been removed, you’re done. Stop.
4. Otherwise, multiply the result by 8.
5. Go to step 2.

Octal Digits Operation Decimal Result Operation Decimal Result


345 +3 3 ×8 24
45 +4 28 ×8 224
5 +5 229 done.

=> (345)8 = (229)10

HEXADECIMAL TO OTHER

1. HEXADECIMAL TO BINARY

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal.


Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits.

Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 8 9 A B C D E F
Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal = A 2 D E
Binary = 1010 0010 1101 1110 = 1010001011011110 binary

2. HEXADECIMAL TO OCTAL

For converting hexadecimal to octal, there are two steps required to perform, which are as follows:

1. In the first step, we will find the binary equivalent of the hexadecimal number.
2. Next, 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
and write the octal digits corresponding to each pair.
Example 1: (152A.25)16

Step 1:

We write the four-bit binary digit for 1, 5, 2, A, and 5.

(152A.25)16=(0001 0101 0010 1010.0010 0101)2

So, the binary number of hexadecimal number 152A.25 is (0011010101010.010101)2

Step 2:

3. Then, we make pairs of three bits on both sides of the binary point.

001 010 100 101 010.001 001 010

4. Then, we write the octal digit, which corresponds to each pair.

(001010100101010.001001010)2=(12452.112)8

So, the octal number of the hexadecimal number 152A.25 is 12452.112

3. HEXADECIMAL TO DECIMAL

The process of converting hexadecimal to decimal is the same as binary to decimal. The process starts from
multiplying the digits of hexadecimal numbers 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 hexadecimal to decimal.

Example 1: (152A.25)16

Step 1:

We multiply each digit of 152A.25 with its respective positional weight, and last we add the
products of all the bits with its weight.

(152A.25)16=(1×163)+(5×162)+(2×161)+(A×160)+(2×16-1)+(5×16-2)
(152A.25)16=(1×4096)+(5×256)+(2×16)+(10×1)+(2×16-1)+(5×16-2)
(152A.25)16=4096+1280+32+10+(2×1⁄16)+(5×1⁄256)
(152A.25)16=5418+0.125+0.125
(152A.25)16=5418.14453125

So, the decimal number of the hexadecimal number 152A.25 is 5418.14453125

You might also like