Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Digital Logic Design

1- Binary codes
2- Error Detection
3- Binary Logic

National University of Modern Languages


Faculty of Engineering & Computer Science

Course Instructor: Dr. Sheraz Alam Khan


sheraz.alam@gmail.com

1
1-6 Binary Codes
• A bit, by definition, is a binary digit. When used in conjunction with
a binary code, it is better to think of it as denoting a binary quantity
equal to 0 or 1.
• To represent a group of 2n distinct elements in a binary code
requires a minimum of n bits. This is because it is possible to
arrange n bits in 2n distinct ways.
• For example, a group of four distinct quantities can be represented
by a two-bit code, with each quantity assigned one of the following
bit combinations: 00, 01, 10, 11. A group of eight elements requires
a three-bit code, with each element assigned to one and only one of
the following: 000, 001, 010, 011, 100, 101, 110, 111.
• The examples show that the distinct bit combinations of an n-bit
code can be found by counting in binary from 0 to (2n - 1).
2
Decimal codes

3
Difference b/w Binary conversion and Binary Coding
• It is very important to understand the difference between
conversion of a decimal number to binary and the binary coding of
a decimal number. In each case the final result is a series of bits.
• The bits obtained from conversion are binary digits. Bits obtained
from coding are combinations of l’s and 0’s arranged according to
the rules of the code used.
• The BCD code, for example, has been chosen to be both a code and
a direct binary conversion, as long as the decimal numbers are
integers from 0 to 9. For numbers greater than 9, the conversion
and the coding are completely different. This concept is so
important that it is worth repeating with another example. The
binary conversion of decimal 13 is 1101; the coding of decimal 13
with BCD is 00010011. 4
Self-complimentary codes
• From the five binary codes listed in Table 1-2, the BCD seems the most
natural to use and is indeed the one most commonly encountered. The
other four-bit codes listed have one characteristic in common that is not
found in BCD.
• The excess-3, the 2, 4, 2, 1, and the 8, 4, – 2, – 1 are self-complementary
codes, that is, the 9’s complement of the decimal number is easily obtained
by changing l’s to 0’s and 0’s to l’s. For example, the decimal 395 is
represented in the 2, 4, 2, 1 code by 001111111011. Its 9’s complement 604
is represented by 110000000100, which is easily obtained from the
replacement of l’s by 0’s and 0’s by l’s.
• This property is useful when arithmetic operations are internally done with
decimal numbers (in a binary code) and subtraction is calculated by means
of 9’s complement.
5
Bi-quinary Code
• The biquinary code shown in Table 1-2 is an example of a seven-
bit code with error-detection properties. Each decimal digit
consists of five 0’s and two l’s placed in the corresponding
weighted columns. The error-detection property of this code
may be understood if one realizes that digital systems represent
binary 1 by one distinct signal and binary 0 by a second distinct
signal.
• During transmission of signals from one location to another, an
error may occur. One or more bits may change value. A circuit in
the receiving side can detect the presence of more (or less)
than two l’s and, if the received combination of bits does not
agree with the allowable combination, an error is detected. 6
Error-Detection Codes
• Binary information, be it pulse-modulated signals or digital computer input or
output, may be transmitted through some form of communication medium
such as wires or radio waves. Any external noise introduced into a physical
communication medium changes bit values from 0 to 1 or vice versa.
• An error-detection code can be used to detect errors during transmission. The
detected error cannot be corrected, but its presence is indicated. The usual
procedure is to observe the frequency of errors. If errors occur only once in a
while, at random, and without a pronounced effect on the overall information
transmitted, then either nothing is done or the particular erroneous message
is transmitted again. If errors occur so often as to distort the meaning of the
received information, the system is checked for malfunction.
• A parity bit is an extra bit included with a message to make the total number
of l’s either odd or even. A message of four bits and a parity bit, P, are shown
in Table 1-3
7
8
The Reflected Code or Gray code

The advantage of the reflected code


over pure binary numbers is that a
number in the reflected code changes
by only one bit as it proceeds from one
number to the next.

• Communication
• K-MAP (Chapter 3)

9
Alphanumeric Codes
• An alphanumeric (sometimes abbreviated
alphameric) code is a binary code of a group of
elements consisting of the ten decimal digits,
the 26 letters of the alphabet, and a certain
number of special symbols such as $.
• The total number of elements in an
alphanumeric group is greater than 36.
Therefore, it must be coded with a minimum
of six bits (26 = 64, but 25 = 32 is insufficient).
• Many applications of digital computers require
the handling of data that consist not only of
num- bers, but also of letters. For instance, an
insurance company with millions of policy
holders may use a digital computer to process
its files
10
Binary Storage and Registers
Binary Cell:
• It is a device which can store one bit of information. On or OFF.
e.g. Flip flops.
Registers:
• Group of binary cells. n size of bits are used.
e.g. If 8 bits are used, (meaning there are 8 binary cells in a register)
then this means, 28 = 256 combinations can be stored in a register.
Consider, for example, the following 16-cell register:

11
Binary Logic
It consists of binary variables and logical operations.
• AND (multiply)
• OR (add)
• Not (Compliment)

12
Switching Circuits and Binary Signals

13
Logic Gates

14
Integrated Circuits
• Digital circuits are invariably constructed with integrated circuits. An
integrated circuit (abbreviated IC) is a small silicon semiconductor
crystal, called a chip, containing electrical components such as
transistors, diodes, resistors, and capacitors.
• The various components are interconnected inside the chip to form
an electronic circuit. The chip is mounted on a metal or plastic
package, and connections are welded to external pins to form the
IC.
• Integrated circuits differ from other electronic circuits composed of
detachable components in that individual components in the IC
cannot be separated or disconnected and the circuit inside the
package is accessible only through the external pins.
15
Integrated Circuits: Packages
• Integrated circuits come in two types of packages, the flat package and the
dual-in-line (DIP) package, as shown in Fig. 1-8. The dual-in-line package is the
most widely used type be- cause of the low price and easy installation on
circuit boards. The envelope of the IC package is made of plastic or ceramic.
Most packages have standard sizes, and the number of pins ranges from 8 to
64. Each IC has a numeric designation printed on the surface of the package
for identification. Each vendor publishes a data book or catalog that provides
the necessary information concerning the various products.

16
Integrated Circuits: Size and other benefits
• The size of IC packages is very small. For example, four AND gates are
enclosed inside a 14-pin dual-in-line package with dimensions of 20 × 8 × 3
millimeters. An entire microprocessor is enclosed within a 40-pin dual-in-line
package with dimensions of 50 × 15 × 4 millimeters.
• Besides a substantial reduction in size, ICs offer other advantages and benefits
compared to electronic circuits with discrete components. The cost of ICs is
very low, which makes them economical to use. Their reduced power
consumption makes the digital system more economical to operate. They
have a high reliability against failure, so the digital system needs less repairs.
The operating speed is higher, which makes them suitable for high-speed
operations. The use of ICs reduces the number of external wiring connections
because many of the connections are internal to the package. Because of all
these advantages, digital systems are always constructed with integrated
circuits
17
Questions are guaranteed in
Life…………….Answers are not!

18

You might also like