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

Unit 1 Basics of Computer Part 2b NumberSystem

Uploaded by

qadri.tayyaba25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Unit 1 Basics of Computer Part 2b NumberSystem

Uploaded by

qadri.tayyaba25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

1.

Decimal to Octal
(i) (9)10 = ( ?)8
8 9
8 1 1
0 1
STOP
(9)10 = (11)8

(ii) (23)10 = ( ?)8


8 23
8 2 7
0 2
STOP

(23)10 = (27)8

(iii) (89.35)10 = ( ?)8


89 in decimal is converted into octal
8 89
8 11 1
8 1 3
0 1
STOP

.35*8
.35*8
2.80 *8 2
.40 *8 6
.20*8 3
.60 1

(.2631)8
Combining integer value with floating point value
(89.35)10 = (131.2631)8
2. Decimal to Hexadecimal

(i) (9)10 = (?)16


16 9
0 9
STOP
9)10 = (9)16
(ii) (23)10 = (?)16
16 23
16 1 7
0 1
STOP
(23)10 = (17)16
(iii) (28)10 = (?)16
16 28
16 1 12 =C
0 1
STOP
(23)10 = (1C)16
(iv) (18)10 = (?)16
16 18
16 1 2
0 1
STOP
(23)10 = (12)16
(v) (89.35)10 = ( ?)16

First – successive division of 89 with 16, then


Multiply .35 with 16
16 89
16 5 9
0 5
STOP
(59)16
.35 * 16
.60 * 16 5
.60 * 16 9
9
(.5999)16

Combining both values, we get


(59.5999)16

3. Decimal to any other number system

1. (9)10 = (?)4 = (?)12

4 9
4 2 1
0 2
STOP

12 9
0 9
STOP

(9)10 = (21)4 = (9)12

2. (23.25)10 = (?)4 = (?)12


4 23
4 5 3
4 1 1
0 1
STOP

12 23
12 1 11 = B
0 1
STOP
(23)10= (113)4 = (1B)12
.25*4
.00 1
STOP
(.1)4

.25*12
.00 3
STOP
(.3)12

(23.25)10= (113.1)4 = (1B.3)12


# Decimal to any number system
- Integer conversion - Successive division – base/radix of required no. system.
- Floating point Conversion - Repetitive multiplication - base/radix of no. system.
25/1/2021

Decimal Number System  Other Number System


Other Number System  Decimal No. System

1. Binary Number System  Decimal number System


(i) (1011)2 = (?)10
1011

(1*23)+(0*22)+(1*21)+(1*20) = 1*8+ 0*4+1*2+1*1= 8 +0 + 2+ 1 = 11


(11)10

(1)2 = (01)2 = (1)10


(10)2 = (2)10 => 1*21 +0*20= 2
(11)2 = (3)10
(100)2 = (4)10
(101)2 = (5)10
(110)2 = (6)10
(111)2 = (7)10
(1000)2 = (8)10
(1001)2 = (9)10
(1010)2 = (10)10 = (A)16
(1011)2 = (11)10 = (B)16
(1100)2 = (12)10
(1101)2 = (13)10
(1110)2 = (14)10
(1111)2 = (15)10

(ii) (10010010.0101)2 = ( ?)10

1*2^7+ 0*2^6+0*2^5+1*2^4+0*2^3+0*2^2+1*2^1+0*2^0
=>1*128+0*64+0*32+1*16+0*8+0*4+1*2+0*1
=>128+0+0+16+0+0+2+0=146
Integer value in decimal is 146

.0101
0*2^-1+ 1*2^-2+ 0*2^-3 + 1*2^-4
=>0*1/2+1*1/4+0*1/8+1*1/16
=>0+1/4+0+1/16= 5/16=0.3125
Floating pointing number
Combine integer value and floating point value
(10010010.0101)2 = (146. 3125)10

2. Octal to Decimal
(iii) (765)8= (?)10
=>7 * 8^2+ 6*8^1+5* 8^0
=>7*64+ 6*8+5*1
=> 448 + 48+5 = (501)10
(iv) (123.05)8 = (?)10

=>1 * 8^2+ 2*8^1+3* 8^0


=>64+16+3= 83
For floating point number
=>0*8^-1+5* 8^-2
=>0*1/8+5*1/64
=5/64= (.078125)10

(83. 078125)10

3. Hexadecimal to Decimal

(v) (1A)16= (?)10


1*16^1+10*16^0=1*16+10*1= (26)10

(vi) (121)16= (?)10


1*16^2+2*16^1+1*16^0
=>1*256+2*16+1*1
=256+32+1= (289)10
(vii) (32.B1)
Integer value
3*16^1+2*16^0
=3*16+2*1=48+2=50

Floating point value


.B1
B*16^-1+1*16^-2

=11/16+1/256= 177/256 = .6914

Combining Integer and Floating point value


(50. 6914)10
28/1/2021

Binary to Octal
Binary to Hexadecimal

Binary = 0 and 1
Octal = 2^3
Hexadecimal = 2^4
(11100100101010.1010)2= (?)8

Binary  Decimal Octal


Binary Octal (2^3)
11100100101010
Blocks of 3 digits starting from right and move towards left
11 or 011 100 100 101 010
3 4 4 5 2

(34452)8

.1010
101 0 or 000
5 0
(34452.50)
Binary  Octal
(110101)2= (?)8
110 = 6
101 = 5
(65)8
======
(110101)  Decimal
32+16+0+4+0+1= (53)10

53  Octal
8 53
8 6 5
0 6

(65)8
(.1010)2 = (?)10
1/2 + 0 + 1/8 + 0
= 5/8= .625

(.625)  Octal
.625*8= 5.000
(.5)8
Binary to Hexadecimal
2^1 2^4
Bianary Decimal  Hexadecimal

(10101100)2 decimal
128+0+32+0+8+4+0+0 = 172
172 in decimal  hexadecimal
16 172
16 10 12= C
0 10=A

(AC)16
16 162
16 10 2
0 10= A

(A2)16

(10101100)2
1010 1100
10=A 12=C
(AC)16

(1110101100)2
11 1010 1100
3 A C

(111101011.1010101101)2 = (?)16
1 or 0001 1110 1011
1 14 =E 11=B

1010 1011 0100 or 01


10=A 11=B 4

It is better to use 0100 as the output would be more accurate as in


comparison with the binaryDecimalHexadecimal Conversion.
(1EB.AB1)16 – A less accurate answer
(1EB.AB4)16 - Correct answer

(1110101100.1010101101)2= (?)10

512+256+128+0+32+0+8+4+0+0 = 940

1010101101
1/2 + 0 + 1/8 + 0 + 1/32 + 0 + 1/128 + 1/256 + 0 + 1/1024
0.6689453125
(940.6689453125)10  (?)16

16 940
16 58 12=C
16 3 10=A
0 3
STOP

(.6689453125)10  (?)16

.6689453125 * 16
10.703125 * 16 10 =A
11.25 * 16 11 = B
4.0000 4
STOP
Octal

Decimal Binary

Hexadecimal
(345.2)8(?)2

3 4 5
011 100 101

.2
010

(011100101)2

(1A2B.2)16(?)2
1 A 2 B
0001 1010 0010 1011

(0001101000101011)2
Or
(1101000101011)2

.2
0010

You might also like