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

Unit 1-1

Uploaded by

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

Unit 1-1

Uploaded by

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

UNIT 1

Q1 What do you understand by number system?


NUMBER SYSTEM
Number system is a basis for counting varies items. Modern computers communicate and operate
with binary numbers which use only the digits 0 &1. Basic number system used by humans is Decimal
number system.

For Ex: Let us consider decimal number 18. This number is represented in binary as 10010.

We observe that binary number system take more digits to represent the decimal number. For large
numbers we have to deal with very large binary strings. So this fact gave rise to three new number systems.

i) Octal number systems

ii) Hexa Decimal number system

iii) Binary Coded Decimal number(BCD) system

To define any number system we have to specify

• Base of the number system such as 2,8,10 or 16.

• The base decides the total number of digits available in that number system.

• First digit in the number system is always zero and last digit in the number system is always
base-1.

Binary number system:


The binary number has a radix of 2. As r = 2, only two digits are needed, and these are 0 and 1. In
binary system weight is expressed as power of 2.

The left most bit, which has the greatest weight is called the Most Significant Bit (MSB). And the
right most bit which has the least weight is called Least Significant Bit (LSB).
For Ex: 1001.012 = [ ( 1 ) × 23 ] + [ ( 0 ) × 22 ] + [ ( 0 ) × 21 ] + [ ( 1 ) × 20 ] + [ ( 0 ) × 2-1 ] + [
( 1 ) × 22 ]
1001.012 = [ 1 × 8 ] + [ 0 × 4 ] + [ 0 × 2 ] + [ 1 × 1 ] + [ 0 × 0.5 ] + [ 1 × 0.25 ]
1001.012 = 9.2510

Decimal Number system

The decimal system has ten symbols: 0,1,2,3,4,5,6,7,8,9. In other words, it has a base of 10.

Octal Number System

Digital systems operate only on binary numbers. Since binary numbers are often very long, two
shorthand notations, octal and hexadecimal, are used for representing large binary numbers. Octal systems
use a base or radix of 8. It uses first eight digits of decimal number system. Thus it has digits from 0 to 7.

Hexa Decimal Number System


The hexadecimal numbering system has a base of 16. There are 16 symbols. The decimal digits 0 to
9 are used as the first ten digits as in the decimal system, followed by the letters A, B, C, D, E and F, which
represent the values 10, 11,12,13,14 and 15 respectively.

Decima Binar Octal Hexadeci


l y mal
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Q2 explain number base conversion system?

Number Base conversions


The human beings use decimal number system while computer uses binary number system.
Therefore it is necessary to convert decimal number system into its equivalent binary.

i) Binary to octal number conversion


ii) Binary to hexa decimal number conversion

iii) Octal to binary Conversion

iv) Hexa to binary conversion

v) Octal to Decimal conversion

Ex: convert 4057.068 to octal

=4x83+0x82+5x81+7x80+0x8-1+6x8-2

=2048+0+40+7+0+0.0937
=2095.093710
vi) Decimal to Octal Conversion

Ex: convert 378.9310 to octal

37810 to octal: Successive division:

8 | 378
|
8 |47 --- 2
|
8 |5 --- 7 ↑
|
0 --- 5

=5728

0.9310 to octal :
0.93x8=7.44
0.44x8=3.52 ↓
0.53x8=4.16
0.16x8=1.28
=0.73418
378.9310=572.73418
vii) Hexadecimal to Decimal Conversion
Ex: 5C716 to decimal

=(5x162)+(C x161)+ (7 x160)

=1280+192+7

=14710
viii) Decimal to Hexadecimal Conversion

Ex: 2598.67510

1 6 2598
16 162 -6
10 -2

= A26 (16)
0.67510=0.675x16 -- 10.8
=0.800x16 -- 12.8 ↓
=0.800x16 -- 12.8
=0.800x16 -- 12.8
=0.ACCC16

2598.67510 = A26.ACCC16

ix) Octal to hexadecimal conversion:

The simplest way is to first convert the given octal no. to binary & then the binary no. to
hexadecimal.

Ex: 756.6038

7 5 6 . 6 0 3
111 101 110 . 110 000 011
0001 1110 1110 . 1100 0001 1000
1 E E . C 1 8

x) Hexadecimal to octal conversion:

First convert the given hexadecimal no. to binary & then the binary no. to octal.

Ex: B9F.AE16

B 9 F . A E
1011 1001 1111 . 1010 1110
101 110 011 111 . 101 011 100
5 6 3 7 . 5 3 4

=5637.534
Q3 What do you understand by Binary Code ?

Binary codes

Binary codes are codes which are represented in binary system with modification from the
original ones.
Weighted Binary codes
Non Weighted Codes
Weighted binary codes are those which obey the positional weighting principles, each
position of the number represents a specific weight. The binary counting sequence is
an example.
Q4 Explain Gray Code number system?

Gray Code

The gray code belongs to a class of codes called minimum change codes, in
which only one bit in the code changes when moving from one code to the next. The
Gray code is non-weighted code, as the position of bit does not contain any weight.
The gray code is a reflective digital code which has the special property that any two
subsequent numbers codes differ by only one bit. This is also called a unit- distance
code. In digital Gray code has got a special place.
Q5 What do you understand by BCD Addition and BCD
Subtractionnumber system?

BCD Addition:

It is individually adding the corresponding digits of the decimal no,s expressed in


4 bit binary groups starting from the LSD . If there is no carry & the sum term is not an illegal
code , no correction is needed .If there is a carry out of one group to the next group or if the sum
term is an illegal code then 610(0100) is added to the sum term of that group & the resulting carry
is added to the next group.

Ex: Perform decimal additions in 8421 code


(a)25+13
In BCD 25= 0010 0101
In BCD +13 =+0001 0011

38 0011 1000
No carry , no illegal code .This is the corrected sum

(b). 679.6 + 536.8


679.6 = 0110 0111 1001 .0110 in BCD
+536.8 = +0101 0011 0010 .1000 in BCD
_ _ _
________________ _

1216.4 1011 1010 0110 . 1110 illegal codes


+0110 + 0011 +0110 . + 0110 add 0110 to each

(1)0001 (1)0000 (1)0101 . (1)0100 propagate carry


/ / / /
+1 +1 +1 +1

0001 0010 0001 0110 . 0100

1 2 1 6 . 4
BCD Subtraction:

Performed by subtracting the digits of each 4 bit group of the subtrahend the digits from
the corresponding 4- bit group of the minuend in binary starting from the LSD . if there is no
borrow from the next group , then 610(0110)is subtracted from the difference term of this group.

(a)38-15

In BCD 38= 0011 1000


In BCD -15 = -0001 0101

23 0010 0011
No borrow, so correct difference.

.(b) 206.7-147.8

206.7 = 0010 0000 0110 . 0111 in BCD


-147.8 = -0001 0100 0111 . 0110 in BCD
_ _
_______________ _

58.9 0000 1011 1110 . 1111 borrows are present


-0110 -0110 . -0110 subtract 0110

0101 1000 . 1001

You might also like