Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems...

24
Chapter 1 Number Systems Digital Electronics

description

Review of base 10 – decimal number system A decimal number with the value of each place holder or digit can be expressed as a power of 10. For example in decimal number , 1 is at thousands place, 2 at hundreds, 3 at tens, 4 at units, 5 at tenths and 6 at hundredths. This number can be expressed by sum of weights as, x x x x X X In decimal number system we have 10 symbols i. e. 0, 1, 2, 3, 4,5,6, 7, 8, 9 Number of symbols for any number system is equal to base or radix of that system. So, decimal number system has base 10.

Transcript of Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems...

Page 1: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Chapter 1Number Systems

Digital Electronics

Page 2: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Topics discussed in last lectureDigital systemsAdvantages of using digital signals over

analog.Disadvantages of digital signals over

analog.Binary systemReview of binary conversions.

Page 3: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Review of base 10 – decimal number system

A decimal number with the value of each place holder or digit can be expressed as a power of 10.

For example in decimal number 1234.56, 1 is at thousands place, 2 at hundreds, 3 at tens, 4 at units, 5 at tenths and 6 at hundredths. This number can be expressed by sum of weights as,

1 2 3 4 . 5 6 1 x 104 + 2 x 103 + 3 x 102 + 4 x 101 + 5

X 10-1 +6 X 10-2  In decimal number system we have 10 symbols i. e. 0 , 1,

2, 3, 4,5 ,6, 7, 8, 9Number of symbols for any number system is equal to

base or radix of that system. So, decimal number system has base 10.

Page 4: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

In any number system, when the count at any digit place passes to highest value of symbol, the digit rolls back to 0 and next digit is incremented by 1.

For example, in decimal number system, if the digit at units place reaches to 9 then units place is set to 0 and tens place is set to 1. Another example is an electricity unit reading meter.

0 1 2 3 4 5 6 7 8 9 10

Page 5: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Binary Number System

Need of binary number system If we use decimal number system for building

electronic circuits, then we need to generate, manipulate and store 10 different logic levels. This will make the electronic circuitry complex. It is relatively easy to build the circuits which can handle only 2 logic levels.

Therefore binary number systems are used

in designing of digital systems.

Page 6: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Binary Number SystemBinary number system uses only two symbols i. e. 0

and 1. A binary digit or symbol is known as a bit and each binary digit can be expressed as power of 2. In binary system you count as

011011100101110111, and so on.Binary numbers are also known as binary words,

and binary words with certain number of bits have also acquired special names.

A binary word with 4 bits is called a nibble.A binary word with 8 bits is called a byte.A binary word with 16 bits is called a word.A binary word with 32 bits is called a double word.

Page 7: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Binary Number SystemIn any binary word the rightmost bit is known

as Least Significant bit (LSB) and leftmost bit is known as Most Significant bit (MSB).

For example in a byte 01101011   0 is MSB 1 is

LSB 

Page 8: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Octal Number System

Octal number system uses 8 symbols i. e. 0,1,2,3,4,5,6,7. Therefore, it is also called base 8 system. In octal number system you can count as

0 1 2 3 4 5 6 7 101112 and so

on.If we have very long string of binary numbers it is not

convenient to handle that data and user may convert the data to equivalent octal code.

By using this system code length can be reduced to one third of its length in binary number system.

Page 9: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Hexadecimal Number System

The hexadecimal system has base 16 i. e. it contains 16 symbols.

These symbols are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F.

It is also known as alphanumeric number system as it uses both digits and alphabets.

What is the need of such system?

Page 10: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Hexadecimal Decimal Binary

0 0 0

1 1 1

2 3 10

3 4 11

4 5 100

5 6 101

6 7 110

7 8 111

8 9 1000

9 10 1001

A 11 1010

B 12 1011

C 13 1100

D 14 1101

E 15 1110

F 16 1111

From the table you can see that a long string is used to represent number “16” in binary number system but If we use hexadecimal number system in place of binary number system this length will get reduced to a single symbol ‘F’

Page 11: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversions from one number system to another

Need of number system conversions As we know that computer understands the language

of 0 and 1 only, we need to convert the data into binary form before feeding it to the computer and also we need to convert it back to decimal form for user. Because of this reason we need to learn conversion methods.

Page 12: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversion from any number system to decimal number system In general decimal equivalent of a number, expressed in any other

number system is given by,

aj . rn + aj-1 . rn-1 + ... +a2 . r2 + a1 . r1 + a0 + a-1 . r-1 + a-2 . r -2 + .. ..+ a-k . r-m ……. eq.1

where, m, n represents place value or power of base by which the coefficient should be multiplied. r represents the base of number system in which the number is expressed. aj represents the jth coefficient of the digit which can be any of the digit of number system in which the number is expressed.

Page 13: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Keeping this equation in mind let us try conversion of binary number 110.11 into decimal number.

(A)10 = 1 x 22 + 1x 21 + 0 x 20 + 1x 2-1 +1x2-2 = 6.75

Similarly , try the conversion of following binary numbers to decimal equivalent.

(.0001)2(1100100.101)2 (.101)2

Page 14: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Octal to decimal conversion

Using equation 1 convert the following numbers into decimal numbers

(314)8(345)8(630.4)8

Page 15: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Hexadecimal To Decimal Conversion Using equation 1 convert the following

numbers into decimal numbers

(10BF)16(176)16

Page 16: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversion from decimal to binary Repeated Division by 2 methodBegin by dividing the decimal number by 2.

Then divide each resulting quotient by 2 until there is a 0 whole-number quotient.

The remainders generated by each division form the binary number.

The first remainder is the LSB and the last remainder is the MSB of the binary number.

Page 17: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Example: Convert decimal no. 64 to binary number

2 642 32 --- 02 16 --- 02 8 --- 02 4 --- 02 2 --- 02 1 --- 02 0 --- 1

(64)10 = (1000000)2

Page 18: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversion from decimal to octal Repeated Division by 8 methodBegin by dividing the decimal number by 8.

Then divide each resulting quotient by 8 until there is a 0 whole-number quotient.

The remainders generated by each division form the binary number.

The first remainder is the LSB and the last remainder is the MSB of the binary number.

Page 19: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Convert the following decimal numbers in numbers

(279)10(43)10

Convert the following decimal numbers to hexadecimal numbers

(837)10(2748)10

Page 20: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversion from binary to octal number systemFor any given binary number make groups of

three digits each, starting from the binary point and proceeding from the left to the right.

After making groups, start assigning octal digit to each group.

For example if you want to convert 11011011 to octal number then as described above make groups of digit

(011 011 011)2

( 3 3 3)8

Page 21: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Conversion from binary to hexadecimal number systemFor binary to hexadecimal conversion, same method

which was used for binary to octal conversion can be used, with an exception that now you need to make group of four digits starting from right side and proceeding towards the left.

after making groups assign equivalent hexadecimal code to each group.

Example: Convert 11110111100011 to a hexadecimal number

( 0011 1101 1110 0011)2

( 3 D E 3)16

Page 22: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Convert the following binary numbers to octal numbers

(10110001)2(101011111)2

Convert the following binary numbers to hexadecimal numbers

(00110000)2(01101101)2

Page 23: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

Signed NumbersIn binary number system, bits are also used to represent sign of

number. Remember the decimal number system in which “+” and “-”

signs are used to represent the sign of number. Binary system uses the bits “0” and “1” to show sign of

number. A “0” is for positive and “1” is for negative.The left most bit in a signed binary number is the sign bit,

which tells whether the number is positive or negative.Example: 00011001

Sign bit Magnitude bitsThis is decimal number +25.

Page 24: Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.

ComplementsComplements are used in digital computers to

simplify the subtraction operation and for logical manipulations.

Types of complements1)The radix complement2)Diminished radix complement

Radix complement is also called r’s complement, and diminished radix complement as (r -1)’s

complement.