Professional Documents
Culture Documents
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
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
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.