0% found this document useful (0 votes)
26 views19 pages

CH 1 CA

653563

Uploaded by

AMBA DIGITAL
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)
26 views19 pages

CH 1 CA

653563

Uploaded by

AMBA DIGITAL
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/ 19

Chapte

er 1: Number Sy
ystem |7

1.3
3.2.3 FLOATING
G POINT ADDITTION
Asssume you havee two numbers 9.70
9 × 10–1 and 9.99 × 101. Ad
dd these two num
mbers.

Rewrrite the numbers, so


s that exponent of
o both numbers 9.70 × 10–1 = 0.09
97 × 101
S
Step‐1
match.
Add the
t mantissas of bo
oth numbers 0.097 + 9.99 = 10
0.087
S
Step‐2
0.087 × 101
So, the sum is 10
S
Step‐3 Convert the result in no
ormalised form 10.087 × 101 = 1.0087 × 102
Round the result if mantissa does not fit in the space 1.0087 × 102 cann be rounded
S
Step‐4
provided. off as 1.009 × 102

1.3
3.2.4 ADVANTA
AGES AND DISA
ADVANTAGES OF
O FLOATING‐P
POINT REPRESENTATION
Ass computer meemory is limitted, numbers with w limited prrecision are noot stored in
coomputer. So, flooating point num mbers are of greeat benefit. Thee floating-point notation has
thee advantage that it has wide range of numbbers. But the downside d of flooating point
nootations is that itt round off largee numbers.

1.4 D
DIGITAL NUM
MBER SYSTEEM
In digital electronnics, the numbber system is ussed for representing the informmation. The
nuumber system hash various basees. The radix orr base is the tottal numbers of digits that a
paarticular numberr system can acccommodate. Suuppose if the number
n system representing
thee digit from 0 – 9 then the basee of the system is the 10.
A system based on digital logics and circuuits understand
d the digits andd their value
baased on their poosition in the designated
d num
mber. The valuee of digit can be
b evaluated
using
• Position off digit in numbeer system
• The radix/bbase of the num
mber system
The different number system
m that are usedd to implementt and design various
v logic
cirrcuits and system
ms are:

Binary Number Octal Numb


ber

Number Syystem

Decimal Number Hexadecimal Nu


umber

Figg. 1.4 Types of nu


umber system
8| Digital Electronics: Logic and Design

1.4.1 BINARY NUMBER SYSTEM


Binary number system is also called base 2 system. In binary number system, any number
can be represented using two digits 0 and 1. It has radix (base) 2. The binary number
system is mostly used in computers, where programming language is based on two digits
number system.

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

In binary number system, each position in a binary number represents a 0 power of the
base (2).

Binary Number 1 1 0 . 1 1 1
Power of Base 22 21 20 2‐1 2‐2 2‐3
Magnitude of each term 4 2 0 0.5 0.25 0.125

1.4.2 OCTAL NUMBER SYSTEM


In octal number system, any number can be represented using eight digits 0 to 7. It has
radix (base) 8. Each position in an octal number represents a 0 power of the base (8).
While working on computers, it is easier to write number in octal form rather than binary
form.

Octal number 1 4 0 . 2 1 0
Power of Base 82 81 80 8‐1 8‐2 8‐3
Magnitude of each term 64 32 0 0.25 0.015 0

1.4.3 DECIMAL NUMBER SYSTEM


The number system that we use in our daily life applications is decimal number system.
In decimal number system, any number can be represented using ten digits 0 to 9. It has
radix (base) 10. Each position in a decimal number represents a X power of the base (10).
In decimal number system, the successive positions to the left of the decimal point
represents units, tens, hundreds, thousands and so on. The advantages in the decimal
number system are that the mathematical terminology and concept use is identical to the
base that is used for counting everyday numbers.
Chapter 1: Number System |9

Decimal number 1 4 0 . 2 1 0
2 1 0 –1 –2
Power of Base 10 10 10 10 10 10–3
Magnitude of each term 100 40 0 0.2 0.01 0

1.4.4 HEXADECIMAL NUMBER SYSTEM


In hexadecimal number system, any number can be represented using digits and alphabets
as 0 to 9 and A, B, C, D, E, F. It has radix (base) 16. Each position in a hexadecimal
number represents a X power of the base (16). The hexadecimal system is commonly
used by programmers to describe locations in memory because it can represent every byte
(i.e., eight bits) as two consecutive hexadecimal digits instead of the eight digits.

Hexadecimal number 2 A 0 . 2 1 0
2 1 0 –1 –2
Power of Base 16 16 16 16 16 16–3
Magnitude of each term 512 160 0 0.125 0.003 0

The value of digits and letters used in hexadecimal number system is:

Digit/Alphabet Value Digit/Alphabet Value


0 0 8 8
1 1 9 9
2 2 A 10
3 3 B 11
4 4 C 12
5 5 D 13
6 6 E 14
7 7 F 15

The number system and digit associated with these number systems are as follow:

Number System Base (Radix) Digits & Alphabets


Binary 2 0, 1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Hexadecimal 16 0‐9, A, B, C, D, E, F

1.5 NUMBER SYSTEM CONVERSION


In our daily life, we use decimal number system. But computers do not understand
decimal number system. So, to process computations binary number system is needed.
The representation of large numbers in binary is difficult to read. In context to understand
10| Digital Electronics: Logic and Design

long sequence of binary digits, hexadecimal and octal number system are useful. The
number system conversion is technique to convert one number in base r to another
number system in equivalent base r.

1.5.1 CONVERSION FROM BINARY NUMBER SYSTEM TO ANY OTHER BASE


The binary number system is string of zeros and ones. The base of binary number system
is two as it has only two values 0 and 1. The binary digit is known as bit. For example,
the binary number 110101 has 6 bits and 0100 has 4 bits. The group of four bits is known
as nibble and group of 8 bits is known as byte. A byte is basic unit in data processing. The
range of n bit binary number is from 0 to 2n-1. It means, 2-bit binary number has range
from 0 to 3 and 4-bit binary number has range from 0 to 15.

1.5.1.1 BINARY TO DECIMAL NUMBER CONVERSION


Conversion from binary to decimal number system involves multiplication of each bit by
its positional weight and summing up the values.

Rules for Conversion from Binary to Decimal


Rule 1: Note the positions of each bit and calculate its positional weight as 2x; as binary system has
radix 2.
Rule 2: Take the product of bit value and its positional weight.
Rule 3: Find the summation of all product values. This is required decimal number.

Example 1.1 Convert binary number (1011.01)2 to decimal


Solution:

Bit value 1 0 1 1 . 0 1
3 2 1 0 ‐1
Positional weight 2 2 2 2 . 2 2‐2
Product 8 0 2 1 . 0 0.25
Summation 8 + 0 + 2 + 1 + 0 + 0.25 = 11.25

So, (1011.01)2 = (11.25)10

Example 1.2 Convert binary number (0100.10)2 to decimal


Solution:

Bit value 0 1 0 0 . 1 0
Positional weight 23 22 21 20 . 2‐1 2‐2
Product 0 4 0 0 . 0.5 0
Summation 0 + 4 + 0 + 0 + 0.5 + 0 = 4.5

So, (0100.10)2 = (4.5)10


Chapter 1: Number System |11

1.5.1.2 BINARY TO OCTAL NUMBER CONVERSION


The radix of octal number is 8 and binary number is 2. The radix of octal number can be
mentioned as 23 = 8, which indicates that grouping of 3 bits produces an octal number.
Append zeros, in case bits are less than 3.

Rules for Conversion from Binary to Octal


Rule 1: Make a group of three binary digits.
Rule 2: For integer, start grouping from right to left direction.
Rule 3: For fractional part, start grouping from left to right direction.
Rule 4: write the decimal equivalent of each group of bits.

Example 1.3 Convert binary number (110110.010)2 to Octal


Solution: The grouping of 3 bits can be done as:

110 110. 010


6 6 . 2
So, (110110.010)2 = (66.2)8

Example 1.4 Convert binary number (1010.01)2 to Octal


Solution: During grouping of 3 bits, zeros can be appended to complete the grouping

001 010. 010


1 2 . 2
So, (110110.010)2 = (12.2)8

1.5.1.3 BINARY TO HEXADECIMAL NUMBER CONVERSION


The hexadecimal number system is mostly used in digital computation, because it deals
with grouping of 4 bits. The radix of hexadecimal number is 16 and binary number is 2.
The radix of hexadecimal number can be mentioned as 24 = 16, which indicates that
grouping of 4 bits produces a hexadecimal number. Append zeros, in case bits are less
than 3.
Rules for Conversion from Binary to Hexadecimal
Rule1: Make a group of four binary digits.
Rule 2: For integer, start grouping from right to left direction.
Rule 3: For fractional part, start grouping from left to right direction.
Rule 4: Write the decimal equivalent of each group of bits.
12| Digital Electronics: Logic and Design

Example 1.5 Convert binary number (01011011.1010)2 to Hexadecimal


Solution: The grouping of 4 bits can be done as:

0101 1011. 1010


5 B . A
So, (110110.010)2 = (5B.A)16

Example 1.6 Convert binary number (11111.01)2 to Hexadecimal


Solution: During grouping of 4 bits, zeros can be appended to complete the grouping

0001 1111 . 0100


1 F . 4
So, (110110.010)2 = (1F.4)16

1.5.2 CONVERSION FROM DECIMAL NUMBER SYSTEM TO ANY OTHER BASE


The decimal number system has digits from 0 to 9. It has radix 10. The daily life
calculations and systems use decimal system. But the computer is unable to process the
decimal inputs. So, the conversion from decimal number system to another number
system is required.

1.5.2.1 DECIMAL TO BINARY NUMBER SYSTEM CONVERSION


The method used for converting a decimal integer number to binary number is known as
double dabble. It involves successive division. The decimal number is divided by 2 and
note down the remainders. Then use bottom to top approach for obtaining the binary
number. The decimal fractional number is converted to binary number by successive
multiplication.
Rules for conversion from Decimal to Binary
(A) For Decimal Integer:
Rule 1: Divide the quotient by 2, record the remainder.
Rule 2: Stop the division if quotient is less than base 2.
Rule 3: Adopt Bottom‐Top approach and note the remainders. It is equivalent binary number.
(B) For Decimal Fraction:
Rule 1: Multiply the decimal fraction with 2. Separate the integer part from the product.
Rule 2: Repeat the multiplication of fractional part with 2, it will produce new product. Note the integer
value and repeat multiplication of fractional part.
Rule 3: Adopt Top‐Bottom approach for noted integer values. It is equivalent binary values. Discard the
fractional part.
Chapter 1: Number System |13

Example 1.7 Convert Decimal Number (35.2)10 into Binary


Solution:
(A) Integer part: (35)10

2 35
2 17 1
2 8 1
2 4 0
2 2 0
1 0 (35)10 = (100011)2

(B) Fractional part: (0.2)10


0.2 × 2 = 0.4 integer: 0
0.4 × 2 = 0.8 integer: 0
0.8 × 2 = 1.6 integer: 1
0.6 × 2 = 1.2 integer: 1 (0.2)10 = (0.0011)2
So, (35.2)10 = (100011.0011)2

Example 1.8 Convert Decimal Number (105.75)10 into Binary


Solution:
(A) Integer part: (105)10
2 105
2 52 1
2 26 0
2 13 1
2 6 1
2 3 0 (105)10= (1101001)2
2 1 1

(B) Fractional part: (0.75)10


0.75 × 2 = 1.5 integer: 1
0.5 × 2 = 1.0 integer: 1
0.0 × 2 = 0.0 integer: 0 (0.75)10 = (0.110)2
So, (105.75)10 = (1101001.110)2
14| Digital Electronics: Logic and Design

1.5.2.2 DECIMAL TO OCTAL NUMBER SYSTEM CONVERSION


The decimal numbers can be converted into octal numbers by dividing by 8, in case of
decimal integer and multiply by 8 for the case of decimal fraction. The rules for
conversion are stated here below:

Rules for conversion from Decimal to Octal


(A) For Decimal Integer:
Rule 1: Divide the quotient by 8, record the remainder.
Rule 2: Stop the division if quotient is less than base 8.
Rule 3: Adopt Bottom‐Top approach and note the remainders. It is an equivalent octal number.
(B) For Decimal Fraction:
Rule 1: Multiply the decimal fraction with 8. Separate the integer part from the product.
Rule 2: Repeat the multiplication of fractional part with 8, it will produce new product. Note the integer
value and repeat multiplication of fractional part.
Rule 3: Adopt Top‐Bottom approach for noted integer values. It is an equivalent octal values. Discard
the fractional part.

Example 1.9 Convert Decimal Number (37.45)10 into Octal


(A) Integer part: (37)10

8 37
8 4 3 (37)10 = (43)8

(B) Fractional part: (0.45)10


0.45 × 8 = 3.60 integer: 3
0.60 × 8 = 4.80 integer: 4
0.80 × 8 = 6.40 integer: 6
0.40 × 8 = 3.20 integer: 3
(0.45)10 = (0.3463)8
So, (37.45)10= (43.3463)8

Example 1.10 Convert Decimal Number (412.53)10 into Octal


(A) Integer part: (412)10

8 412
8 51 4 (412)10 = (634)8
8 6 3
Chapter 1: Number System |15

(B) Fractional part: (0.53)10


0.53 × 8 = 4.24 integer: 4
0.24 × 8 = 1.92 integer: 1
0.92 × 8 = 7.36 integer: 7
0.36 × 8 = 2.88 integer: 2
(0.53)10 = (0.4172)8
So, (412.53)10= (634.4172)8

1.5.2.3 DECIMAL TO HEXADECIMAL NUMBER SYSTEM CONVERSION


The decimal numbers can be converted into hexadecimal numbers by dividing by 16, in
case of decimal integer and multiply by 16 for the case of decimal fraction. The rules for
conversion are stated here below:
Rules for conversion from Decimal to Hexadecimal
(A) For Decimal Integer:
Rule 1: Divide the quotient by 16, record the remainder.
Rule 2: Stop the division if quotient is less than base 16.
Rule 3: Adopt Bottom‐Top approach and note the remainders. It is an equivalent hexadecimal number.
(B) For Decimal Fraction:
Rule 1: Multiply the decimal fraction with 16. Separate the integer part from the product.
Rule 2: Repeat the multiplication of fractional part with 8, it will produce new product. Note the integer
value and repeat multiplication of fractional part.
Rule 3: Adopt Top‐Bottom approach for noted integer values. It is an equivalent hexadecimal values.
Discard the fractional part.

Example 1.11 Convert Decimal Number (107.35)10 into Hexadecimal


(A) Integer part: (107)10

16 107
16 6 B (107)10 = (6B)16

(B) Fractional part: (0.35)10


0.35 × 16 = 5.60 integer: 5
0.60 × 16 = 9.60 integer: 9
0.60 × 16 = 9.60 integer: 9
0.60 × 16 = 9.60 integer: 9
(0.35)10 = (0.5999)16
So, (107.35)10 = (43.3463)8
16| Digital Electronics: Logic and Design

Example 1.12 Convert Decimal Number (168.53)10 into Hexadecimal


(A) Integer part: (168)10

16 16 168
16 A 8 (168)10 = (A8)16

(B) Fractional part: (0.53)10


0.53 × 16 = 8.48 integer: 8
0.48 × 16 = 7.68 integer: 7
0.68 × 16 = A.88 integer: A
0.88 × 8 = E.08 integer: E
(0.53)10 = (0.87AE)16
So, (168.53)10 = (A8.87AE)8

1.5.3 CONVERSION FROM OCTAL NUMBER SYSTEM TO ANY OTHER BASE


Octal number system has base 8. It is clubbing of 3 binary digits. The range of octal
number is from 0 to 7. The conversion from octal to other number is important for
optimization purpose.

1.5.3.1 OCTAL TO BINARY NUMBER SYSTEM CONVERSION


Octal to binary number system is reverse of binary to octal number system. The rules for
conversion are as below:
Rules for Conversion from Octal to Binary
Rule1: Write the octal number: integer and fraction part.
Rule 2: Mention each octal digit in terms of 3 binary bits. It is an equivalent required binary digit.
Rule 3: For fractional part, start grouping from left to right direction.

Example 1.13 Convert Octal Number (147.16)8 to Binary


Solution:
1 4 7. 1 6

000 100 111 . 001 110


So, (147.16)8 = (000100111.001110)2
Chapter 1: Number System |17

Example 1.14 Convert Octal Number (213.12)8 to Binary


Solution:
2 1 3. 1 2

010 001 011 . 001 010


So, (213.12)8 = (010001011.001010)2

1.5.3.2 OCTAL TO DECIMAL NUMBER SYSTEM CONVERSION


As the decimal system is widely used number system in our day to day life. The
conversion from octal to decimal number system is multiplication of octal bits by its
positional weight and summing up the product. The rules for conversion are stated as
below:
Rules for Conversion from Octal to Decimal
Rule 1: Note the positions of each bit and calculate its positional weight as 8x; as octal system has
radix 8.
Rule 2: Take the product of bit value and its positional weight.
Rule 3: Find the summation of all product values. This is required decimal number.

Example 1.15 Convert octal number (6230.41)8 to decimal


Solution:

Bit value 6 2 3 0 . 4 1
Positional
83 82 81 80 . 8–1 8–2
weight
Product 3072 128 24 0 . 0.5 0.015
Summation 3072 + 128 + 24 + 0 + 0.5 + 0.015 = 3224.515

So, (6230.41)8 = (3224.515)10

Example 1.16 Convert octal number (1211.20)8 to decimal


Solution:

Bit value 1 2 1 1 . 2 0
3 2 1 0 –1
Positional weight 8 8 8 8 . 8 8–2
Product 512 128 8 1 . 0.25 0
Summation 512 + 128 + 8 + 1 + 0.25 + 0 = 649.25

So, (1211.20)8 = (649.25)10


18| Digital Electronics: Logic and Design

1.5.3.3 OCTAL TO HEXADECIMAL NUMBER SYSTEM CONVERSION


The octal number system is clubbing of 3 binary digits and hexadecimal number system
is clubbing of 4 binary digits. Most of the computational techniques are based on
hexadecimal system, because 4 binary digits are grouped in this number system. The
conversion rules from octal to hexadecimal are as below:
Rules for Conversion from Octal to Hexadecimal
Rule1: Write the octal number: integer and fraction part.
Rule 2: Mention each octal digit in terms of 3 binary bits.
Rule 3: Regroup the bits in 4‐bit. It is an equivalent required hexadecimal digit.

Example 1.17 Convert Octal Number (427.11)8 to Hexadecimal


Solution:
4 2 7 . 1 1 Representation in 3 bits

100 010 111 . 001 001


000 Re-grouping in 4 bits
00

0001 0001 0111 . 0010 0100


= 117.24 Hexadecimal Number
So, (427.11)8 = (117.24)16

Example 1.18 Convert Octal Number (111.11)8 to Hexadecimal


Solution:
1 1 1 . 1 1 Representation in 3 bits

001 001 001 . 001 001


000 Re-grouping in 4 bits
00

0000 0100 1001 . 0010 0100 Octal Number


= 049.24
So, (111.11)8 = (049.24)16
Chapter 1: Number System |19

1.5.4 CONVERSION FROM HEXADECIMAL NUMBER SYSTEM TO


ANY OTHER BASE
The hexadecimal number system has base 16. The range of hexadecimal numbers are
from 0-9, A, B, C, D, E, F. due to wide range of applications, the conversion from
hexadecimal number system to another number system is important.

1.5.4.1 HEXADECIMAL TO BINARY NUMBER SYSTEM CONVERSION


Hexadecimal to binary number system is reverse of binary to hexadecimal number
system. The rules for conversion are as below:
Rules for Conversion from Hexadecimal to Binary
Rule 1: Write the hexadecimal number: integer and fraction part.
Rule 2: Mention each Hexadecimal digit in terms of 4 binary bits. It is an equivalent required binary digit.
Rule 3: For fractional part, start grouping from left to right direction.

Example 1.19 Convert Hexadecimal Number (7A7.B2)16 to Binary


Solution:
7 A 7 . B 2

0111 1010 0111 . 1011 0010


So, (7A7.B2)16 = (011110100111.10110010)2

Example 1.20 Convert Hexadecimal Number (ABC.DE)16 to Binary


Solution:
A B C . D E

1010 1011 1100 . 1101 1110


So, (ABC.DE)16 = (101010111100.11011110)2

1.5.4.2 HEXADECIMAL TO DECIMAL NUMBER SYSTEM CONVERSION


The decimal number system is the major requirement for real time applications. The
conversion from hexadecimal to decimal number system is multiplication of bit value by
its positional weight and summing up the product.
20| Digital Electronics: Logic and Design

Rules for Conversion from Hexadecimal to Decimal


Rule 1: Note the positions of each bit and calculate its positional weight as 16x; as octal system has
radix 16.
Rule 2: Take the product of bit value and its positional weight.
Rule 3: Find the summation of all product values. This is required decimal number.

Example 1.21 Convert hexadecimal number (6AAA.C1)16 to decimal.


Solution:

Bit value 6 A A A . C 1
3 2 1 0 ‐1
Positional weight 16 16 16 16 . 16 16‐2

Product 40960 2560 160 10 . 0.75 0.003

Summation 40960 + 2560 + 160 + 10 + 0.06 + 0.003 = 43690.753

So, (6AAA.C1)16 = (43690.753)10

Example 1.22 Convert hexadecimal number (2381.FF)16 to decimal.


Solution:

Bit value 2 3 8 1 . F F

Positional 163 162 161 160 . 16‐1 16‐2


weight

Product 8192 768 128 1 . 0.93 0.05

Summation 8192 + 768 + 128 + 1 + 0.93 + 0.05 = 9089.98

So, (2381.FF)16 = (9089.98)10

1.5.4.3 HEXADECIMAL TO OCTAL NUMBER SYSTEM CONVERSION


The hexadecimal number system is having radix 16 and it is group of 4 binary digits,
whereas octal number system is clubbing of 3 binary digits. The conversion rules from
hexadecimal to octal are as below:
Rules for Conversion from Hexadecimal to Octal
Rule 1: Write the hexadecimal number: integer and fraction part.
Rule 2: Mention each hexadecimal digit in terms of 4 binary bits.
Rule 3: Regroup the bits in 3‐bit. It is an equivalent required octal digit.
Chapter 1: Number System |21

Example 1.23 Convert Hexadecimal Number (AA7.1A)8 to Octal


Solution:
A A 7 . 1 A 4-bit representation

101 0 10 10 0 111 . 000 1 10 10 Re-grouping of 3 bits


0
= 5 2 4 7 . 0 6 4
Octal Number
So, (AA7.1A)16 = (5247.064)8

Example 1.24 Convert Hexadecimal Number (1CA.EF)8 to Octal


Solution:
1 C A . E F
4-bit representation
000 1 11 00 1 010 111 0 11 11
0 Re-grouping of 3 bits
= 0 7 1 2 . 7 3 6

Octal Number
So, (1CA.EF)16 = (0712.736)8

1.6 BINARY ARITHMETIC


Binary number system is the foundation of all computer related operations. Arithmetic
operations are possible on binary number system. The procedure of binary arithmetic is
almost similar to mathematical calculation. Rules need to be followed for binary addition,
binary subtraction, binary multiplication and binary division.

1.6.1 BINARY ADDITION


When we add two numbers the resultant is sum and if that sum is having an extra bit, that
bit is known as carry bit. The numbers to be added are known as augend and addend. The
binary addition deals with string of 0 and 1.
22| Digital Electronics: Logic and Design

The rules for binary addition are as follow:


Rules for Binary Addition
0+0=0 Sum = 0; Carry = 0
0+1=1 Sum = 1; Carry = 0
1+0=1 Sum = 1; Carry = 0
1 + 1 = 10 Sum = 0; Carry = 1
1 + 1 + 1 = 11 Sum = 1; Carry = 1

Example 1.25 Add the following Binary Numbers


(a) 10 + 10 (b) 11 + 111 (c) 111 + 1111 (d) 101+101
Solution:
(a) Mathematically, 2 + 2 = 4
Binary:
10
+ 10
100 = (4)10
Answer: Sum = (100)2; Carry = 1
(b) Mathematically, 3 + 7 = 10
Binary: The first number has 2 bits and second number has 3 bits. So, to equate
number of bits, append zero to first number.
011
+ 111
1010 = (10)10
Answer: Sum = (1010)2 ; Carry = 1
(c) Mathematically, 7 + 15 = 22
Binary: The first number has 3 bits and second number has 4 bits. So, to equate
number of bits, append zero to first number
0111
+ 1111
10110 = (22)10
Answer: Sum = (10110)2; Carry = 1
Chapter 1: Number System |23

(d) Mathematically, 5 + 5 = 10
Binary:
101
+ 101
1010 = (10)2
Answer: Sum = (1010)2 ; Carry = 1

1.6.2 BINARY SUBTRACTION


In the subtraction y = a – b;

a is minuend, b is subtrahend and y is difference.

If the value of a is less than b, then a digit is taken from more significant position, is
known as borrow bit. The binary subtraction is performed on binary bits.
Rules for Binary Subtraction
0–0=0 Difference = 0; Borrow = 0
1–0=1 Difference = 1; Borrow = 0
1–1=0 Difference = 0; Borrow = 0
0–1=1 Difference = 1; Borrow = 1

Example 1.26 Subtract the following binary bits


(a) 1011-1001 (b) 10000-101
Solution:
(a) Mathematically, 11 – 9 = 2
1011
–1001
0010 = (2)10
Answer: Difference = (0010)2 ; Borrow = 0
(b) Mathematically, 16 – 5 = 11
1111 ← Borrow from high order bit
10000
– 101
1011 = (11)10
Answer: Difference = (1011)2; Borrow = 0
24| Digital Electronics: Logic and Design

1.6.3 BINARY MULTIPLICATION


Binary multiplication is performed in same manner as decimal multiplication. Partial
product is created and successive partial product is shifted to left. Then add all the partial
products.
Rules for Binary Multiplication
0×1=0
1×0=0
1×1=1
0×0=0

Example 1.27 Perform the binary multiplication on following numbers


(a) 111 × 111 (b) 1001 × 1111
Solution:
(a) 111
× 111
1111
1111 ×
1111 ××
110001
Answer: (110001)2
(b) 1001
× 1111
1001
1001 ×
1001 ××
1001 ×××
10000111
Answer: (10000111)2

1.6.4 BINARY DIVISION


Decimal division and binary division, both are having same procedure and pattern. The
rules for binary division are as below:
Chapter 1: Number System |25

Rules for Binary Division


0÷1=0
1÷0=0
Division by 0 is not allowed

Example 1.28 Perform the following Binary Division Operation


(a) 110 ÷ 11 (b) 1111 ÷ 111
Solution:
(a) 10 Quotient
11 110
11
000 Remainder
Answer: (10)2
(b) 1010 Quotient
101 110110
101
111
101
100 Remainder
Answer: (1010)2

1.7 REPRESENTATION OF SIGNED NUMBER


Unsigned numbers do not require any arithmetic sign to represent a number. They are
positive numbers. A k bit unsigned number represents all the numbers from 0 to 2k-1.

Range of 8‐bit unsigned number Range of 16‐bit unsigned number


Number system Range Number system Range
Decimal 0‐255 Decimal 0‐65535
Hexadecimal 00‐FF Hexadecimal 0000‐FFFF

In binary number systems, the negative numbers are encoded using signed numbers.
The signed numbers require an arithmetic sign. The MSB, most significant bit of a binary
number is used to represent the sign bit, which further indicates that whether number is
positive or negative.

You might also like