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

SEM 3

The document provides an overview of digital electronics, focusing on number systems and codes. It explains the differences between non-positional and positional numbering systems, detailing binary, octal, decimal, and hexadecimal systems, along with their conversions. Additionally, it outlines methods for converting between these number systems and includes examples for clarity.

Uploaded by

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

SEM 3

The document provides an overview of digital electronics, focusing on number systems and codes. It explains the differences between non-positional and positional numbering systems, detailing binary, octal, decimal, and hexadecimal systems, along with their conversions. Additionally, it outlines methods for converting between these number systems and includes examples for clarity.

Uploaded by

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

Digital Electronics

Unit 1: Number system and Codes

Introduction:
Digital electronics is the foundation of modern computers and Digital
Communications. Massively complex digital logic circuits with the millions of
gates can now be built on to a single integrated circuits such as microprocessor and
the circuits can perform millions of operations per second.
Digital techniques are used Deck of its earlier to get an electronic devices to
switch into one of the number of known States then to accurately reproduce a
continuous range of values.
An advantage of digital circuits when compared to unlock software is that if
signal the presented digitally can be transmitted without the degradation due to
noise.
information storage can be easier in digital systems than in aalog ones. the
voice immunity of digital systems format data to be stored and retrieved without
degradation in a digital system as long as the total noise is below is a time level the
information can be recovered perfectly.
digital electronic circuits are usually made from large assemblies of logic
gates simple electronic representations of Boolean logic functions.
number is representation of a quantity by using certain symbols A quantity
of things is expressed instead of writing in words a value may be mentioned by
writing some symbols this symbol representation is must to perform various
mathematical operations addition subtraction multiplication and division this is
symbolic representation of numerical values developed many number of system.
there are mainly two types of numbering system
1. non positional numbering system
2. positional numbering system
1. non positional numbering system:
positional number system is ancient Roman number system
in this Roman system letters of converted into numerical digits as shown below
I=1; V = 5; X = 10; L = 50; C = 100; D = 50; M = 1000
Did not follow the arrangement of digits in position to express a numerical value as
in our Arabic system that is decimal system
2. positional number system
the most widely used in number system is positional number system.
in this number system the position of a digit indicates the significance to be
attached to that digit.
there are many positional number system are in practice. its term deposit one by
the other in numbers of digits available in the system.
the commonly used position number systems are
1. decimal number system
2. binary number system
3. octal number system
4. hexadecimal number system
Base or Radix:
the number of symbols that can be used in a number system is known as a base or
radix of a system
it is always one more than the highest digit of the system
1. binary number system
the number system with the base or radix 2 is known as in binary number
system
binary means two.
first in binary number system the two symbols available are 0 and 1.
The symbol 0 or 1 Is called Abbott instead of calling a binary digit.
Examples 1011, 1010, 1000 , 11110000 etc.
The Binary System is also a positional value system that in each bite it is it
has its own value or wait Express it as a power of 2.
For binary numbers that bind it is it at the extreme right is referred as and
least significant bit LSB.
in the Binder number 1001, the 1 at the right is the LSB. the left most
binary digit is called the most significant bit MSB.
the special terms used with the binary number system or explained as
follows:
1. Bit: it is an abbreviation for by and it is it it is 0 or 1
2. Nibble: it is a group of 4 bits.
3. Bite: it is a group of 8 bits.
4. computer word: it is a set of fixed number of bits wearing from 8 to
64 bits the length of computer word usually called word size or word
length
2. Octal number system
the number system with base or radix 8 is known as an octal number system
In this system 8 symbols 0, 1, 2, 3, 4, 5, 6 and 7are used to represent the
numbers Thus any octal numbers in a combination of 3 digits
Since its base 8 = 2 power 3, Repeat group of binary can be represented by
an octal digit. An octal number is ⅓ of the length of the corresponding
binary number
similar to decimal and binary number system it is also a positional number
system
3. hexadecimal number system
the number system with base or radix 16 is known as hexadecimal number
system
Number system having 16 distinct the symbols to represent the numbers
these are numericals 0 to 9 and alphabets A to F. thus any hexadecimal
number is a combination of these digits.
examples 2009, 924, 8080, 962F etc
as numbers and alphabets are used to represent the digital in hexadecimal
number system hence it is also known as Alphanumerical number system
hexadecimal number system is very popular in computer uses and more
show in microprocessor work.
4. Decimal Number system:
Decimal means 10
The number system with base or radix 10 is known as decimal number
system
Number system contains 10 different symbols. These are 0, 1, 2, 3, 4, 5, 6,
7, 8 and 9
Any decimal number is given as a combination of only ten digits.
Example: 19, 108, 2014, 143.79 etc.
Comparison of different number system

SI.N Number digits/ symbols Base/Radix


O system
1 Binary 0, 1 2
2 Octal 0, 1, 2, 3, 4, 5, 6, 7 8
3 decimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 10
4 hexadecimal 0, 1, 2, 3, 4, 5, 6, 7,8, 9, A, B, C, D, 16
E, F

Convert a given decimal number into binary, octal and hexadecimal numbers
and vice versa.
1. Decimal to binary conversion:
The given decimal number consists of both integer and fractional parts, then each
part should be converted to its equivalent binary separately.
Case - 1 : Decimal integer part:
To convert a decimal integer part to binary number, the decimal number is
successively divided by 2 and the remainders are recorded after each division until
quotient is zero.
Let us consider a decimal number say, 13.

Dividing the given decimal number 13, we get the quotient 6 and remainder 1.
The 6 is then divided by 2, giving a quotient 3 and remainder 0.
This process is carryout until the quotient becomes zero.
Note that the first remainder is the LSB and last remainder is the MSB.
The binary equivalent of the decimal number 13 = 1101
Case - 2: Decimal Fractional Part:
Let us consider a decimal fractional part 0.875
Multiplying it by 2, we get the result 1.750.
Only fractional part of the result should be multiplied by 2 to get the next binary
bit (0.75 x 2 = 1.5).
This process is carryout until we get zero.
0.875 x 2 = 1.750 with a carry of 1
0.75 x 2 = 1.50 with a carry of 1
0.5 x 2 = 1.0 with a carry of 1
Reading carries downward we get binary fraction 0.111 which is equivalent to
0.875 decimal.
NOTE: In certain cases we may not get a value of 0 after repeated multiplication
by 2. Then we shall try to end the process after a specified number of binary
places.
Eg: 2. Convert 26.10 into binary number.
Step 1: to find equivalent binary number for integer part
Covert Decimal to Binary for whole numbers

Write the Ramainders from bottom to top


2610=1101022610=110102

For Decimal Numbers


Decimal Number Answer Ineger Part
0.15 x 2 = 0.3 0
0.3 x 2 = 0.6 0
0.6 x 2 = 1.2 1
0.2 x 2 = 0.4 0
0.4 x 2 = 0.8 0
0.8 x 2 = 1.6 1
Decimal Number Answer Ineger Part
0.6 x 2 = 1.2 1
0.2 x 2 = 0.4 0
0.4 x 2 = 0.8 0
0.8 x 2 = 1.6 1
0.6 x 2 = 1.2 1
Write the Integer part from top to bottom

∴ 26.1510=11010.001001100112
1510=001001100112

Decimal to octal number system:


The conversion from decimal to octal is similar to the conversion procedure for
decimal to binary conversion.
The only difference is that power of 8 that power of 8 is used in the place of 2 for
division in the case of integers and for multiplication in the case of fractional
numbers.
Eg: 1. Convert a given decimal no. 76 to octal no. system.

Octal equivalent of decimal number 7610 = 1148


Eg2: Convert a given decimal no. 467.43 to octal no. system
Step 1:
Step 2:
Decimal Number Answer Ineger Part
0.43 x 8 = 3.44 3
0.44 x 8 = 3.52 3
0.52 x 8 = 4.16 4
0.16 x 8 = 1.28 1
0.28 x 8 = 2.24 2
Write the Integer part from top to bottom

∴ 467.4310=723.334128
4310=334128

Decimal to Hexadecimal conversion:


For conversion from decimal to hexadecimal, the procedure used in binary as well
as octal system is applicable, using 16 as the dividing factor (for integer part) and
multiplying factor (for factional part).
Eg: 1 Convert a given decimal no. 76 to hexadecimal no. system

Hexadecimal equivalent of decimal number 7610 = 4C16


Eg 2: Convert a given decimal no. 22.64 to hexadecimal no. system
Hexadecimal equivalent to decimal number 2210=1616
For Decimal Numbers
Decimal Number Answer Ineger Part Equivalent Hexvalue
0.64 x 16 = 10.24 10 A
0.24 x 16 = 3.84 3 3
0.84 x 16 = 13.44 13 D
0.44 x 16 = 7.04 7 7
0.04 x 16 = 0.64 0 0
Write the Integer part from top to bottom

∴ 22.6410=16.A3D7016
6410=A3D7016

Binary to decimal conversion:


1. Write down the number.
2. Starting with the LSB, multiply the digit by the value of the place holder.
3. Continue doing this until you reach the MSB.
4. Add the results together.
Eg: 1. Convert binary number 10011 to its decimal number.
100112=(1×24)+(0×23)+(0×22)+(1×21)+(1×20)
100112=16+0+0+2+1
100112=1910
eg: 2. Convert binary number 101010.1011 to its decimal number.
101010.10112=(1×25)+(0×24)+(1×23)+(0×22)+(1×21)+(0×20)+(1×2−1)+(0×2−2)
+(1×2−3)+(1×2−4)
101010.10112=32+0+8+0+2+0+0.5+0+0.125+0.0625
101010.10112=42+0.6875

101010.10112=42.687510
octal to decimal conversion:
Any octal no. can be converted into its equivalent decimal no. in the same manner
as the binary to decimal conversion.
The only difference is that power of 8 is used in place of 2.
Eg: 1. Convert 143.258 to its decimal equivalent.
143.258=(1×82)+(4×81)+(3×80)+(2×8−1)+(5×8−2)

143.258=64+32+3+0.25+0.078125

143.258=99+0.328125
143.258=99.32812510
Hexadecimal to decimal conversion:
Any hexadecimal no. can be converted into its equivalent decimal no. in the same
manner as the binary / octal to decimal conversion.
The only difference is that power of 16 is used instead of 2/8.
Eg: 1. Convert BED.15 to its decimal equivalent.
BED.1516=(B×162)+(E×161)+(D×160)+(1×16−1)+(5×16−2)

BED.1516=0+0+0+0.0625+0.01953125

BED.1516=0+0.08203125
BED.1516=0.0820312510
Binary to octal conversion:
Binary numbers can be converted into equivalent octal numbers by making groups
of 3-bits.
The group should be considered from the binary point towards the LSB and MSB
separately.
Eg: 1. Convert 11101.01012 to octal equivalent.
Split the binary number from left to right each group 3 bits
011 101 . 010 100
3 5 . 2 4

11101.01012=35.248
Binary to hexadecimal conversion:
Binary numbers can be converted into equivalent hexadecimal numbers by making
groups of 4-bits.
The group should be considered from the binary point towards the LSB and MSB
seperately.
Eg: 1. Convert 0.0101012into hexadecimal number.
Split the binary number from left to right each group 4 bits
0000 . 0101 0100
0 . 5 4

0.0101012=0.5416
Octal to binary conversion:
Octal number can be converted into equivalent binary numbers by replacing each
octal digit by its3-bit equivalent binary.
Eg: 1. Convert octal number 630.158to binary.
Write equivalent binary for given octal value
6 3 0 . 1 5
110 011 000 . 001 101
630.158=110011000.0011012
Hexadecimal to binary conversion:
Hexadecimal numbers can be converted into equivalent binary numbers by
replacing each hexadecimal digit by its 4-bit equivalent binary.
Eg: convert hexadecimal number 0.BF3 into binary number.
Write equivalent binary for given hexa decimal value
0 . B F 3
0000 . 1011 1111 0011
0.BF316=0000.1011111100112
Octal to hexadecimal conversion:
Convert Octal Number into Binary Number
Convert Binary Number into Hex Number
Eg: convert 615 to its hexadecimal equivalent.
Convert Octal Number into Binary Number
6 1 5
110 001 101

6158=1100011012

Convert Binary Number into Hex Number


Split the binary number from left to right each group 4 bits
0001 1000 1101
1 8 D

1100011012=18D16
Hexadecimal top octal conversion:
Convert hexadecimal Number into Binary Number
Convert Binary Number into octal Number
Eg: convert 25B16 to its octal conversion
Convert Hexa Decimal number to binary
2 5 B
0010 0101 1011

25B16=0010010110112

Convert Binary Number into Octal Number


Split the binary number from left to right each group 3 bits
001 001 011 011
1 1 3 3

0010010110112=11338
Binary Arithmetic:
Binary arithmetic is essential part of all the digital computers and many other digital
system.

Binary Addition
It is a key for binary subtraction, multiplication, division. There are four rules of binary
addition.

In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the
given column and a carry of 1 over to the next column.

Example − Addition

Binary Subtraction
Subtraction and Borrow, these two words will be used very frequently for the binary
subtraction. There are four rules of binary subtraction.
Example − Subtraction

Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There are four rules of binary
multiplication.

Example − Multiplication
Binary Division
Binary division is similar to decimal division. It is called as the long division procedure.

Example − Division

Complement Arithmetic
Complements are used in the digital computers in order to simplify the subtraction
operation and for the logical manipulations. For each radix-r system (radix r represents
base of number system) there are two types of complements.

S.N Complement Description


.

1 Radix Complement The radix complement is referred to as the r's complement

2 Diminished Radix Complement The diminished radix complement is referred to as the (r-1)'s
complement

Binary system complements


As the binary system has base r = 2. So the two types of complements for the binary
system are 2's complement and 1's complement.
1's complement
The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's.
This is called as taking complement or 1's complement. Example of 1's Complement is
as follows.

2's complement
The 2's complement of binary number is obtained by adding 1 to the Least Significant
Bit (LSB) of 1's complement of the number.
2's complement = 1's complement + 1
Example of 2's Complement is as follows.

9’s complement and 10’s complement are used to make the arithmetic operations in
digital system easier. These are used to make computational operations easier using
complement implementation and usually trade hardware usage to the program.
To obtain the 9’s complement of any number we have to subtract the number with (10 n –
1) where n = number of digits in the number, or in a simpler manner we have to subtract
each digit of the given decimal number from 9.
10’s complement, it is relatively easy to find out the 10’s complement after finding out
the 9’s complement of that number. We have to add 1 with the 9’s complement of any
number to obtain the desired 10’s complement of that number. Or if we want to find out
the 10’s complement directly, we can do it by following the following formula, (10 n –
number), where n = number of digits in the number.
Let us take a decimal number 456, 9’s complement of this number will be

999
-456
_____
543

10’s complement of this no

543
(+)1
______
544

Binary Codes
In the coding, when numbers, letters or words are represented by a specific group of
symbols, it is said that the number, letter or word is being encoded. The group of
symbols is called as a code. The digital data is represented, stored and transmitted as
group of binary bits. This group is also called as binary code. The binary code is
represented by the number as well as alphanumeric letter.

Advantages of Binary Code


Following is the list of advantages that binary code offers.
 Binary codes are suitable for the computer applications.
 Binary codes are suitable for the digital communications.
 Binary codes make the analysis and designing of digital circuits if we use the
binary codes.
 Since only 0 & 1 are being used, implementation becomes easy.

Classification of binary codes


The codes are broadly categorized into following four categories.

 Weighted Codes
 Non-Weighted Codes
 Binary Coded Decimal Code
 Alphanumeric Codes
 Error Detecting Codes
 Error Correcting Codes

Weighted Codes
Weighted binary codes are those binary codes which obey the positional weight
principle. Each position of the number represents a specific weight. Several systems of
the codes are used to express the decimal digits 0 through 9. In these codes each
decimal digit is represented by a group of four bits.

Non-Weighted Codes
In this type of binary codes, the positional weights are not assigned. The examples of
non-weighted codes are Excess-3 code and Gray code.

Excess-3 code
The Excess-3 code is also called as XS-3 code. It is non-weighted code used to
express decimal numbers. The Excess-3 code words are derived from the 8421 BCD
code words adding (0011)2 or (3)10 to each code word in 8421. The excess-3 codes
are obtained as follows −
Example

Gray Code
It is the non-weighted code and it is not arithmetic codes. That means there are no
specific weights assigned to the bit position. It has a very special feature that, only one
bit will change each time the decimal number is incremented as shown in fig. As only
one bit changes at a time, the gray code is called as a unit distance code. The gray
code is a cyclic code. Gray code cannot be used for arithmetic operation.

Application of Gray code


 Gray code is popularly used in the shaft position encoders.
 A shaft position encoder produces a code word which represents the angular
position of the shaft.
Binary Coded Decimal (BCD) code
In this code each decimal digit is represented by a 4-bit binary number. BCD is a way
to express each of the decimal digits with a binary code. In the BCD, with four bits we
can represent sixteen numbers (0000 to 1111). But in BCD code only first ten of these
are used (0000 to 1001). The remaining six code combinations i.e. 1010 to 1111 are
invalid in BCD.

Advantages of BCD Codes

 It is very similar to decimal system.


 We need to remember binary equivalent of decimal numbers 0 to 9 only.

Disadvantages of BCD Codes


 The addition and subtraction of BCD have different rules.
 The BCD arithmetic is little more complicated.
 BCD needs more number of bits than binary to represent the decimal number.
So BCD is less efficient than binary.

Alphanumeric codes
A binary digit or bit can represent only two symbols as it has only two states '0' or '1'.
But this is not enough for communication between two computers because there we
need many more symbols for communication. These symbols are required to represent
26 alphabets with capital and small letters, numbers from 0 to 9, punctuation marks
and other symbols.
The alphanumeric codes are the codes that represent numbers and alphabetic
characters. Mostly such codes also represent other characters such as symbol and
various instructions necessary for conveying information. An alphanumeric code should
at least represent 10 digits and 26 letters of alphabet i.e. total 36 items. The following
three alphanumeric codes are very commonly used for the data representation.

 American Standard Code for Information Interchange (ASCII).


 Extended Binary Coded Decimal Interchange Code (EBCDIC).
 Five bit Baudot Code.
ASCII code is a 7-bit code whereas EBCDIC is an 8-bit code. ASCII code is more
commonly used worldwide while EBCDIC is used primarily in large IBM computers.

Error Codes
There are binary code techniques available to detect and correct data during data
transmission.

Error Detection & Correction


What is Error?
Error is a condition when the output information does not match with the input
information. During transmission, digital signals suffer from noise that can introduce
errors in the binary bits travelling from one system to other. That means a 0 bit may
change to 1 or a 1 bit may change to 0.

Error-Detecting codes
Whenever a message is transmitted, it may get scrambled by noise or data may get
corrupted. To avoid this, we use error-detecting codes which are additional data added
to a given digital message to help us detect if an error occurred during transmission of
the message. A simple example of error-detecting code is parity check.

Error-Correcting codes
Along with error-detecting code, we can also pass some data to figure out the original
message from the corrupt message that we received. This type of code is called an
error-correcting code. Error-correcting codes also deploy the same strategy as error-
detecting codes but additionally, such codes also detect the exact location of the
corrupt bit.
In error-correcting codes, parity check has a simple way to detect errors along with a
sophisticated mechanism to determine the corrupt bit location. Once the corrupt bit is
located, its value is reverted (from 0 to 1 or 1 to 0) to get the original message.

How to Detect and Correct Errors?


To detect and correct the errors, additional bits are added to the data bits at the time of
transmission.
 The additional bits are called parity bits. They allow detection or correction of
the errors.
 The data bits along with the parity bits form a code word.

Parity Checking of Error Detection


It is the simplest technique for detecting and correcting errors. The MSB of an 8-bits
word is used as the parity bit and the remaining 7 bits are used as data or message
bits. The parity of 8-bits transmitted word can be either even parity or odd parity.

Even parity -- Even parity means the number of 1's in the given word including the
parity bit should be even (2,4,6,....).
Odd parity -- Odd parity means the number of 1's in the given word including the parity
bit should be odd (1,3,5,....).

Use of Parity Bit


The parity bit can be set to 0 and 1 depending on the type of the parity required.
 For even parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire
word is even. Shown in fig. (a).
 For odd parity, this bit is set to 1 or 0 such that the no. of "1 bits" in the entire
word is odd. Shown in fig. (b).
How Does Error Detection Take Place?
Parity checking at the receiver can detect the presence of an error if the parity of the
receiver signal is different from the expected parity. That means, if it is known that the
parity of the transmitted signal is always going to be "even" and if the received signal
has an odd parity, then the receiver can conclude that the received signal is not
correct. If an error is detected, then the receiver will ignore the received byte and
request for retransmission of the same byte to the transmitter.

Binary to Gray Conversion:


Step 1: Keep the MSB as it is.
Step 2: Add MSB to the next LSB.
Step 3: If there is carry neglect it.
Step 4: Write the sum as next bit in gray code.
Step 5: Continue this till LSB is reached.
Eg: Convert the binary number 10110 to gray code.
Step 1: 1 0 1 1 0
Step 2: 1 1+0
Step 3: 1 1 0+1
Step 4: 1 1 1 1+1
Step 5: 1 1 1 0 1+0
Step 6: 1 1 1 0 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy