Professional Documents
Culture Documents
DLD Unit1
DLD Unit1
Session -1
Digital System has a prominent role in everyday life that we refer to the present
technological period as the digital age. Digital System are used in communication, business
transactions, traffic control, space guidance , medical treatment, weathermonitoring, the
Internet, and many other commercial, industrial, and scientific enterprises. We have digital
telephones, digital television, digital versatile discs, digital cameras, handheld devices and of
course digital computers.
Users can specify and change the program, a sequence of instructions, or the data
according to the specific need.General purpose digital computers can perform a variety of
information processing tasks that range over a wide spectrum of applications.
What is Digital?
Logic Design:
Deals with the basic concepts and tools used to design digital hardware consisting of logic
circuits Circuits to perform arithmetic operations (+, -, x, ÷)
Digital Signal : Decimal values are difficult to represent in electrical systems. It is easier to
use two voltage values than ten.
Digital values are in a binary format. Binary means 2 states.A good example of binary is a
light (only on or off).
George Boole who developed Mathematical Analysis of Logic (1847) and an Investigation of
Laws of Thoughts; Mathematical Theories of Logic and Probabilities (1854)
Claude Shannon: Rediscovered the Boole“A Symbolic Analysis of Relay and Switching
Circuits “. Boolean Logic and Boolean Algebra were Applied to Digital Circuitry.Beginning of
the Digital Age and/or Computer AgeWorld War II.Computers as Calculating
MachinesArlington (State Machines) “ Control “. There are 2 types of computer 1) General
purposes 2) Many scientific, industrial and commercial applications
Digital systems can be Telephone switching exchanges Digital camera Electronic calculators,
PDA's Digital TV
ANALOG Vs DIGITAL
To learn and understand about the digital logic design ,the initial knowledge we require
is to differentiate between analog and digital. The following are the difference between
analog and digital.
Analog Digital
Converts analog waveforms into set of
Analog technology records numbers and records them. The numbers
Technology:
waveforms as they are. are converted into voltage stream for
representation.
Can be used in various computing
platforms and under operating
Uses: Computing and electronics
systems like Linux, Unix, Mac OS and
Windows.
Analog signal is a continuous signal
which transmits information as a Digital signals are discrete time signals
Signal:
response to changes in physical generated by digital modulation.
phenomenon.
Uses continuous range of values to Uses discrete or discontinuous values to
Representation:
represent information. represent information.
Memory unit: not required required
applications: Thermometer PCs, PDAs
Data
not of high quality high quality
transmissions:
Result: not very accurate accurate
Storage
limited high
capacity:
processed using OPAMP which uses using microprocessor which uses logic
Process:
electronic circuits circuits
Respose to More likely to get affected reducing Less affected since noise response are
Noise: accuracy analog in nature
Waves: Denoted by sine waves Denoted by square waves
Example: human voice in air electronic devices
DIGITAL SYSTEMS
Digital computer is the best-known exampleof a digital system.A digital system manipulates
discreteelements of information.Discrete elements like electric impulses, decimaldigits,
letters of an alphabet, any other set ofmeaningful symbols.
Storage or
Memory unit
Above block diagram of digital computer has 5 units. Memory unit stores the input, output
and intermediate data. The Processor unit processes all arithmetic and data processing tasks
as specified by programs. The Control unit supervises to flow of information between the
various units. The control unit retrieves the instructions, one by one from the program
which is stored in memory .The control unit supervises the program instructions, and the
processor manipulates the data as specified by the program.
Session -2
BINARY NUMBER
Binary describes a numbering scheme in which there are only two possible values for each
digit0 and 1. The term binary refers to any digitalencoding/decodingsystem in which there
are exactly two possible states. In digital data memory, storage, processing, and
communications, the 0 and 1 values are sometimes called "low" and "high," respectively.
The binary number system is a numbering system that represents numeric values
using two unique digits (0 and 1). Most of the computing devices use binary
numbering to represent electronic circuit voltage state, (i.e., on/off switch), which
considers 0 voltage input as off and 1 input as on.
(11010.11)2 = (26.75)10
3) Base-5 number(4021.2)5
=4*53+0*52+2*51+1*50= (511.5)10
=(87.5)10
5) Base -16(B65F)16
OCTAL NUMBERS
The Octal Number System is another type of computer and digital base number system.
TheOctal Numbering System is very similar in principle to the previous hexadecimal
numbering system except that in Octal, a binary number is divided up into groups of only
3 bits, with each group or set of bits having a distinct value of between 000 (0) and 111 ( 7
). Octal numbers therefore have a range of just “8” digits, (0, 1, 2, 3, 4, 5, 6, 7) making
them a Base-8 numbering system and therefore, q is equal to “8”.
The “Hexadecimal” or simply “Hex” numbering system uses theBase of 16 system and are
a popular choice for representing long binary values because their format is quite
compact and much easier to understand compared to the long binary strings of 1‟s and
0‟s.
Being a Base-16 system, the hexadecimal numbering system therefore uses 16 (sixteen)
different digits with a combination of numbers from 0 through to 15. In other words,
there are 16 possible digit symbols.
20/2= 10 =0 a 1=0
10/2=5 =0 a2=0
5/2=2 =1 a 3=1
2/2=1 =0 a 4=0
1/2=0 =1 a 5=1
(41)10=(a5a4a3a2a1a0)=(101001)2
First, 0.6875 is multiplied by 2 to give an integer and a fraction. The new fraction is
multiplied by 2 to give a new integer and a new fraction. This process is continued untilthe
fractional part equals 0 or until there are enough digits to give sufficient accuracy. The
coefficients of the binary number are obtained from the integers as follows:
The process of multiplying fractions by rdoes not necessarily end with zero, so we must
decide how many digits ofthe fraction to use from the conversion. Also, remember that the
multiplicationsare by number r.
Octal and Hexadecimal Numbers:The conversion from and to binary, octal, and
hexadecimal plays importantrole in digital computers. Since 23= 8 and 24= 16, each octal
digit corresponds to three binary digits and each hexadecimal digit corresponds to four
binary digit.
(10 110 001 101 011 .111 100 000 110)2= (26153.7406)8
26153 7406
The conversion from binary to octal is easily accomplished by partitioning the binary
number into groups of three digits each, starting fromthe binary point and proceeding to
the left and to the right.
Conversion from binary to hexadecimal is similar except that the binary number is divided
into groups of&, digits (101100 01101011 . 11110010)2
Conversion from octal or hexadecimal to binary is done by procedure reverse to the above.
Each octal digit is converted to its three-digit binary equivalent. Similarly, each hexadecimal
digit is converted to its four-digit binary equivalent.
Ex:-1 . (673.124)8=(110 111 011 .001 010=(110111011.00101)2
2. 306.D16 =0011 00000110 .1101 2
3 0 6 D
Similar to decimal number addition, two binary numbers are added by adding each pair of
bits together with carry propagation.
ARITHMETIC OPERATIONS
Arithmetic operations with numbers in base r follow the same rules as for decimal
numbers. However, when a base other than the familiar base 10 is used, one must
be careful to use only r allowable digits and perform all computations with base r
digits
The sum of two binary numbers is calculated following the same rules as for
decimalnumbers, except that the sum digit in any position can be only 1 or 0. Also, acarry in
binary occurs if the sum in any bit position is greater than 1. (A carry indecimal occurs if the
sum in any digit position is greater than 9.) Any carryobtained in a given position is added to
the bits in the column one significant positionhigher. In the first example, since all of the
carries are 0, the sum bits are simplythe sum of the augend and addend bits. In the second
example, the sum of thebits in the second column from the right is 2, giving a sum bit of 0
and a carry bit of 1 (2 = 2+ 0). The carry bit is added with the 1s in the third position, giving a
sumof 3, which produces a sum bit of 1 and a carry of 1 (3 = 2+ 1).
The following are examples of the subtraction of two binary numbers; as withaddition, note
the names of the operands:
0-0 =0, 1-0= 1, 1-1=0, 0-1=1 and borrow 1 bit from next significant digit
Subtraction
Minuend: 101101
Subtrahend: - 100111
Difference: 000110
0 * 0 = 0, 1 *0 = 0, 0 *1 = 0, 1* 1 = 1
Multiplicand 1011
Multiplier *101
0000+
1011++
Product 110111
Session 3
Complements of Numbers :There are two types of complements for each base-r system:
the radix complement anddiminished radix complement.The r's complement and the
second as the (r -1)'s complement.
For binary numbers, r = 2 and r –1 = 1, so the 1's complement of N is (2n -1) –N.
Radix Complement
The r's complement of an n-digit number N in base r is defined as rn –N for N ≠ 0and as 0 for
N = 0. Comparing with the (r -1) 's complement, we note that the r'scomplement is obtained
by adding 1 to the (r -1) 's complement, since rn –N = [(rn-1) –N] + 1.
Base-10 :
Base-2 :
The subtraction of two n-digit unsigned numbers M –N in base r can be done as follows:
3. Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction
(a)X –Y and (b) Y -X by using 2's complement.
There is no end carry. Therefore, the answer isY –X = -(2's complement of 1101111) = -
0010001.Subtraction of unsigned numbers can also be done by means of the (r-
1)'scomplement. Remember that the (r-1) 's complement is one less then the
r'scomplement.
There is no end carry, Therefore, the answer isY –X = -(1's complementof 1101110) = -
0010001.
So to represent a positive (N) and anegative (-N) binary number we can use the
binary numbers with sign. For signed binary numbers the most significant bit (MSB) is used
as the sign. If the sign bit is “0”, this means the number is positive.
If the sign bit is “1”, then the number is negative. The remaining bits are used to
represent the magnitude of the binary number in the usual unsigned binary number
format. Positive Signed Binary Numbers
Magnititude bits
1 0 1 1 0 1 0 1 = -53
lists all possible four-bit signed binary numbers in the three representations.
Arithmetic Addition
The addition of two numbers in the signed-magnitude system follows the rules
ofordinary arithmetic. If the signs are the same, we add the two magnitudes and
givethe sum the common sign. If the signs are different, we subtract the smaller
magnitude from the larger and give the difference the sign if the larger magnitude.
The addition of two signed binary numbers with negative numbers represented in
signed-2's-complement form is obtained from the addition of the two numbers,
including their sign bits.
A carry out of the sign-bit position is discarded.
Session 5
Binary Codes :The digital data is represented, stored and transmitted as group of binary
bits. This group is also called asbinary code .The binary code is represented by the
number as well as alphanumericletter.
An n-bitbinary code can have up to 2n distinct combinations of 1’s and 0’s, with
eachcombination representing one element of the information set that is being coded. A set
of four elements can be coded with two bits: 00, 01, 10, 11.
• A set of eight elements requires a 3bitcode and a set of 16 elements requires a 4bitcode.
The bit combination of an n-bit code is the count in binary from 0 to
2n- 1.
• Each element must be assigned a unique binary bit combination, and no two elementscan
have the same value otherwise, the code assignment will be ambiguous.
Session 6
BCD Addition
The addition of two decimal digits in BCD. Since each digit does not exceed 9 the sum
cannot be greater than 9 + 9 + 1 = 19, with the 1 being a previous carry. Add the BCD digits
the ranges from 0000 to 10011
Decimal Arithmetic
The representation of signed decimal numbers in BCD is similar to the representation of
signed numbers in binary.Four 0’s and a minus with the BCD equivalent of 9, which is 1001.
The signed‐complement system can be either the 9’s or the 10’s complement, but the 10’s
complement is used. To obtain the 10’s complement of a BCD number, take the 9’s
complement and then add 1 to the least significant digit. The 9’s complement is calculated
from the subtraction of each digit from 9. Addition is done by summing all digits, including
the sign digit, and discarding the end carry.
Session 7
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 –
Session 8
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.
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.Decimal 396 is represented in BCD with 12
bits as 0011 1001 0110, with each group of4 bits representing one decimal digit.
Advantages of BCD Codes
It is very similar to decimal system.
We need to remember binary equivalent of decimal numbers 0 to 9 only.
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.
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.The
graphic characters consist of the 26 uppercase letters (A through Z), the 26lowercase letters
(a through z), the 10 numerals (0 through 9), and 32 special printablecharacters, such as %,
*, and $.
Error Codes
There are binary code techniques available to detect and correct data during data
transmission.. These codes are additional bits of data, known as parity bits, used at the time
of message transmission, allowing users to determine the existence of any kind of error.
Parity bits, coupled with data bits, come together to form a code word.
Errors Codes for Detection: During the transmission of a message, there is a chance
that it may get scrambled by noise, resulting in corrupted data. In order to prevent
this from happening, error-detecting codes are designed that are in the form of
additional data packages attached along with a digital message. This helps in
detecting whether the transmission of a message was interrupted or corrupted due
to an error. One common method of error-detection code is parity check.
Error Codes for Correction: To streamline the process, error-correcting codes are
used along with error-detecting code to figure out what the original message was
before it got corrupted. These codes are deployed in the same way as the error
codes for detection. The best part is that they are also capable of detecting the exact
location of the corrupted bit of the data.
Ex: Consider the following two characters and their even and odd parity:
Ex:2) 937.25 is represented by
9 3 7 . 2 5
(937.25)=(100100110111.00100101)BCD
2.Consider the following two characters and their even and odd parity
Sol: Divide the BCD number into four-bit groups and convert each to decimal
6 8 3 9
0110100000111001(BCD)= 683910
Session 9
Binary logic: Binary logic consists of binary variables and a set of logical operations. The
variables are designated by letters of the alphabet, such as A, B, C, x, y, z, etc,with each
variable having two and only two distinct possible values: 1 and 0.There are three basic
logical operations: AND, OR, and NOT
Basic Logic Gates:Graphic Symbols and Input-Output Signals for Logic gates
Bibilography