Digital electronics & microprocessor Batu- s y computer engineering- arvind pande
406 views
70 slides
Aug 19, 2020
Slide 1 of 70
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
About This Presentation
Unit-1 Digital signals, digital circuits, AND, OR, NOT, NAND, NOR and Exclusive-OR operations, Boolean algebra, examples of IC gates,
Number Systems: binary, signed binary, octal hexadecimal number, binary arithmetic, one’s and two’s complements arithmetic, codes, error detecting and correcting...
Unit-1 Digital signals, digital circuits, AND, OR, NOT, NAND, NOR and Exclusive-OR operations, Boolean algebra, examples of IC gates,
Number Systems: binary, signed binary, octal hexadecimal number, binary arithmetic, one’s and two’s complements arithmetic, codes, error detecting and correcting codes.
Size: 882.36 KB
Language: en
Added: Aug 19, 2020
Slides: 70 pages
Slide Content
Digital Electronics &
Microprocessor
BTCOC305
Unit 1
Digital signals, digital circuits, AND, OR, NOT, NAND, NOR and Exclusive-OR
operations, Boolean algebra, examples of IC gates,
Number Systems: binary, signed binary, octal hexadecimal number, binary
arithmetic, one’s and two’s complements arithmetic, codes, error detecting and
correcting codes.
Digital signals
Basically there are two kinds of signals: digital and analog.
A signal that is represented in a discrete manner is called as a digital signal.
At any given time it can only take on one of a finite number of values.
for computer processing - It is described as using binary (0s and 1s). It cannot take on any fractional
values.
Digital signals
Digital signal are commonly referred to as square waves or clock.
Their minimum value must be 0 volts, and their maximum value must be 5
volts.
They can be periodic (repeating) or non-periodic.
The time the signal is high (th) can vary anywhere from 1% of the period to
99% of the period.
Digital Circuits
A digital circuit is a circuit where the signal must be one of two discrete
levels.
Each level is interpreted as one of two different states (for example, on/off,
0/1, true/false).
Digital circuits use transistors to create logic gates in order to perform
Boolean logic.
Digital circuits
Digital logic circuits are often known as switching circuits, because in digital
circuits the voltage levels are assumed to be switched from one value to
another value instantaneously.
These circuits are termed as logic circuits, as their operation obeys a
definite set of logic rules.
It is a electrical circuits which uses only digital signals for operations.
Logic Gates
A logic gate can be defined as digital circuit which either
allows a signal to pass through or stops it. These gates are
related to Boolean Algebra.
These gates allow signals to pass through them only when
some logic is satisfied.
Logic Gates
A semiconductor diode (P-N junction) acts as a closed switch when
it is forward biased, i.e. it allows current to pass through it.
It acts as an open circuit when it is reversed biased, i.e. it allows
very little or no current to pass through it.
This unique property of diode is employed in the design of logic
gates and the circuits.
Logic Gates
●NOT
●AND
●OR
●NAND
●NOR
●XOR
NOT Gates (inverter)
Logic Symbol
Output Y is TRUE if input A is
FALSE, else it is FALSE.
Y is the inverse of A.
OR Gate
Logic Symbol
Output Y is TRUE ,
if input A OR B is TRUE,
else it is FALSE.
AND Gate
Logic Symbol
Output Y is TRUE ,
if input A AND B is TRUE,
else it is FALSE.
NAND Gate
Logic Symbol
Output Y is FALSE
if inputs A NAND B are TRUE,
else it is TRUE.
XOR Gate
XOR gate is a digital logic gate that
gives a true output when the number of
true inputs is odd.
An XOR gate implements an exclusive
or;
it gives a true output if one, and only
one, of the inputs to the gate is true.
If both inputs are false or both are true,
output results false
Exclusive OR Gate
Boolean Algebra
Boolean Algebra is the mathematics which used to analyse digital gates and circuits.
Boolean Algebra Expressions can be used to construct digital logic truth tables for
their respective functions
We can use Laws of Boolean to both reduce and simplify a complex Boolean expression
in an attempt to reduce the number of logic gates required.
Laws of Boolean Algebra -
Commutative Law -allowing a change in position for addition and
multiplication,
Associative Law -allowing the removal of brackets for addition and
multiplication
Distributive Law -allowing the factoring of an expression, are the same as in
ordinary algebra.
Commutative Law
The order of application of two separate terms is not important
A . B = B . A The order in which two variables are AND makes no
difference
A + B = B + A The order in which two variables are OR makes no
difference
Associative Law
This law allows the removal of brackets from an expression and regrouping of the
variables.
A + (B + C) = (A + B) + C = A + B + C (OR Associate Law)
A(B.C) = (A.B)C = A . B . C (AND Associate Law)
Distributive Law
This law permits the multiplying or factoring out of an expression.
A(B + C) = A.B + A.C (OR Distributive Law)
A + (B.C) = (A + B).(A + C) (AND Distributive Law)
Number System
Digital circuits process signals that contain just two voltage
levels or states, labelled, Logic “0” and Logic “1”.
there are only two valid Boolean values for representing
either a logic “1” or a logic “0”, called as Binary Numbers
It is ideal for use in digital or electronic circuits and systems.
Number System
Digital circuits process signals that contain just two voltage
levels or states, labelled, Logic “0” and Logic “1”.
Binary Numbers : there are only two valid Boolean values
for representing either a logic “1” or a logic “0”,
It is ideal for use in digital or electronic circuits and systems.
Value of Binary bit positions
Largest & smallest value for a binary
The largest value for a binary number with a specific number of bits (i.e.
digits) is when all of the bits are one.
General rule: for a binary number with n bits, the largest possible value is :
2
n
- 1
n= number of digits
Smallest value : 0
signed binary
When a fixed binary number is used to hold positive values, it is considered as unsigned.
In this case, the range of positive values that can be represented is from 0 – 2
n
-1, where n
is the number of bits being used.
It is also possible to represent signed (negative as well as positive) numbers in binary.
signed numbers in binary, can be represented by three ways
1.Signed magnitude
2.1’s complement
3.2’s complement
signed magnitude
The leftmost bit is the sign bit (0 is + and 1 is - ) and the remaining bits
hold the absolute magnitude of the number
-15 = 1 0 0 0 1 1 1 1
15 = 0 0 0 0 1 1 1 1
One’s Complement
One’s Complement or 1’s Complement as it is also termed, is another method which we can use to
represent negative binary numbers in a signed binary number system.
The one’s complement of a negative binary number is the complement of its positive counterpart, so to
take the one’s complement of a binary number.
Change each bit in turn. Thus the one’s complement of “1” is “0” and vice versa,
the one’s complement of 10010100
01101011
as all the 1’s are changed to 0’s and the 0’s to 1’s.
2’s complement method
2’s complement method of representation is
used because it reduces the complexity of the
hardware in the ALU (arithmetic-logic unit) of a
computer’s CPU.
all of the arithmetic operations can be
performed by the same hardware whether the
numbers are considered to be unsigned or
signed.
Binary to Decimal
Convert (1011001)2 to decimal
Binary to Decimal
Convert (10101)2 to decimal
Binary to Decimal
Convert (11011.101)2 to decimal
Decimal to Binary Conversion - double-dabble method
In this method, the decimal integer number is converted
to binary integer number by successive division by 2, and
the decimal fraction is converted to binary fraction by
successive multiplication by 2.
Decimal to Binary Conversion - double-dabble method
In this method,
●The given decimal integer number
is successively divided by 2 till the
quotient is zero.
●The last remainder is the MSB.
●The remainders read from bottom
to top give the equivalent binary
integer number.
Convert (52)10 to binary
(52)10 = (110100)2
Decimal fraction number to binary
In the successive multiplication by-2 method,
●Multiply the given fraction by 2.
●Keep the integer in the product as it is
and multiply the new fraction in the
product by 2.
●Continue this process and read the
integers in the products from top to
bottom.
●Thus, the integers read from top to
bottom give the equivalent binary
fraction.
Convert (0.75)10 to binary
(0.75)10 = (0.11)2
Decimal fraction number to binary
Convert (105.15)10 to binary
(105.15)10 = (1101001.001001)2
Octal numeral system
Octal Numbering System is that there are only 8 distinct counting digits
from 0 to 7
As the base of an Octal Numbers system is 8 (base-8), which also represents
the number of individual numbers used in the system, the subscript 8 is used
to identify a number expressed in octal.
For example, an octal number is expressed as: 2378
Decimal to Octal Number
decimal to octal, we divide the number by 8 and write the remainders in the reverse order
to get the equivalent octal number.
Decimal 239 is 354 Octal
Binary to Octal Number
Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from
the right).
Hexadecimal number system
hexadecimal number system, the numbers are represented
with base 16. It is also pronounced sometimes as 'hex'.
there are 16 digits in hexadecimal numbers, represented
from 0 to 9 same like decimals, but after that,
it starts with an alphabetical representation of preceding
numbers such as A, B, C, D and E.
Decimal to HexaDecimal Number Conversion
Firstly divide the number by 16.
●Take the quotient and divide again by 16,
●The remainder left will produce the hex value.
●Repeats the steps until the quotient has become 0.
242 decimal is F2 hexadecimal
HexaDecimal to Decimal Number Conversion
HexaDecimal to Binary Number Conversion
Convert (4BAC)16 to binary
HexaDecimal to Binary Number Conversion
Convert (3A9E.B0D)16 to binary
HexaDecimal to Binary Number Conversion
Convert (A0F9.0EB)16 to binary
Binary arithmetic
Binary arithmetic is essential part
of all the digital computers and
many other digital system.
Operation of a simple adder
requires two data inputs
producing two outputs, the Sum
(S) of the equation and a Carry (C)
bit
Binary Addition
9
11
----
20
Binary Addition
Binary Subtraction
Computers have trouble performing subtractions so
the following rule should be employed:
X – X is the same as X + -X”
This is where two’s complement is used.
Binary Subtraction
RULES .
●Convert the number to binary.
●Perform two’s complement on the second
number.
●Add both numbers together.
Binary Subtraction
Convert 12 - 8 using two’s complement.
Convert to binary
12 = 00001100
8 = 00001000
Perform one’s complement on the 8 : 00001000 is 11110111
Error detecting and correcting codes.
In digital systems, the analog signals will change into digital
sequence (in the form of bits). This sequence of bits is called as
“Data stream”.
The change in position of single bit also leads to major error in
data output.
we find errors and we use error detection and correction
techniques to get the exact or approximate output.
Error detecting and correcting codes.
The data can be corrupted during transmission (from source to receiver).
It may be affected by external noise or some other physical imperfections. In
this case, the input data is not same as the received output data.
This mismatched data is called “Error”.
Error detecting and correcting codes.
The data errors will cause loss of important / secured data.
Even one bit of change in data may affect the whole system’s
performance.
Generally the data transfer in digital systems will be in the form of ‘Bit
– transfer’.
In this case, the data error is likely to be changed in positions of 0
and 1
Types Of Errors
In a data sequence, if 1 is changed to zero or 0 is changed to 1, it is called “Bit
error”.
There are generally 3 types of errors occur in data transmission from transmitter
to receiver. They are
• Single bit errors
• Multiple bit errors
• Burst errors
Error detecting and correcting codes.
Single Bit Data Errors
The change in one bit in the whole
data sequence , is called “Single bit
error”.
This type of error occurs only in
parallel communication system, as
data is transferred bit wise in single
line, there is chance that single line
to be noisy.
Multiple Bit Data Errors
If there is change in two or more
bits of data sequence of
transmitter to receiver, it is called
“Multiple bit error”.
This type of error occurs in both
serial type and parallel type data
communication networks.
Burst Errors
The change of set of bits in
data sequence is called
“Burst error”.
The burst error is calculated
in from the first bit change to
last bit change.
Error Detecting Codes
In digital communication system errors are transferred from one
communication system to another, along with the data.
If these errors are not detected and corrected, data will be lost .
For effective communication, data should be transferred with high
accuracy .This can be achieved by first detecting the errors
and then correcting them.
Error Detecting Codes
Error correction codes are generated by using the
specific algorithm used for removing and detecting
errors from the message transmitted over the noisy
channels.
The error-correcting codes find the correct number of
corrupted bits and their positions in the message.
Parity Checking
Parity bit means nothing but an additional bit added to the data at the
transmitter before transmitting the data.
Before adding the parity bit, number of 1’s or zeros is calculated in the
data.
Based on this calculation of data an extra bit is added to the actual
information / data.
The addition of parity bit to the data will result in the change of data
string size.
Parity Checking
Even Parity
●If the data has even number of 1’s, the parity bit is 0. Ex: data is 10000001 ->
parity bit 0
●Odd number of 1’s, the parity bit is 1. Ex: data is 10010001 -> parity bit 1
Odd Parity
●If the data has odd number of 1’s, the parity bit is 0. Ex: data is 10011101 ->
parity bit 0
●Even number of 1’s, the parity bit is 1. Ex: data is 10010101 -> parity bit 1
Cyclic Redundancy Check (CRC)
A cyclic code is a linear (n, k) block code with the property that every cyclic
shift of a codeword results in another code word.
Here k indicates the length of the message at transmitter (the number of
information bits).
n is the total length of the message after adding check bits. (actual data and
the check bits).
n, k is the number of check bits.
Longitudinal Redundancy Check (LRC)
LRC generally applies to a single parity bit per bit stream.
LRC fields consist of one byte containing an eight bit binary value.
LRC values are calculated by transmitting devices, which append
LRC to messages.
Longitudinal Redundancy Check (LRC)
The device at the receiving end recalculates the LRC on receipt
of the message and compares the calculated value to the actual
value received in the LRC field.
If the values are equal, the transmission was successful; if the
values are not equal, this indicates an error.
Error Detection by Checksums
This is a block code method where a checksum is created based
on the data values in the data blocks to be transmitted using
some algorithm and appended to the data.
When the receiver gets this data, a new checksum is calculated
and compared with the existing checksum.
A non-match indicates an error.
Error Detection by Checksums
Sender’s End − The sender adds the frame using 1’s complement
arithmetic to get the sum. It then complements the sum to get the
checksum and sends it along with the data frames.
Receiver’s End − The receiver adds the incoming frame along with the
checksum using 1’s complement arithmetic to get the sum and then
complements it.