Unit_5
Unit_5
Unit_5
Engineering
Dr. P. Maheswaran
Assistant Professor, Dept. of ECE
NIT Trichy
mahes@nitt.edu
Overview of the unit
Unit 5:
The position of a digit with reference to decimal point determines its value/weight.
Sum of all digits multiplied by their weights give the total number.
Binary number system:
Decimal system with its ten digits is a base ten system.
The octal number system uses the first eight digits of decimal number system: (0 to 7).
16 digits: 0 to 9, A, B, C, D, E, F.
Base for octal is third power of the base for binary numbers.
By grouping 3 digits of binary numbers, and then converting each group digits to its octal
equivalent, one can convert binary number to its octal equivalent.
Number base conversions: Octal to Binary
Reversal of the process explained in the previous section.
Each digit of the octal number is individually converted to its binary equivalent to get octal to
binary conversion.
(634)8 to binary:
(725.63)8 to binary:
Number base conversions: Binary to Hexadecimal
The base of hexadecimal number is 16.
The base of hexadecimal number is the fourth power of the base for binary numbers.
By grouping 4 digits of binary numbers and then converting each group digit to its
hexadecimal equivalent, binary number can be converted to its hexadecimal equivalent.
Number base conversions: Hexadecimal to Binary
This is the reverse process of what was done for hex to binary conversion.
Each digit in the hexadecimal number is individually converted to its binary equivalent to get
hexadecimal to binary conversion of the number.
A number with any radix can be converted into its decimal equivalent.
First remainder is least significant digit (LSD) and last remainder is the most significant digit
(MSD).
Number base conversions: Conversion of decimal numbers to any radix number
Successive division for integer part: Convert (214)10 to its octal equivalent
Number base conversions: Conversion of decimal numbers to any radix number
The integer part (carry) of the product becomes a numeral in the new radix number.
The fractional part is again multiplied by the radix.
This process is repeated until fractional part reaches 0 or until new radix number is carried
out to significant digits.
The integer part (carry) of each product is read downward to represent the new radix
number.
Number base conversions: Conversion of decimal numbers to any radix number
Successive multiplication for fractional part: Convert (0.8125)10 to its binary form
Successive multiplication for fractional part: Convert (0.95)10 to its binary form
• Case 2: Method:
• Determine the 1’s complement of the larger number.
• Add the 1’s complement to the smaller number.
• Answer is in 1’s complement form. To get the answer in true form, take the 1’s
complement and assign negative sign to the answer.
Complements: 2’s complement subtraction
• Case 2: A – B, B > A.
• Determine the 2’s complement of the larger number.
• Add the 2’s complement to the smaller number.
• Answer is in the 2’s complement form. To get the answer in the true form, take the 2’s
complement and assign negative sign to the answer.
Binary arithmetic:
• If the signs are same, we add the two magnitudes and give the sum the common sign.
• If the signs are different, we subtract the smaller magnitude from the larger and give the result the sign
of the larger number.
• (+24) + (-32) = -(32-24) = -8
• This process requires the comparison of the signs and the magnitudes and then performing addition or
subtraction.
Binary arithmetic:
• But with signed complement arithmetic does not require comparison or subtraction.
• Only addition is needed.
• 2’s complement arithmetic for all cases:
Binary coded decimal (8-4-2-1):
• The pure binary representation of (58)10 = (111010)2, only 6 bits are required.
• BCD requires 8 bits, less efficient.
• But easy for conversion between BCD and decimal.
BCD addition:
• The addition of two BCD numbers is best understood by considering the three cases that occur when
two BCD digits are added.
• Sum equals 9 or less with carry 0:
• The addition is carried out as in normal binary addition and the sum is 1001, which BCD for 9.
• Sum greater than 9 with carry 0:
• Whenever the sum exceeds 9, it has to be corrected by adding (0110) in the invalid BCD.
BCD addition:
• Sum equals 9 or less with carry 1:
In summary:
• Add two BCD numbers using ordinary binary addition.
• If four-bit sum is equal to or less than 9, no correction is needed. The sum is in proper BCD form.
• If the four-bit sum is greater than 9 or if a carry is generated from the four-bit sum, the sum is invalid.
• To correct the invalid sum, add 0110 2 to the four-bit sum. If a carry results from this addition, add it to
the next higher–order BCD digit.
BCD addition:
In summary:
• Add two BCD numbers using ordinary binary addition.
• If four-bit sum is equal to or less than 9, no correction is needed. The sum is in proper BCD form.
• If the four-bit sum is greater than 9 or if a carry is generated from the four-bit sum, the sum is invalid.
• To correct the invalid sum, add 0110 2 to the four-bit sum. If a carry results from this addition, add it to
the next higher–order BCD digit.
BCD subtraction:
• A negative BCD number can be expressed by taking the 9’s or 10’s complement methods.
• 9’s complement if found by subtracting the decimal number from 9.
• When 9’s complement of smaller number is added to the larger number, carry is generated.
• Add this carry to the result (end-around carry).
• When larger number is subtracted from smaller number, there is no carry.
• The result is in 9’s complement form and negative.
BCD subtraction:
BCD subtraction:
• The 10’s complement of a decimal number is equal to the 9’s complement plus 1.
• The 10’s complement can be used to perform subtraction by adding the minuend to the 10’s
complement of the subtrahend and dropping the carry.
In summary:
• Find the 10’s complement of a negative number.
• Add two number using BCD addition.
• If carry is not generated find the 10’s complement of the result.
Boolean postulates and laws:
• The postulates are basic assumptions from which it is possible to deduce the rules, laws, theorems,
and properties of the system.
• Boolean algebra formulated by:
• Defined set of elements.
• Two binary operators (+ and .).
Rules of Boolean algebra:
Rules of Boolean algebra:
Rules of Boolean algebra:
Laws of Boolean algebra:
Three of the laws of Boolean algebra are the same as in ordinary algebra.
Commutative laws:
Law 2: AB = BA: order in which the variables are ANDed makes no difference.
It says that starting with a Boolean relation, you can derive another Boolean relation by:
• Boolean expressions are constructed by connecting the Boolean constants and variables with Boolean
operations.
• These Boolean expressions are also known as Boolean formulas.
• Boolean expressions are used to describe Boolean functions:
• The cells of K-map are labelled with a combination of variables and complements.
• The product term in a cell is the product of all the variables in that column and row.
• When we move from one cell to another, along a row or column:
• One and only one variable in the product term changes.
• Irrespective of number of variables the labels along each row and column must conform to
the single-change rule.
The Karnaugh Map:
• Figures show the label of rows and columns of a 2,3 and 4 variable maps
using gray code and the product terms corresponding to each cell.
• Instead of writing actual product terms, shorthand minterm notations are
written in the cell.
• Rows and columns are marked with Gray code instead of variables.
Plotting of K-map:
• Boolean expression in the sum of products form is plotted on K-Map by placing a 1 in each
cell corresponding to a term (minterm) in the sum of products expression.
• Remaining cells are filled with zeros.
Plotting of K-map: Representing Standard SOP on K-Map
Plotting of K-map: Representing Standard POS on K-Map
• A Boolean expression in POS can be plotted on K-Map by placing a 0 (zero) in each cell
corresponding to a maxterm in the expression.
• Remaining cells are filled with ones.
Grouping of cell for simplification:
AND operator
Logic Gates:
NOT gate
Logic Gates:
AND gate