Sei sulla pagina 1di 31

SUHAIL T A

LECTURER IN ECE
AL- AMEEN ENGG. COLLEGE,
SHAORANUR
www.edutalks.org
 They provide the basis for all operations in information
processing systems

 In a number system the information is divided into a group of


symbols; for example, 26 English letters, 10 decimal digits
etc.

 There are many different types of number classifications. For


example

www.edutalks.org
 There are many different types of numbers. In conventional
arithmetic, a number system based upon ten units (0 to 9) is
used

 The number system with the basic symbols 0 and 1 is called


binary. ie. A binary system uses just two discrete values. The
binary digit (either 0 or 1) is called a bit.

www.edutalks.org
 The decimal number system uses positional number
representation, which means that the value of each digit is
determined by its position in a number

 The base, also called the radix of a number system is the


number of symbols that the system contains

 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

 Each position in the decimal system is 10 times more


significant than the previous position

www.edutalks.org
 Example 1: the number

2734

is interpreted as

 Here 4 is the least significant digit (LSD) and 2 is the


most significant digit (MSD)

 Example 2: (251.41)10 = 2 x 102 + 5 x 101 + 1 x 100 + 4


x 10-1 + 1 x 10-2
www.edutalks.org
 The binary number system has a radix of 2
 only two digits are needed, 0 and 1
 Like the decimal system, binary is a positional system,
except that each bit position corresponds to a power
of 2 instead of a power of 10
 Digital systems often provide conversion between
decimal and binary numbers
 Any number of 0’s can be added to the left of the
number without changing the value of the number

www.edutalks.org
 Each digit of a binary number, 0 or 1, is called a bit, an
abbreviation for binary digit

 Four bits together is a nibble, 8 bits is called a byte.

 The rightmost bit is called the Least Significant Bit


(LSB) while the leftmost bit is called the Most
Significant Bit (MSB)

www.edutalks.org
 To convert a decimal number into binary number it
requires successive division by 2 writing down each
quotient and its remainder

 The remainders are taken in the reverse order, which is


the binary equivalent of the decimal number

 Example: to convert the decimal number 25 to its binary


equivalent

www.edutalks.org
 To convert decimal fractions into equivalent binary
fractions repeatedly double the decimal fraction

 The number (0 or 1) that appears on the left is written


separately

 The bits that are written in this manner are read from
top to bottom with a decimal point on the left

www.edutalks.org
 For example consider the number 0.625, conversion
is done in the following manner

 The Multiplication cannot be continued further, as


the fractional part in the previous step has already
become zero. Therefore, 0. 62510 = .00012

www.edutalks.org
 The conversion of a binary number to a decimal number
may be accomplished by taking the successive powers of
2 and summing for the result

 For example let’s consider the four bit binary number


0101. The conversion to a decimal number (base 10) is
illustrated below

www.edutalks.org
 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. Thus it has digits


from 0 to 7 (r-1)

 Each position in an octal number is a power of 8, and


each position is 8 times more significant than the
previous position

www.edutalks.org
 Conversion from decimal to octal can be performed by
repeatedly dividing the decimal number by 8 and using
each remainder as a digit in the octal number being
formed

 Example: to convert decimal number 200 to an octal


representation

www.edutalks.org
 The hexadecimal number system has a base of 16

 Digits 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

 Octal and Hex representation is more compact and


it is used in assembly language programming of
microcontrollers

www.edutalks.org
www.edutalks.org
www.edutalks.org
www.edutalks.org
Introduction

 Code is a systematic use of a given set of symbols

for representing information.

 Example: Traffic light (Red: stop, Green: go)

 Used to represent numbers, letters or words

www.edutalks.org
 Used to represent each digit of a decimal
number (0 to 9) as a 4 bit binary

 Example. To convert the number 87410 to BCD

8 7 4 (decimal)

1000 0111 0100 (BCD)

 Each digit always uses four bits

 The BCD value can never be greater than 9


www.edutalks.org
• Reverse the process to convert BCD to decimal

• BCD is not a number system.

• Also known as 8-4-2-1 code – weighted code


and arithmetic operations can be performed
using this code

• A BCD number is not the same as a straight


binary number.

• The primary advantage of BCD is the relative


ease of converting towww.edutalks.org
and from decimal
Decimal Binary Octal Hexadecimal BCD
0 0 0 0 0
1 1 1 1 0001
2 10 2 2 0010
3 11 3 3 0011
4 100 4 4 0100
5 101 5 5 0101
6 110 6 6 0110
7 111 7 7 0111
8 1000 10 8 1000
9 1001 11 9 1001
10 1010 12 A 0001 0000
11 1011 13 B 0001 0001
12 1100 14 C 0001 0010
13 1101 15 D 0001 0011
14 1110 16 E 0001 0100
15 1111 17 www.edutalks.org
F 0001 0101
• This code is used to drive the 7 segment LED
displays

www.edutalks.org
• Each decimal digit is coded into a 4-bit binary
code

• The code for each decimal number is obtained


by adding 3 (binary 0011) to its BCD code

• Ex. Excess- 3 code of 0 is 0000 + 0011 = 0011

• Excess- 3 code of 1 is 0001 + 0011 = 0100

and so on

www.edutalks.org
• Decimal number is represented in binary form in

such a way so that each Gray- code number differs

from the preceding and the succeeding number by

a single bit

• i.e property that two consecutive code words

differ in only 1 bit

• Ex. 5 – 0111, 6 - 0101


www.edutalks.org
• To handle non-numerical information

• Consist of 10 decimal digits, the 26 letters of the


alphabet and a certain number of special symbols

• The most common alphanumeric codes are:


 ASCII ( American Standard Code for Information
Interchange)

 EBCDIC (Extended Binary Coded Decimal


Interchange Code)

www.edutalks.org
• Universally accepted alphanumeric code

• 7-bits codes

• Represent all of the standard keyboard

characters as well as control functions

• • E.g.: <Enter>, <Backspace>, …..

www.edutalks.org
• Universally accepted alphanumeric code

• 7-bits codes

• Represent all of the standard keyboard

characters as well as control functions

• • E.g.: <Enter>, <Backspace>, …..

www.edutalks.org
 Example: ASCII code representation of the word
Digital

Character Binary Code Hexadecimal Code


D 1000100 44
i 1101001 69
g 1100111 67
i 1101001 69
t 1110100 74
a 1100001 61
l 1101100 6C

www.edutalks.org
 Error means corruption of data
Parity bit:

 It is an extra bit that is attached to a code


group that is being transferred from one
location to another. It is made either 0 or 1.
Depending on the number of 1s that are
contained in the code group.

www.edutalks.org
 Even parity:

The value of the parity bit is chosen so that

the total number of 1s, including the parity

bit, is an even number;

1 1000011

 Odd parity:

The value of the parity bit is chosen so that the total


number of 1s, including the parity bit, is an odd
number;

1 1000001 www.edutalks.org
Keep in touch through

suhailta@gmail.com

www.edutalks.org

Potrebbero piacerti anche