You are on page 1of 9

Kanpur Institute of Technology

Lecture notes
Unit 1
Number System: - Let us consider any decimal number for example 9765. We can als
o express as
9000+700+60+5 or 9*103 +7*102+6*101+2*100
In above example 10 is Known as Base or Radix. Powers of 10 are known as Place V
alue. More accurately above number can be expressed as (9765)10 . In General any
number (xyz)a can be expressed as
x*a2+y*a1+z*a0.
Based on this Base there are mainly 3 types of number system used in Digital E
lectronics except conventional Decimal Number System.
1. Binary Number System.
2. Octal Number System
3. Hexadecimal Number System.
Binary Number System: - In this number the Base is 2. In any number system no. o
f numbers used is equal to base. So in binary number system only 2 numbers is us
ed i.e. ‘0’ & ‘1’. For example (1010101)2 .
Octal Number System:- In this number system the base is 8, so in this number sy
stem numbers from 0-7 are used. For example in octal a number can be given as (3
226326352)8.
Hexadecimal Number System: - In this number system base is 16. In addition to nu
mbers from 0-9 the alphabets A-F are also used for expressing numbers in this nu
mber system. The numbers from 0-9 has its usual meanings while the value for A-F
is given below.
A-10
B-11
C-12
D-13
E-14
F-15
Any number in Hexadecimal can be expressed as (AB2356)16.
Conversion from any number system to Decimal Number System: - Let us take an exa
mple of converting Binary number into Decimal number.
(10110)2 = 1*24+0*23+1*22+1*21+0*20 =16+0+4+2+0 = (22)10 .
This means to convert any number from any base to Decimal we multiply each indiv
idual bit by the base raised to the place value of that bit. We assign the Place
Value of LSB as zero and increase by one as we travel from LSB to MSB.
Conversion from Decimal Number System to any number system:-

2
22

2
11
0
2 5 1
2
2 1
2 1 0
0 1
Now we write the number from downward to upward direction i.e. (10110)2 . So t
his is the Binary equivalent of Decimal Number. We can Convert Decimal number to
any number system by dividing the decimal number by the base in which number is
to be converted in the same manner as described above.
Direct Conversion between Bases: - We can convert directly between binary, octal
, hexadecimal number systems
From Binary to Octal & Hexadecimal:- Make group of 3 digit starting fro
m LSB and moving towards MSB if in MSB there is Sufficient bits left for making
group add Appropriate number of Zeros in MSB. . After that write the decimal equ
ivalent of binary number for each group.
(10110)2= (010 110) =
(26)8
Similarly for converting into hexadecimal number system make group of 4 digits a
nd follow the same process as for octal numbers.
From Octal & Hexadecimal to Binary:- Write 3 digit Binary equivalent for
Octal and 4 digit Binary equivalent for Hexadecimal for each individual bit and
write the numbers side by side as given in original numbers. e.g.
(26)8 = (010 110) = (010110)2
Here 010 is 3 digit binary equivalents for 2 and 110 is 3 digit binary equivalen
t for 6.
BCD & Negative Numbers and Their Arithmetic: - BCD means Binary Coded Decimal. T
he main difference between BCD and BINARY is that in BCD each individual bit of
the number is converted into Binary.
BCD Addition: - The BCD addition is same as that for Binary addition until the
sum is less than or equal to 1001(i.e. decimal 9), but if binary sum is greater
than 1001 then we obtain a nonvalid BCD. The addition of binary 0110(i.e. decima
l 6) to the binary sum converts it to the correct BCD representation and also pr
oduce output carry as required.
For ex. Add Two numbers 576 and 184.
1 1
Carry from Previous bit
The BCD equivalent of 576: 0101 0111 0110
The BCD equivalent of 184: 0001 1000 0100
__________________ +
0111 1 0000 1010
0000 0110 0110 Add
ition of 0110 for BCD correction
0111 0110 0000
7 6 0
BCD Subtraction:- The BCD subtraction is same as Binary subtraction until differ
ence is less than or equal to 1001 (decimal 9), but if difference is greater tha
n 1001 then we subtract 0110 ( decimal 6) from the result and now we will get th
e required result.
The BCD equivalent of 576: 0101 0111 0110
The BCD equivalent of 184: 0001 1000 0100
__________________ -
0011 1111 0010
NC 0110 NC Subtrac
tion of 0110 for BCD correction
0011 1001 0010
3 9 2
Representation of Negative Numbers:-
There are three commonly used conventions for representation of negative numbers
.
1. Signed Magnitude representation.
2. Signed 1’s Complement representation.
3. Signed 2’s complement representation.
1. Signed Magnitude representation:- In signed magnitude representation the
Number is represented in 8 bits . The MSB is kept reserved for the Sign bit. Fo
r positive numbers the Sign bit is 0 and for negative numbers sign bit is 1.
For example
+8 = 0000 1000
-8 = 1000 1000
2. Signed 1’s Complement representation: - In signed 1’s complement representation t
he number is also represented in 8 bits. The MSB is 1 as the number is negative.
Now we take 1’s complement of the positive equivalent of that number excluding th
e sign bit.
3. Signed 2’s Complement representation:- In signed 2’s complement representation th
e number is represented in 8 bit. The MSB is 1 as the number is negative. Now we
take 2’s complement of the positive equivalent of that number excluding sign bit.
Arithmetic Addition:-
Addition with sign-1’s complement representation:- The addition of two signed b
inary numbers with negative numbers represented by their 1’s complement representa
tion is obtained from the addition of the two numbers , including their sign bi
ts. If there is a Carry out of the most significant (Sign) bit, the result is in
cremented by one and its carry is discarded. If the sign bit is 1 then take 1’s co
mplement of the result obtained above that will be the final answer.
+ 6 0 0000110 - 6 1 111
1001
+ 9 0 0001001 + 9 0 0001
001
+ 15 0 0001111 1 0 000
0010
1 +
+ 3
0 0000011

+ 6 0 0000110 - 9 1
1110110
- 9 1 1110110 - 6 1
1111001
1 1111100 1 1
1101111
-3 1 0000011 (1’s complement)
1
1 1110000(1’s Complement)
-15
1 0001111
Addition with sign-2’s complement representation:- The addition of the two signe
d binary numbers with negative number represented by their 2’s complement is obta
ined from the addition of the two numbers, including their sign bits. A carry in
most significant (Sign) bit is discarded. If the sign bit is 1 then take 2’s comp
lement of the result obtained above that will be the final answer.
+ 6 0 0000110 - 6 1 11110
10
+ 9 0 0001001 + 9 0 000100
1
+ 15 0 0001111 1 0 000001
1(carry discarded)
+ 3
0 0000011

+ 6 0 0000110 - 6 1 1111
010
- 9 1 1110111 - 9 1 111
0111
1 1111101 1 1 1
110001
-3 1 0000011 (2’s complement) -15 1 0001111(2’s complemen
t)

Boolean algebra
In 1854, George Boole developed ‘Logic Algebra’, Known today as “Boolean Algebra”. Boole
an Algebra is a set of rules, laws, and theorems by which logical operations can
be expressed mathematically. The logical OR can be thought as Addition operatio
n while logical AND operation can be thought as Multiplication operation
Logic Expression:-
NOT
The operation of an inverter can be expressed: If the Input variab
le is A and output variable is X then X=A If A=0 then X=1 and if A=1 then X=0
OR
The OR operation on 2 variables can be expressed as: If one input i
s A and another input is B and output is X then X=A+B
AND
The AND operation on 2 variables can be expressed as: If one input
is A and another input is B and output is X then X=AB
NAND
The NAND operation on 2 variables can be Expressed as: If one inpu
t is A and another input is B and output is X = AB
NOR
The NOR operation on 2 variables can be expressed as: If one input
is A and another input is B and output is X then X=A+B
Logic Gates: - The Electronic devices which perform various logic operations are
known as Logic Gates. There exits following Gates.
1. Buffer
2. NOT or Inverter
3. OR
4. AND
5. NOR
6. NAND
7. EX-OR
8. EX-NOR
Truth Table: - It gives input output relation for various input combination in T
abular form. Truth table along with logic diagram of various Gates is given belo
w

Basic Boolean Identities:-


Additive Multiplicative
A+0 = A A.0 = 0
A+1 = 1 A.1 = A
A+A = A A.A = A
A+A = 1 A.A = 0
Boolean arithmetic
Addition: (OR Operation)
Let us begin our exploration of Boolean algebra by adding numbers together:
Multiplication: (AND Operation)
Multiplication is valid in Boolean algebra, and thankfully it is the same as in
real-number algebra: anything multiplied by 0 is 0, and anything multiplied by 1
remains unchanged:
BASIC RULES OF BOOLEAN ALGEBRA
1. A + 0 = A
2. A + 1 = 1
3. A. 0 = 0
4. A. 1 = A
5. A + A = A
6. A + A = 1
7. A. A = A
8. A.A = 0
9. A = A
10. A + BC = (A+B).(A+C)
11. A+AB = A
12. A + AB = A + B
PROOF OF RULES 10, 11, 12:
Rule 10:
(A + B)(A + C)
= AA + AC + AB + BC (Distrib.)
= A +AC +AB +BC (Rule 7)
= A (1+C) + AB + BC (Distrib.)
= A. 1 + AB + BC (Rule 4)
= A + AB + BC (Rule 2)
= A (1 + B) + BC (Distrib.)
= A .1 + BC (Rule 2)
= A+BC

Rule 11:
( A+AB)
= A (1+B)
= A.1 (Rule 2)
= A (Rule 4)
Rule 12:
A + AB
= (A+A) (A+B)
= 1. (A+B) (Rule 6)
=A+B (Rule 4)

DE MORGAN’S THEOREMS
1. A.B = A + B
THIS STATES THAT THE INVERSE (COMPLEMENT) OF A PRODUCT [AND] IS EQUAL TOTHE SUM
[OR] OF THE COMPLEMENTS.
2. A + B = A . B
THIS STATES THAT THE INVERSE (COMPLEMENT) OF A SUM [OR] IS
EQUAL TO THE PRODUCT [AND] OF THE COMPLEMENTS

K-MAP and TABULATION METHOD


K-Map: - This is a graphical method to simplify Boolean expression. This method,
first proposed by ‘Veitch’ and slightly modified by Karnaugh, is also known as the
Veitch diagram or “Karnaugh map”.
The K-map is a diagram made up of squares. Each square represent
one minterms. In fact K-Map represents a visual diagram of all possible ways a
function may be expressed in standard form.
Two and Three variable maps:- For a n variable map there must be 2n squares in
K-Map.
So for a two variable map there should be 4 squares while in 3 variable map ther
e should be 8 squares in K-Map.
Two variable map:-

Three variable map: - In the following map note that , minterms are arranged not
in Binary sequence but in a sequence similar to Gray Code. The characteristic o
f Gray Code is that only one bit changes in adjacent squares.

To understand the usefulness of the Map for simplifying the Boolean functions, w
e must recognize the basic property possessed by adjacent squares. Any two adjac
ent squares in the map differ by only one variable which is primed in one square
and unprimed in other square.
From the postulates of Boolean algebra, it follows that sum of two minterms in a
djacent squares can be simplified to a single AND term consisting only two liter
als. Also note that we always make groups of 2n literals of adjacent squares wh
ere n= 1,2,3,4 etc.
Four variable map:- The map for four variable will consists of 16 squares.

Five Variable Map:- Maps of more than four variable are not simple to use . The
number of squares become excessively large and geometry for combining adjacent s
quares become more involved. For 5 variable map we need 32 squares. The five var
iable map is shown below. It consists of two 4 variable maps with variable A, B,
C, D, and E. Variable A distinguishes between the two maps.

Tabulation Method: - The map method of simplification is convenient as long as t


he number of variable does not exceed five. As the number of variable increases,
the excessive number of squares prevents a reasonable selection of adjacent squ
ares. The obvious disadvantage of map method is that it is essentially a trial-
and- error procedure which depends on the ability of individual to recognize cer
tain patterns.
The Tabulation method overcomes this difficulty. It is a st
ep- by –step procedure that is guaranteed to produce a simplified standard-form ex
pression for a function. The Tabulation method was first formulated by Quine and
latter improved by McCluskey. This method is also known as Quine-McCluskey me
thod.
The Tabular method of simplification consists of two parts. Th
e first is to find by an exhaustive search all the terms for inclusion in the si
mplified function. These terms are known as prime implicants .The second operati
on is to choose among the prime implicants those that give an expression with le
ast number of literals.
Steps for simplification of Boolean function using Tabulation method:-
Step 1:- Group binary representation of the minterms according to the number of
1’s contained.
Step 2:- Any two minterms which differ from each other by only one variable can
be obtained, and unmatched variable removed. Two minterms fit into this category
if they both have the same bit value in all position except one. The minterms i
n one section are compared with those of the next section down only. If any two
numbers are the same in every position but one, a check mark is placed to the ri
ght of both minterms to show that they have been used. The resulting term, toget
her with the decimal equivalents, is listed in next column of the table. The var
iable eliminated during the matching is denoted by a dash in its original positi
on.
Step 3:- The searching and comparing process is repeated for the terms in column
obtained in Step 2 and is listed in the next column of the Table. Again, terms
in each section need to be compared only if they have dash in the same position.
The comparing process should be carried out again in this column and subsequent
columns as long as proper matching is encountered.
Step 4:- The unchecked terms in the table form the prime implicants. Therefore u
nchecked entries are the terms left to formulate the function.
Step 5:- The selection of prime implicants that form the minimized function is m
ade from a prime-implicant table. In this table, each prime-implicant is represe
nted in a row and each minterm in a column. Crosses are placed in each row to sh
ow the composition of minterms that make the prime-implicants. A minimum set of
prime-implicants is then chosen that covers all the minterm in the function.
Hamming Code:- One of the most common error-detecting code was derived by R.W.Ha
mming. In the hamming code k parity bits are added to an n-bit data word forming
a new word of n+k bits. The bit positions are numbered from 1 to n+k. Those pos
itions numbered as a power of 2 are reserved for parity bit. Create the code wor
d as follows:
1. Mark all bit positions that are powers of two as parity bits. (Positions
1, 2, 4, 8, 16, 32, 64, etc.)
2. All other bit positions are for the data to be encoded. (Positions 3, 5,
6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.)
3. Each parity bit calculates the parity for some of the bits in the code w
ord. The position of the parity bit determines the sequence of bits that it alte
rnately checks and skips.
Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11
,13,15,...)
Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,
10,11,14,15,...)
Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc. (8-15
,24-31,40-47,...)
Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits, etc.
(16-31,48-63,80- 95,...)
Position 32: check 32 bits, skip 32 bits, check 32 bits, skip 32 bits, etc.
(32-63,96-127,160-191,...)
etc.
4. Set a parity bit to 1 if the total number of ones in the positions it ch
ecks is odd. Set a parity bit to 0 if the total number of ones in the positio
ns it checks is even.
Here is an example to discuss this method
A byte of data: 10011010
Create the data word, leaving spaces for the parity bits: _ _ 1 _ 0 0 1 _ 1 0 1
0
Calculate the parity for each parity bit (a ? represents the bit position being
set):
• Position 1 checks bits 1, 3, 5, 7, 9, 11:
? _ 1 _ 0 0 1 _ 1 0 1 0. Even parity so set position 1 to a 0: 0 _ 1 _ 0 0 1 _ 1
0 1 0
• Position 2 checks bits 2, 3, 6, 7, 10, 11:
0 ? 1 _ 0 0 1 _ 1 0 1 0. Odd parity so set position 2 to a 1: 0 1 1 _ 0 0 1 _ 1
0 1 0
• Position 4 checks bits 4, 5, 6, 7, 12:
0 1 1 ? 0 0 1 _ 1 0 1 0. Odd parity so set position 4 to a 1: 0 1 1 1 0 0 1 _ 1
0 1 0
• Position 8 checks bits 8, 9, 10, 11, 12:
0 1 1 1 0 0 1 ? 1 0 1 0. Even parity so set position 8 to a 0: 0 1 1 1 0 0 1 0 1
0 1 0
Code word: 011100101010.

You might also like