Ade (Unit 1)
Ade (Unit 1)
Ade (Unit 1)
and
Digital Electronics
Courtesy: R. P. Jain
(Modern Digital Electronics)
Topics To Be Covered
Unit-4: Counters.
Unit-I
Courtesy: R. P. Jain
(Modern Digital Electronics)
Bits, Bytes, Nybbles
The most important base you need to know for computer
organization is base 2. We also call this binary, since binary
means two valued.
2. Amplification 2. Switching
3. Voltages 3. Numbers
Number System
Note: The 1’s complement of a binary number is the number that results
when we change all 1’s to 0’s & the 0’s to 1’s.
1’s Complement Representation
Steps:
1. Find 1’s complements of Subtrahend.
2. Add two nos. using binary addition.
3. Check carry if carry is generated, add the carry in LSB position.
4. If MSB is 1 then the result is negative & it is in 1’s Complement form.
5. If MSB is 0 then the result is positive & is true form.
E.g.
1. 8 – 9 = -1
step 1: 8= 1000
9= 1001 1’s complement of 9 is = 0110
step2: 1000 8
+ 0110 1’s complement of 9
------------------------
1110
step3: The MSB is 1, so the result is negative & in 1’s complement
form. So result is = -(0001) = -1
2. 9 – 8 = 1 Ans. (0001) = 1.
Advantages of 1’s Complement
1. The 1’s complement subtraction can be accomplished with an
binary adder, therefore this method is useful in arithmetic logic
circuits.
2. The 1’s complement of a number is easily obtained by inverting
each bit in the number.
Binary Arithmetic
Binary Addition: Rules for binary addition are as follows:
Augend Addend Sum Carry Result
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 0 1 10
If final carry is 0, the answer is –ve (the minuend is smaller than the
subtrahend) and is in 2’s complement form.
2’s Complement Representation
If 1 is added to 1’s complement of a binary number, the resulting
number is known as the two’s complement of the binary number.
E.g. 2’s complement of 0101 is 1011.
In this representation also if MSB is 0 the number is positive,
whereas if the MSB is 1 the number is negative.
Steps:
1. Find 2’s complement of a subtrahend.
2. Add two nos. using binary addition.
3. Check carry, if carry is generated, discard the carry. If MSB is 1
then the answer is negative & it is in 2’s complement form. If MSB
is 0, then the result is positive & in true form.
4. E.g. 8-9 = -1
step 1 : 8 = 1000 (1’s Comp.) (Add 1)
9 = 1001 2’s complement = 0110 = 0111
step 2: 1000 + 0111 = 1111 (No carry generated)
Thus MSB is 1, so result is negative & it is in 2’s complement form. So
we have –(0001) 2’s complement of result.
2. Number 01100111
2’s complement 10011001
2’s Complement Representation
Addition/Subtraction in 2’s Complement Representation:
It can conveniently be performed using 2’s complement
representations for both the operands.
It is most commonly used method when these operations are
performed using digital circuits and microprocessors.
E.g. Perform following operations using 2’s complement method:
1) 48 – 23 2) 23- 48 3) 48 – (-23) 4) -48 – 23
Using 8-bit representation of numbers.
Sol:
1) 2’s complement representation of +48 = 00110000
2) 2’s complement representation of -23 = 11101001
48 + (-23) 48 00110000
+(-23) (+) 1 1 1 0 1 0 0 1
-----------------------------------------------------------------------------------------
+25 1 00011001 = + 25
(Discard Carry)
Ans. 2) -25 3) +71 4) -71 (See Pg. 34 R. P. Jain)
2’s Complement Representation
1. If two operands are of the opposite sign, the result is to be
obtained by the rule of subtraction using 2’s complement.
2. If the two operands are of the same sign, the sign bit of the result
(msb) is to be compared with the sign bit of the operands.
3. In case sign bits are same, the result is correct and is in 2’s
complements form.
4. If the sign bits are not same there is a problem of overflow, i.e.
the result can not be accommodated using eight bits and the
result is to be interpreted suitably.
5. The result in this case will consist of nine bits i.e. carry and eight
bits, and the carry bit will give the sign of the number.
Number System and Base Conversions
• Electronic and Digital systems may use a variety of different number
systems, (e.g. Decimal, Hexadecimal, Octal, Binary).
• A number N in base or radix b can be written as:
(N)b = dn-1 dn-2 — — — — d1 d0 . d-1 d-2 — — — — d-m
• In the above, dn-1 to d0 is integer part, then follows a radix point, and
then d-1 to d-m is fractional part.
• dn-1 = Most significant bit (MSB)
• d-m = Least significant bit (LSB)
Binary to Decimal
(1010.01)2
(1010.01)2 = (10.25)10
Conversions
Binary To Decimal:
Binary Number Decimal Number
1. (11011) 2 : (27) 10
2. (0.1101) 2 : (0.8125) 10
1. (1101.1101) 2 (13.8125) 10
2. (1101.11) 2
3. (10101.101) 2
Decimal to Binary
(10.25)10
Note: Keep multiplying the fractional part with 2 until decimal part 0.00 is obtained.
(0.25)10 = (0.01)2
Answer: (10.25)10 = (1010.01)2
Conversions
Decimal to Binary:
1. (46)10 = (101110) 2
2. (115) 10 = ( )2
3. (0.2) 10 = ( 0011 ) 2
4. (25.75)10 = ( )2
Result:
1. (101110) 2
2. (1110011) 2
3. (0011) 2
4. (11001.110) 2
Starting from the least significant bit, make groups of three bits.
If there are one or two bits less in making the groups, 0s can be added after
the most significant bit
Convert each group into its equivalent octal number
Let’s take an example to understand this.
0101100101012 = 26258
Octal to Binary
To convert an octal number to binary, each octal digit is converted to its 3-bit
binary equivalent according to this table.
Octal
0 1 2 3 4 5 6 7
Digit
Binary
Equiva 000 001 010 011 100 101 110 111
lent
546738 = 1011001101110112
Conversions
Octal To Binary: (Make combination of 3 bits for conversion since 0 to 7)
Octal Binary
1. (155.52)8 = (001101101.101010) 2
2. (16.70)8 = (001110.111000) 2
Binary To Octal:
Binary Octal
1. (100011110.010111101) 2 (436.275) 8
2. (1001.00110) 2 (11.14) 8
Octal to Decimal
(12.2)8
(12.2)8 = (10.25)10
Decimal to Octal
(10.25)10
(10)10 = (12)8
Fractional part:
0.25 x 8 = 2.00
Note: Keep multiplying the fractional part with 8 until decimal part .00 is
obtained.
(.25)10 = (.2)8
Answer: (10.25)10 = (12.2)8
Conversions
Octal To Decimal:
Octal Number Decimal
1. (427.35) 8 (279.4531) 10
2. (6327.4051) 8 (3287.5100098) 10
Decimal To Octal:
Decimal Number Octal Number
1. (266) 10 (412) 8
2. (0.256) 10 (0.20304) 8
3. (247) 10 (367) 8
4. (0.6875) 10 (0.54) 8
5. (3287.5100098) 10 (6327.4051) 8
Conversions
• Hexadecimal Number System:
Hexadecimal Decimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
Decimal to Hexadecimal
Here is an example of using repeated division to convert 1792 decimal to
hexadecimal:
Decimal Hexadecimal
Operation Quotient Remainder
Number Result
1792 ÷ 16 = 112 0 0
112 ÷ 16 = 7 0 00
7 ÷ 16 = 0 7 700
0 done.
The only addition to the algorithm when converting from decimal to hexadecimal is
that a table must be used to obtain the hexadecimal digit if the remainder is greater
than decimal 9.
Decimal: 0 1 2 3 4 5 6 7
Hexadecimal: 0 1 2 3 4 5 6 7
Decimal: 8 9 10 11 12 13 14 15
Hexadecimal: 8 9 A B C D E F
Conversions
Hexadecimal To Octal:
Hexadecimal Number Octal Number
1. (4ECE.43F) (047316.2077)
2. (A72E) (123456)
3. (0.BF85) (0.577024)
Decimal To Hexadecimal:
Decimal Number Hexadecimal Number
1. (214) (D6)
2. (0.35) (0.599)
3. (95.5) (5F.8)
4. (675.625) (2A3.A)
Hexadecimal To Decimal:
1. (6ABC.2A) (27324.164)
2. (3A.2F) (58.1836)
Hexadecimal to Binary
To convert from Hexadecimal to Binary, write the 4-bit binary equivalent of hexadecimal.
(3A)16 = (00111010)2
To convert from Binary to Hexadecimal, group the bits in groups of 4 and write the hex
for the 4-bit binary. Add 0's to adjust the groups.
1111011011
(001111011011 )2 = (3DB)16
Conversions
Binary To Hexadecimal:
Binary Number Hexadecimal Number
1. (110111.10101111) 2 (37.AF) 16
2. (10100110101111) 2 (29AF) 16
3. (0.00011110101101) 2 (0.1EB4) 16
Hexadecimal To Binary:
Hexadecimal Number Binary Number
1. (23) 16 (00100011) 2
2. (F23.45B) 16 (111100100011.010001011011) 2
3. (2F9A) (0010111110011010) 2
Logic Minimization:
For two binary variables (taking values 0 and 1) there are 16 possible functions.
The functions involve only three operations which make up Boolean algebra:
AND, OR, and COMPLEMENT. They are symbolically represented as follows:
These operations are like ordinary algebraic operations in that they are
commutative, associative, and distributive. There is a group of useful theorems
of Boolean algebra which help in developing the logic for a given operation.
Boolean Algebra Theorems:
The applications of digital logic involve functions of the AND, OR, and NOT
operations. These operations are subject to the following identities:
Binary Functions of Two Variables
Digital logic involves combinations of the three types of operations for two variables:
AND, OR, and NOT. There are sixteen possible functions:
Single Variable Theorems
Two-Variable Theorems
Besides the important De-Morgan's Theorem, the theorems below
have utility in digital circuits. They have no direct counterparts in
ordinary algebra.
Representation of Truth-Table
Truth table gives the values of the output variables for all the possible
combinations of the input variables.
Consider a Boolean function F = A . B of the logic AND operation. In this
function A & B are the two input independent variables and will have 2N (22 =
4) possible input combinations, where N is the number of input variables.
Each input combination gives rise an output.
All possible values of input and output variables listed in the form of a table
is known as truth table.
The truth table of this AND operation is shown in table:
Representation of Truth-Table
Draw the truth table of a Boolean function given: F = A B + C
Solution: The given expression has the three independent variables, so it will have 8
different horizontal rows (as 23 = 8). Putting all possible values of the independent
variables in the binary progression and evaluated values of the dependent variable F
from the given expression F = A B + C , the required truth table is obtained which is
shown in table below.
Canonical Forms for Boolean Function
Two basic forms of Boolean function corresponding to a given truth table are
Canonical SP form (Sum of Products) and Canonical PS form (Product of
Sums).
Canonical SP (or SOP) Form:
In this form boolean function of the truth table are obtained by summing
(ORing) the product (ANDed) terms corresponding to the 1’s entry in the
output column of the truth table.
The product terms also known as minterms are formed by ANDing the
complemented and uncomplemented variables in such a way that the
complement of variable is taken for the 0’s entry to the input variable and the
variable itself is taken for 1’s entry in the input variable.
The minterms (ANDed terms or products) for the two variables A and B are
shown in table:
Canonical Forms for Boolean Function
Canonical PS (or POS) Form:
In this form boolean function of the truth table are obtained by taking the
product (ANDing) of the sum (ORed) terms corresponding to the 0’s entry in
the output column of the truth table.
The ORed terms are called as maxterms.
Maxterms are formed by ORing the complemented and uncomplemented
variables present in a row of the truth table in such a way that the
complement of variable is taken for the 1’s entry to the input variable and the
variable itself is taken for 0’s entry in the input variable.
The maxterms for three variables are shown in table:
Simplification of Logical functions
Boolean algebra is used to simplify Boolean expressions which
represent combinational logic circuits.
It reduces the original expression to an equivalent expression that has
fewer terms which means that less logic gates are needed to implement
the combinational logic circuit.
Simplification Rules:
Simplification of Logical functions
Simplification of Logical functions
Simplification of Logical functions
Methods to Simplify Boolean Functions
1. Algebraic Method.
2. Karnaugh-Map Technique
3. Quine-McCluskey Method
Karnaugh-Map Technique:
It is the simplest and most commonly used method.
It is a manual method and depends to a great extent upon human
intuition.
It can be used conveniently up to six variables beyond which it is
very cumbersome.
Quine-McCluskey Method:
It is suitable for computer mechanization and is basically used by
logic designers manually.
Karnaugh Map Representation of Logical
Functions
Standard Representations for Logical Functions:
Artibtrary logic function can be expressed in following terms:
1.Sum of Products form (SOP) and
2.Product of Sums form (POS)
This does not mean that logic functions cannot be written in any other
form. But these two forms are standard methods for designing the
circuits.
e.g.
Sum of Product can be represented as:
Y= m(0,3,6,7,10,12,15)
Y= M(1,2,4,5,8,9,11,13,14)
Karnaugh Map Representation of Logical
Functions
• Some times it is difficult to be sure that a logical expression can be
simplified using algebraic method of simplification using boolean
algebraic theorms directly.
• There is a graphical Technique known as karnaugh map technique
which provides a systematic method for simplifying and manipulating
boolean expressions.
• In this technique, the information contained in a truth table or
available in POS or SOP or form is represented on Karnaugh map
(K-map).
• It can be used for any number of variables, but it is used upto six
variables, beyound which it becomes very cumbersome.
• There are K-maps for two, three and four variables. Thus in an n
variable K-map there are 2n cells. Each cell corresponds to one of the
combinations of n variables, since there are 2n combinations of n
variables.
Karnaugh Map Representation of Logical
Functions
• Truth Table of a 3-variable function:
Inputs Output
Row no. A B C Y
0 0 0 0 0
1 0 0 1 1
2 0 1 0 1
3 0 1 1 0
4 1 0 0 1
5 1 0 1 0
6 1 1 0 0
7 1 1 1 1
Note: The output Y is logical 1 for row 1,2,4,7 thus the equation on SOP
form is:
Y= ABC +ABC+ABC+ABC
Karnaugh Map Representation of Logical
Functions
• In above truth table logical 0 corresponds to the rows 0,3,5 & 6 and
the output Y can be represented in terms of standard POS form as
given below:
• Y= (A+B+C) (A+B+C) (A+B+C)(A+B+C)
Karnaugh-Map Technique
The K-map technique is not suitable for handling the design of
complex digital systems because of the following disadvantages:
Step 6. All nonchecked minterm groups in tables are the prime implicants
of the function.
1 1 0 0 01 Checked
8 1 0 00 Checked
2 3 0 0 11 Checked
9 1 0 01 Checked
3 7 0 1 11 Checked
11 1 0 11 Checked
4 15 1 1 11 Checked
Quine-McCluskey Method
E.g. Y(A,B,C,D) = m(0,1,3,7,8,9,11,15)
Table 2. Combination of minterms groups of two.
Group Minterm Variables Steps Checked
ABCD
0 0,1 0 0 0- Checked
0,8 - 0 00 Checked
1 1,3 0 0 - 1 Checked
1,9 - 0 01 Checked
8,9 1 0 0 - Checked
2 3,7 0 - 11 Checked
3,11 - 0 11 Checked
9,11 1 0 - 1 Checked
3 7,15 - 1 11 Checked
11,15 1 - 11 Checked
Quine-McCluskey Method
E.g. Y(A,B,C,D) = m(0,1,3,7,8,9,11,15)
Table 3. Combination of minterms groups of four.
Group Minterm Variables Steps Checked
ABCD
0 0,1,8,9 - 0 0- Checked
0,8,1,9 - 0 0- Checked
1 1,3,9,11 - 0 - 1 Checked
1,9,3,11 - 0 - 1 Checked
2 3,7,11,15 - - 11 Checked
3,11,7,15 - - 11 Checked
Quine-McCluskey Method
E.g. Y(A,B,C,D) = m(0,1,3,7,8,9,11,15)
Table 4. Prime Implicant Table (Essential PI)
PI Terms Decimal Nos. Minterms
0 1 3 7 8 9 11 15
BC 0,1,8,9 X X X X
BD 1,3,9,11 X X X X
CD 3,7,11,15 X X X X
E.g.
Minimize the four-variable logic function using k-map:
f(A,B,C,D) = m(0,1,2,3,5,7,8,9,11,14)
Excess 3 code: Another BCD code in 4 bit binary code. The decimal
digit is obtained by adding 3 to the natural BCD code.
Gray code: It is a code in which each gray code number differs from
the preceding & succeeding number by a single bit.