456740 Class 21 Number Systems And Codes

  • Uploaded by: umesh
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 456740 Class 21 Number Systems And Codes as PDF for free.

More details

  • Words: 1,229
  • Pages: 32
Digital System

There are two way of representing the numerical value of quantities :  analog  digital

In analog representation a quantity is represented by a voltage, current or meter movement that is proportional to the value of that quantity Example :  automobile speedometer  audio microphone Analog quantities can vary continuous range of values

over

a

In digital representation the quantities are represented not by proportional quantities but by symbols called digits Example : Digital watch It provides the time of day in the form of decimal digits which represent hours and minutes (and sometimes seconds) This digital representation of the time of day changes in discrete steps

Advantages of Digital Techniques 1.Digital systems are easier to design as circuits used are only switching circuits having only HIGH and LOW range 2. Information storage is easy 3. Accuracy and precision are greater

4. Operation can be programmed 5. Digital circuits are less affected by noise, as the spurious fluctuation in voltage (noise) are not as critical in digital systems became the exact value of a voltage is not important 6. More digital circuitry can be fabricated on IC chips

Limitation of Digital Techniques

The real world is mainly analog

Number Systems and Codes

Digital Number System Many number systems are in use in digital technology The most common are decimal binary octal hexadecimal

Decimal Number System It is composed of 10 numerals or symbols, these symbols used as digits of a number to expand any quantity The decimal system is a positional value system

Binary Number System In the binary system, there are only two symbols or possible digit values : 0 and 1 It is also a positional value system wherein each binary digit has its own value or weight expressed as a power of 2 Places to the left of the binary point are positive powers of 2 Places to the the right of the binary point are negative powers of 2

Example : the number 1011.1012

23

1

22

0

21

1

Most Significant Bit (MSB)

20

1

2-1

1

.

Binary Point

2-2

0

2-3

1 Least Significant Bit (LSB)

BINARY TO DECIMAL CONVERSION Example : Convert the number 1011.1012 to its decimal equivalent 1011.1012 = 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 +1 x 2-1 + 0 x 2 -2 + 1 x 2-3 = 8 + 0 + 2 + 1+ 0.5 + 0+ 0.125 =11.62510

DECIMAL TO BINARY CONVERSION by repeated divisions Example - Convert 45610 into binary

2

456

= 1110010002

2 228-------0 remainder 2 114-----0 2 57---0 2 28--1 2 14---0 2 7----0 2 3----1 2 1---1 0---1

Write the remainder from bottom to top

Convert 42.937510 to binary 2 42 2 21---0 210---1 2 5----0 2 2----1 21----0 0---1

0.9375 x2 1.8750 ---1 0.8750 x2 1.7500 --- 1 0.75 x 2 1.50------- 1 0.5 x2 1.0 -------1 Continue till 0 is obtained in fraction part

42.937510 =101010.11112

Example : Convert 25.01210 into binary 2 25 2 12------1 2 6------0 2 3------0 21-----1 0----1

0.012 x2 0.024---0 x2 0.048----0

x2 0.096----0 x2 0.192--- 0

0.192 x2 0.384-- 0 x2 0.768--- 0 x2 1.536----1 0.536 x2 1.072-----1 0.072 x2 0.144---- 0 x 2 0.288--- 0

25.01210 =11001.00000011002 (approximately)

Octal Number System It has a base of 8 and 8 possible digits : 0,1,2,3,4,5,6,7 Octal to decimal conversion 24.68 =2 x 81 + 4 x 80 + 6x 8-1 = 16 + 4 + 0.75 = 20.7510 Decimal to octal conversion Example : convert 49.2187510 into octal 8 49 0.21875 8 6---1 x8 0---6 1.75000----1 .75 x8 6.00-------6 49.2187510 =61.168

Octal to Binary conversion Conversion from octal to binary is performed by converting each octal digit to its 3-bit binary equivalent Ex :

4728 =100 111 0102

Ex :

642.718 = 110 100 010.111 0012

Binary to octal conversion The bits of the binary number are grouped into groups of three bits starting at the LSB. Then each group is converted into its octal equivalent Ex. 101100011002 = 101 100 011 001=54318 5 Ex. 100.1012 = 4.58

4

3

1

Hexadecimal Number System It uses base 16 and 16 possible digit symbols 0 to 9 plus the letters A,B,C,D,E ,F Hex to decimal conversion Ex. 35616 = 3 x 162 + 5 x 161 + 6 x 160 = 85410

Decimal to Hex conversion Ex. 567.187510

= 237.3 16

16 567 16 35----7 16 2----3 0----2

0.1875 x 16 3.000---3

Hex to Binary Conversion Groups of 4 digits are taken Ex. F916 = 1111 10012 Ex. 20E.CA16 = 0010 0000 1110.1100 10102

Binary to Hex Grouped into groups of four bits, and each group is converted to its equivalent hex digit Ex. 11101001102 = 0011 1010 0110 = 3A616 Ex. 1101 .0011 1100 = D.3C16 Example : Convert B2F16 to octal First convert hex to binary ,then to octal B2F16 = 1011 0010 11112 = 101 100 101 111= 54578

CODES When numbers, letters or words are represented by a special group of symbols, we say that they are being encoded and the group of symbols is called code.

Binary- Coded- Decimal Code (BCD) If each digit of a decimal number is represented by its binary equivalent, the result is a code called binary-coded- decimal. Since a decimal digit can be as large as 9, 4 bits are required to code each digit. Ex. 874 = 1000 0111 0100 (BCD)

Gray code It belongs to a class of codes called minimum-change codes, in which only one bit in the code groups changes when going from one stage to the next. The Gray code is an unweighted code. So, this code is not suited for arithmetic operation but finds application in input/output devices and some types of Analog to Digital Converters (ADCs).

Binary Equivalent 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Gray Code 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000

0 0 0 0

0 0 0 0

0 0 0 0 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 0 0 0 0

Generation of Gray Code 0 0 1 1

0 1 1 0

1 1 0 0 0 0 1 1 1 1 0 0

0 1 1 0 0 1 1 0 0 1 1 0

Place a mirror Place a mirror

Place a mirror

Alphanumeric Codes An alphanumeric code represents all of the various characters and functions that are found in a standard typewriter (or computer) keyboard. ASCII Code: The most widely used alphanumeric code, the American standard code for Information Interchange as is used in most micro computers and minicomputers and in many mainframes.The ASCII code is a 7 bit code and so it has 27 =128 possible code groups.

Character A B C ... Z 0 … 9

7- Bit ASCII 1000001 1000010 1000011 ….

Hex 41 42 43 …

1011010 0110000

5A 30

… 0111001

a, b, … blank, etc.

… 39

Example : When writing a BASIC Programme, instruction GO TO 25 G 01000111 O 01001111 T 01010100 O 01001111 2 00110010 5 00110101 0 is added because the codes must be stored as bytes (8bits). This adding of an extra bit is called padding with 0s.

Related Documents

Number Systems
November 2019 33
Number Systems
October 2019 33
Number Systems
April 2020 28
Number Systems
May 2020 17

More Documents from ""