0% found this document useful (0 votes)
7 views34 pages

Automation

The document provides an extensive overview of number systems, including decimal, binary, octal, and hexadecimal systems, along with methods for converting between these bases. It covers binary codes, digital arithmetic, logic gates, and Boolean algebra, emphasizing the importance of understanding data representation in digital electronics. Each chapter includes detailed explanations, examples, and conversion techniques relevant to digital systems.

Uploaded by

mukommukom951
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views34 pages

Automation

The document provides an extensive overview of number systems, including decimal, binary, octal, and hexadecimal systems, along with methods for converting between these bases. It covers binary codes, digital arithmetic, logic gates, and Boolean algebra, emphasizing the importance of understanding data representation in digital electronics. Each chapter includes detailed explanations, examples, and conversion techniques relevant to digital systems.

Uploaded by

mukommukom951
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Contents

Chapter 1: Number systems ............................................................................................................ 3


1.1: introduction .......................................................................................................................... 3
1.2: Decimal number system....................................................................................................... 3
1.3: Binary number system ......................................................................................................... 3
1.4: Octal number system ........................................................................................................... 4
1.5: Hexadecimal number system ............................................................................................... 4
1.6 Finding the decimal equivalent ............................................................................................. 4
1.6.1: Binary to decimal conversion ....................................................................................... 4
1.6.2: Octal to decimal conversion ......................................................................................... 5
1.6.3: Hexadecimal to decimal................................................................................................ 5
1.7: Conversion from the decimal to other bases ........................................................................ 5
1.7.1: Decimal to binary conversion ....................................................................................... 5
......................................................................................... 6
1.7.2: Decimal to octal conversion
................................................................................................ 8
1.7.3: Decimal to hexadecimal
.................................................................................. 8
1.8: Conversion from one base to another
.............................................................. 8
1.8.1: Binary – octal and octal – binary conversions
1.8.2: Hexadecimal-binary and binary to hexadecimal conversions ...................................... 9
............................................... 9
1.8.3: Hexadecimal-octal and octal-hexadecimal conversions
................................................................................................................ 11
Chapter 2: Binary codes
2.1: Introduction........................................................................................................................ 11
2.2: Binary coded decimal (BCD) ............................................................................................ 11
2.2.1: BCD – to – decimal conversion .................................................................................. 11
2.2.2 Decimal to BCD conversion ........................................................................................ 11
2.2.3: BCD to binary conversion .......................................................................................... 12
.......................................................................................... 13
2.2.4: Binary to BCD conversion
2.3: Excess – 3 code .................................................................................................................. 13
2.3.1: Decimal to excess-3 code conversion ......................................................................... 14
2.3.2: Excess-3 code to decimal conversion ......................................................................... 14
2.4: Gray code ........................................................................................................................... 14
2.4.1: Binary-Gray code conversion ..................................................................................... 15
2.4.2: Gray code – binary conversion ................................................................................... 15
2.5: Alphanumeric codes .......................................................................................................... 16
Chapter 3: Digital arithmetic ........................................................................................................ 18
3.1: Introduction........................................................................................................................ 18
3.3 Number representation in binary ........................................................................................ 18
3.3.1: Sign-bit magnitude ...................................................................................................... 18

Page 1 of 34
3.4: Complementation ............................................................................................................... 18
3.4.1. 1’s complement ........................................................................................................... 18
3.4.2: 2’s complement ........................................................................................................... 19
Chapter 4: Logic gates (Combinational logic) .............................................................................. 21
4.1: Introduction........................................................................................................................ 21
4.2: Truth table .......................................................................................................................... 21
4.3: OR gate .............................................................................................................................. 21
4.4: AND gate ........................................................................................................................... 22
4.5: NOT gate............................................................................................................................ 23
4.6: Exclusive OR gate (XOR) ................................................................................................. 24
4.7: Complementary logic gates ............................................................................................... 24
4.7.1: NAND (AND + NOT) gate ........................................................................................ 24
4.7.2: NOR (OR + NOT) gate............................................................................................... 25
4.7.3: Exclusive –NOR (XNOR) gate (XOR+NOT) gate .................................................... 26
4.8: Universal gates ................................................................................................................... 27
Chapter 5: Boolean algebra and simplification techniques........................................................... 28
5.1: Introduction........................................................................................................................ 28
5.2: Postulates of Boolean algebra ............................................................................................ 28
5.3: Theorems ........................................................................................................................... 28
5.4: Universality of NAND and NOR gates ............................................................................. 31
5.5: Simplification techniques .................................................................................................. 31

Page 2 of 34
Chapter 1: Number systems

1.1: introduction
The study of number systems is important from the view point of understanding how data are
represented before they can be processed by any digital system, including a digital computer,
PLC, etc. it is one of the most basic topics in digital electronics.

1.2: Decimal number system


The decimal number system is a base (radix) 10 number system and therefore has 10 different
digits or symbols which are 0,1,2,3,4,5,6,7,8, and 9. All higher numbers after ‘9’ are represented
in terms of these 10 digits only. The place values of different digits in a mixed decimal number
(a number containing an integer part and a fractional part), starting from the decimal point, are
100,101, 102, and so on (for the integer part) and 10-1,10-2, 10-3, and so on (for the fractional part).
The value or magnitude of a given decimal number can be expressed as the sum of the various
digits, multiplied by the place values or weights.
Example
3586.26510

Integer part: 3586  6 100  8  101  5 102  3  103


 6  80  500  3000
 3586
Fractional part: 265  2  101  6  102  5 10 3
 0.2  0.06  0.005
 0.265
Generally, the place values of different digits in the integer part in a mixed number system are
given by r 0 , r1 , r 2 , r 3 and so on, starting with the digit adjacent to the radix point. For the

fractional part, these are r 1 , r 2 , r 3 , r 4 and so on, starting with the digit next to the radix point.
Here, r is the radix of the number system.
1.3: Binary number system
It is a base-2 number system with ‘0’ and ‘1’ as the two independent digits. All larger numbers
are represented in terms of ‘0’ and ‘1’. Each digit is called a bit.

Page 3 of 34
Note:
A nibble is a combination of 4 bits
Byte or bite is a combination of 8 digits.
Word is a combination of 16 digits or two bytes
1.4: Octal number system
The octal number system is a base-8 number system and has 8 distinct digits. All larger numbers
or higher order numbers are expressed as a combination of these digits. The independent digits
are: 0,1,2,3,4,5,6, and 7.

1.5: Hexadecimal number system


The hexadecimal number system is a base-16 number system and has 16 distinct digits whic are:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F. The decimal equivalent of A,B,C,D,E, and F are
10,11,12,13,14, and 15. All larger numbers or higher order numbers are expressed as a
combination of these digits.

1.6 Finding the decimal equivalent


The decimal equivalent of a given number in another number system is given by the sum of all
the digits multiplied by their respective place values. The integer and fractional parts of the given
number should be treated separately as seen in 1.2.

1.6.1: Binary to decimal conversion


Convert 1001.01012 to a number in base 10.

Solution
Integer part: 1001
Decimal equivalent:  1 20  0  21  0  22  1 23
 1 0  0  8
9
Fractional part: 0101
Decimal equivalent:  0  21  1 22  0  2 3  1 2 4
 0  0.25  0  0.0625
 0.3125

Page 4 of 34
 1001.01012  9.3125 10

1.6.2: Octal to decimal conversion


Convert 137.218 to a number in base 10.

Solution
Integer part: 137
Decimal equivalent:  7  80  3  81  1 82  7  24  64  95
Fractional part: 21
Decimal equivalent:  2  81  1 82  0.25  0.015625  0.265625
 137.218  95.26562510

1.6.3: Hexadecimal to decimal


Convert 1E 0.2 A16 to a number in base 10.

Solution
Integer part: 1E0
Decimal equivalent:  0  160  14  161  1 16 2  0  224  256  480
Fractional part: 2A
Decimal equivalent:  2  161  10  162  0.125  0.0390625  0.1640625
 1E 0.2 A16  480.164062510

1.7: Conversion from the decimal to other bases


1.7.1: Decimal to binary conversion
For the integer part, the binary equivalent can be found by successively dividing the integer part
of the number by ‘2’ and recording the remainders until the quotient becomes ‘0’. The
remainders written in reverse order constitute the binary equivalent.
For the fractional part, it is found by successively multiplying the fractional part of the decimal
number by ‘2’ and recording the carry (i.e. when the resulting number is greater than 1) until the
result of the multiplication is zero ‘0’. The carry sequence written in forward order constitutes
the binary equivalent of the fractional part of the decimal number.
If the result of multiplication does not seem to be heading towards zero, in the case of the
fractional part, the process may be continued only until the required or requisite number of

Page 5 of 34
equivalent bits has been obtained. This method of decimal-binary conversion is called the
double-dabble method.
Example
Convert 13.375 10 to a number in base 2

Solution
Integer part = 13
Divisor Dividend Remainder

2 13 -

2 6 1

2 3 0

2 1 1

- 0 1

Binary equivalent 1310  11012

Fractional part = 0.375


Multiplier Factor Carry

2 0.375 -

2 0.75 0

2 0.5 1

- 0 1

Binary equivalent 0.375 10  0.011 2

 13.375 10  1101.0112

1.7.2: Decimal to octal conversion


The procedure is similar to decimal-to-binary conversion. Dividing by ‘8’ for the integer part and
multiplying by ‘8’ for the fractional part.
Example

Page 6 of 34
Convert  73.75 10 to a number in base 8

Solution
Integer part = 73
Divisor Dividend Remainder

8 73 -

8 9 1

8 1 1

- 0 1

Binary equivalent 7310  1118

Fractional part = 0.75


Multiplier Factor Carry

8 0.75 -

- 0 6

Binary equivalent 0.7510  0.6 8

  73.7510  111.6 8

Page 7 of 34
1.7.3: Decimal to hexadecimal
The procedure is similar to decimal-to-binary conversion but the radix is 16.
Example
Convert  82.25 10 to a number in base 16

Solution
Integer part = 82
Divisor Dividend Remainder

16 82 -

16 5 2

- 0 5

Binary equivalent 82 10  52 16

Fractional part = 0.25


Multiplier Factor Carry

16 0.25 -

- 0 4

Binary equivalent 0.2510  0.4 16

  82.8510  52.4 16

1.8: Conversion from one base to another


1.8.1: Binary – octal and octal – binary conversions
An octal number can be converted into its binary equivalent, by replacing each octal digit with
its three-bit binary equivalent. The three-bit equivalent is used because the base of the octal
number system is 8 and it is represented with three-bits in base 2.
A binary number can be converted into an equivalent octal number by splitting the integer and
fractional parts into groups of three-bits, starting from the binary point on both sides. The zeros
‘0’ can be added to complete the outside groups if needed.
Example 1
Convert 374.26 8 to base 2

Page 8 of 34
Solution

374.26 8  011111100.010110
    
3 7 4 2 6 2

 011111100.010110 2

Example 2
Convert 1110100.01001112 to base 8

Solution

1110100.01001112  001110100.010
    011100
1 6 4 2 3 4 2

 164.234 8

1.8.2: Hexadecimal-binary and binary to hexadecimal conversions


The procedure is similar to that of binary-octal conversions but this time the grouping is in 4 bits.
Example 1
Convert 17 E.F 6 16 to base 2

Solution

17 E.F 6 16  000101111110.11110110
       101111110.11110112
1 7 E F 6 2
Example 2
Convert 1011001110.011011101 2 to base 16

Solution

1011001110.0110111012  001011001110.011011101000
        2CE.6 E 8 16
2 C E 6 E 8 2
1.8.3: Hexadecimal-octal and octal-hexadecimal conversions
For hexadecimal –octal conversions, the given hexadecimal number is firstly converted into its
binary equivalent which is further converted into its octal equivalent.
For octal –hexadecimal conversion, the octal number is first converted into an equivalent binary
number and then the binary number transformed into its hexadecimal equivalent.
Example
Convert  2 F .C 4 16 to a number in base 8.

Page 9 of 34
Solution
 2 F .C 4 16  00101111.11000100 2

 00101111.110
   00100 
5 7 6 1 2

 2F .C 4 16  57.618
Example 2
Convert  762.0138 to a number in base 16.

762.0138  111110010.0000010112


 000111110010.0000
    01011000 
1 F 2 0 5 8 2

762.0138  1F 2.058 16

Page 10 of 34
Chapter 2: Binary codes
2.1: Introduction
A code is a technique for representing information in a form (using letters, numbers or symbols)
suitable for storage or transmission or a mapping from a set of messages into binary strings. The
binary coding system, called the straight binary code, becomes very cumbersome to handle when
used to represent larger decimal numbers. To overcome this short coming, and also to perform
many other special functions, several binary codes have evolved over the years.
2.2: Binary coded decimal (BCD)
The binary coded decimal (BCD) is a type of binary code used to represent a given decimal
number. It uses the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. They are three types of BCD: 8421
BCD code, 4221 BCD code and 5421 BCD code.
The numbers in the BCD code represent the weights (place values) of different bits in the four bit
groups, starting from the MSB and proceeding towards to the LSB. The 8421 code is the most
popular of all the BCD codes, and it is simply referred to as the BCD code.
2.2.1: BCD – to – decimal conversion
The equivalent of BCD code in decimal is obtained by splitting the integer part and the fractional
part into groups of 4-bits starting from the binary point.
Example
What is the decimal equivalent of 00100011.00010101 BCD

Solution
Integer part Fractional part
00100011
 .00010101

2 3 1 5

 00100011.00010101 BCD  23.1510

2.2.2 Decimal to BCD conversion


The BCD equivalent of a decimal number is obtained by replacing each decimal digit in the
integer and fractional parts with its 4-bit binary equivalent.
Example
What is the BCD equivalent of 25.26 10

Page 11 of 34
Solution
25.26 10  00100101.00100110  BCD

2.2.3: BCD to binary conversion


A given BCD number can be converted into an equivalent binary number, by first writing its
decimal equivalent and then converting it into its binary equivalent.
Example
What is the binary equivalent of 00101001.01110101 BCD

Solution
 Converting BCD to decimal

00101001.01110101 BCD  00101001.01110101
     29.75 10
2 9 7 5  BCD
 Converting decimal to binary
Integer part = 29

Divisor Dividend Remainder

2 29 -

2 14 1

2 7 0

2 3 1

2 1 1

- 0 1

Binary equivalent 29 10  111012

Page 12 of 34
 Fractional part = 0.75
Multiplier Factor Carry

2 0.75 -

2 0.5 1

- 0 1

 Binary equivalent 0.75 10  0.11 2

 29.7510  11101.112
 00101001.01110101 BCD  11101.112

2.2.4: Binary to BCD conversion


A given binary number can be converted into an equivalent BCD number, by first determining its
decimal equivalent and then writing the corresponding BCD equivalent.
Example
Convert 10101011.1012 to a BCD

Solution
 Convert 10101011.1012 to base 10

Integer part
101010112  1 20  1 21  0  22  1 23  0  24  1 25  0  26  1 27  1  2  8  32  128  17110
Fractional pat
0.101 2  1 21  0  22  1 23  0.5  0.125  0.625 10

10101011.1012  171.625 10

 Converting 171.625 10 to BCD

171.625 10  000101110001.011000100101 BCD

 10101011.1012  000101110001.011000100101 BCD

2.3: Excess – 3 code


The Excess-3 code is another important BCD code. It is particularly significant for arithmetic
operations as it overcomes the short comings encountered while using the 8421 BCD code to add

Page 13 of 34
two decimal digits whose sum exceeds 9. The excess-3 code has no such limitation, and it
considerably simplifies arithmetic operations.
2.3.1: Decimal to excess-3 code conversion
The excess-3 code for a given decimal number is determined by adding ‘3’ to each decimal digit
in the given number and then replacing each digit of the newly found decimal number by its 4-bit
binary equivalent.
Example
Convert 597.25 10 into an excess-3 code.

Solution
Integer Fractional part
597
0.25
333
0.33
10  1010
8  1000
12  1100
5  0101
8  1000

 597.2510  100011001010.01011000  Ex3

2.3.2: Excess-3 code to decimal conversion


For a given excess-3 code, the corresponding decimal number can be obtained/determined by
first splitting the number into 4-bit groups, starting from the excesss-3 point, and then subtracting
0011 from each 4-bit group.
Example
Convert 100011001010.01011000  Ex3 to a decimal number

Solution
1000 1100 1010. 0101 1000
1101 1101 1101 1101 1101
 .
101011100110111
   10010  10101

5 9 7 2 5

 100011001010.01011000  Ex3  597.25 10

2.4: Gray code


It is an unweighted binary code in which two successive values differ only by 1 bit. Owing to
this feature, the maximum error that can be creep into a system using the binary gray code

Page 14 of 34
encode data, is much less than the worst-case error encountered in the case of the straight binary
coding.
2.4.1: Binary-Gray code conversion
A given binary number can be converted into its gray code equivalent, by adding through the
following steps:
1. The MSB of the gray code is equivalent to the MSB of the binary code
2. The second MSB in the Gray code number, is obtained by adding the MSB and the
second MSB of the binary number and ignoring the carry if any
3. The third MSB in the Gray code number is obtained by adding the second MSB and the
third MSB of the binary number and ignoring the carry if any
4. The process continues until we obtain the LSB of the Gray code number.
Example
Convert 10112 into a Gray code number.

Solution
Binary = 10 1 1 10 1 1 10 1 1 10 1 1
Gray code = 1   11  111 11 1 0

 10 1 12  1110 Gray

2.4.2: Gray code – binary conversion


A given Gray code number can be converted into its binary equivalent by going through the
following steps:
1. The MSB of the binary number is the same as the MSB of the Gray code number
2. The second MSB in the binary number is obtained by adding the MSB in the binary
number to the second MSB of the Gray code number and ignoring the carry if any
3. The third MSB in the binary number is obtained by adding the second MSB in the binary
number to the third MSB of the Gray code number and ignoring the carry if any
4. The process continues until we obtain the LSB of the binary number

Page 15 of 34
Example
What is the binary equivalent of 1110 Gray .

Solution
Gray code = 11 1 0 11 1 0 11 1 0 11 1 0
Binary = 1   10   101 10 1 1

 1110 Gray  10 1 12

2.5: Alphanumeric codes


Alphanumeric codes, also called character codes, are binary codes used to represent
alphanumeric data. The codes use to write alphanumeric data include: letters of the alphabet,
numbers, mathematical symbols and punctuation marks in a form that is understandable and
processable by a computer.
Two widely used alphanumeric codes include the ASCII and the EBCDIC codes. While the
former is popular with microcomputers and it is used on nearly all personal computers and
workstations, the latter is mainly used with large systems.
ASCII American Standard Code for Information Interchange
EBCDIC Extended Binary Code Decimal Interchange Code

The ASCII code


The ASCII code is widely used to send information to and from microcomputers. The standard
ASCII code is a 7-bit code used in transferring coded information from keyboards and to
computer displays and printers.
The ASCII code is used to represent numbers, letters, punctuation marks, as well as control
characters. For instance, the 7-bit ASCII code 111 1111 stands for DEL from the top chart. From
the bottom chart we see that DEL means delete.
What is the coding for "A" in ASCII? Locate A on the top chart. Assembling the 7-bit code gives
100 0001 = A. This is the code you would expect to be sent to a microcomputer's CPU if you
pressed the A key on the keyboard.
The ASCII code is an alphanumeric code. It can represent both letters and numbers. Several
other alpha numeric codes are EBCDIC, Baudot, and Hollerth.

Page 16 of 34
Page 17 of 34
Chapter 3: Digital arithmetic
3.1: Introduction
Having discussed different methods of data representation, the next obvious step is to study the
rules of data manipulation.
3.3 Number representation in binary
Different formats used for binary representation of both positive and negative decimal numbers
include: the sign-bit magnitude method, the 1’s complement method and the 2’s complement
method.
3.3.1: Sign-bit magnitude
In the sign-bit magnitude representation of positive and negative decimals, the MSB represent
the ‘sign’, with a ‘0’ denoting a plus sign and a ‘1’ denoting a minus sign. The remaining bits
represent the magnitude. In eight-bit representation for example, while the MSB represents the
sign, the remaining seven bits represent the magnitude.
An n-bit binary representation can be used to represent decimal numbers in the range of

   
 2 n1  1 to  2 n1  1 . With 8-bit, the range is from -127 to +127.

Example
Using the sign-bit magnitude format to represent -9 in 8-bits.
Solution
+9 = 00001001, -9 = 10001001
3.4: Complementation
In order to avoid the problems related with binary subtraction especially when the subtrahend is
greater than the minuend, we make use of the complement and then carry out the process of
addition.
Example
4  1  4   1 ; 15  25  15   25

3.4.1. 1’s complement


The 1’s complement is obtained by simply inverting (complementing) the bits in the binary
number.
Example

Page 18 of 34
3  00000011

3  11111100
11111111
From the basic laws of mathematics, when we add a number and its opposite (complement), the
result must be ‘0’.
From the example above, we see that the resultant is not zero but a negative number. It is only
when 1 is added to the LSB that we obtain a zero ‘0’ since we are working on 8-bits and ignoring
the carry.
i.e.
3  00000011

3  11111100
11111111
 1
100000000

On 8-bits the range of numbers representable on 1’s complement is from  2 n1  1   to

 
 2 n1  1 .i.e from -127 to +127.

3.4.2: 2’s complement


From the discussions above, we can deduce that, in order to obtain or negate a binary number,
we need to complement the bits which gives the 1’s complement, to which we add 1, to the LSB
which gives the 2 complement, which is actually the negative number of the binary number.
The n-bit notation of the 2’s complement format can be used to represent all decimal numbers in

   
the range from  2 n1  1 to  2 n1 . For example using 8-bit it is from -128 to +127

The 2’s complement format is very popular as it is very easy to generate the 2’s complement of a
binary number and also because arithmetic operations are relatively easier to perform when the
numbers are represented in the 2’s complement format.
Example
The 8-bit 2’s complement representation of  2310  111010012 .

Subtraction using 2’s complement

Page 19 of 34
Subtraction is similar to addition. Adding the 2’s complement of the subtrahend to the minuend
disregarding (rejecting) the carry (overflow), if any, achieves subtraction.

Example
 24 10  14 10  00011000
 11110010
100001010

 24 10  14 10  00001010  1010 2  10

Page 20 of 34
Chapter 4: Logic gates (Combinational logic)
4.1: Introduction
Logic gates are electronic circuits that can be used to implement the most elementary logic
expressions, also known as Boolean expressions. The logic gate is the most basic building block
of combinational logic.
In combinational logic system (circuits), the output depends only on the present value (state) of
the input. The logic gate is the most basic building block of any digital system, including
computers. The three basic gates are the OR gate, the AND gate and the NOT gate.
4.2: Truth table
A truth table lists all possible combinations of input binary variables and the corresponding
outputs of a logic system. The logic system output can be found from the logic expression, often
referred to as the Boolean expression that relates the output with the inputs of that very logic
system.
4.3: OR gate
It is a gate whose output is at logic level 1, whenever anyone, or more of its inputs is at logic
level 1.
Symbol

Electrical equivalent

Page 21 of 34
Truth table
A B F
0 0 0
0 1 1
1 0 1
1 1 1
Boolean expression for the output
F  A B
4.4: AND gate
It is a gate whose output is at logic level 1, when all its inputs are at logic level 1.
Symbol

Electrical equivalent

Page 22 of 34
Truth table
A B F
0 0 0
0 1 0
1 0 0
1 1 1

Boolean expression for the output


F  A.B
4.5: NOT gate
A NOT gate also called an inverter. It is gate with only one input. The output is at logic level 1,
when its input is at logic level 0.

Symbol Electrical equivalent

Truth table
A F
0 1
1 0

Page 23 of 34
Boolean expression for the output
FA

4.6: Exclusive OR gate (XOR)


It is a gate whose output is at logic level 1, when there is an odd number of logic level 1, at its
input.

Symbol

Electrical equivalent

Truth table
A B F
0 0 0
0 1 1
1 0 1
1 1 0

Boolean expression for the output


F  A  B  AB  AB

4.7: Complementary logic gates


4.7.1: NAND (AND + NOT) gate
It is a gate whose output is at logic level 0, when all the inputs are at logic level 1.

Page 24 of 34
Symbol

Electrical equivalent

Truth table
A B F
0 0 1
0 1 1
1 0 1
1 1 0

Boolean expression for the output


F  AB

4.7.2: NOR (OR + NOT) gate


It is a gate whose output is at logic level 1, when all its inputs are at logic level 0.

Symbol

Electrical equivalent

Page 25 of 34
Truth table
A B F
0 0 1
0 1 0
1 0 0
1 1 0

Boolean expression for the output


F  A B
4.7.3: Exclusive –NOR (XNOR) gate (XOR+NOT) gate
It is a gate whose output is at logic level 0 when the number of logic level 1 in the input
sequence is odd, and at logic level 1, when the number of logic level 1 in the in the input
sequence is even, including zero (zero logic level in the input will produce a logic level 1, at the
output).

Symbol

Electrical equivalent

Truth table
A B F
0 0 1

Page 26 of 34
0 1 0
1 0 0
1 1 1

Boolean expression for the output


F  A B
4.8: Universal gates
The OR, AND and NOT gates are the three basic gates as they together can be used to construct
the logic circuit for any given Boolean expression. NOR and NAND gates have the property that
they individually can be used to implement a logic circuit corresponding to any given Boolean
expression. That is, it is possible to use either only NAND gates or only NOR gates to implement
any Boolean expression. This is because, a combination of NAND gates or NOR gates can be
used to perform functions of any of the basic logic gates. It is for this reason that NAND and
NOR gates are universal gates this will be illustrated in the next chapter.

Page 27 of 34
Chapter 5: Boolean algebra and simplification techniques
5.1: Introduction
Boolean algebra is mathematics of logic. It is one of the most basic tools available that can be
effectively used for simplification of complex logic expressions, and it is simpler than ordinary
algebra. It is also composed of a set of symbols and rules to manipulate these symbols.
However, this is the only similarity between the two. Some major differences include:
1. In ordinary algebra, the letter symbols can take on any number of values including
infinity. In Boolean algebra, they can take on either of two values, i.e. 0 and 1.
2. The values assigned to a variable have a numerical significance in ordinary algebra,
whereas in Boolean algebra, they have a logical significance.
3. While ‘.’ and ‘+’ are respectively the signs of multiplication and addition in ordinary
algebra, in Boolean algebra, ‘.’ means an AND operation and ‘+’ means an ‘OR’
operation
5.2: Postulates of Boolean algebra
1. 11  1, 0  0  0
2. 10  01  0, 0  1  1  0  1
3. 00  0, 1  1  1

4. 1  0, and 0  1

5.3: Theorems
1. Operation with ‘0’ and ‘1’
a) 0 X  0
b) 1  X  1
c) 1 X  X
d) 0  X  X
2. Idempotent or Identity law
a) X  X  X  X  X  X
b) X  X  X  X    X  X
3. Complementation law

Page 28 of 34
a) X  X  0

a) X  X  1
4. Commutative laws
a) X  Y  Y  X
b) X Y  Y  X
5. Associative laws
a ) X  Y  Z   Y   X  Z   Z   X  Y 

b ) X Y  Z   Y  X  Z   Z  X Y 

6. Distributive laws
a ) X Y  Z   X Y  X  Z

b) X  YZ   X  Y  X  Z 

Proof
 X  Y  X  Z   XX  XZ  XY  YZ
 X  XZ  XY  YZ
 X 1  Z  Y   YZ

 X  YZ
Special case
a) X Y  X Y  X

b)  X  Y   X  Y   X

7. Absorption law or redundancy law


a) X  XY  X
Proof
X  XY  X 1  Y 

X
b) X  X  Y   X

Proof
X  X  Y   XX  XY

Page 29 of 34
 X  XY
 X 1  Y 

X
c) X Y  Y  X  Y
Proof
X Y  Y  X Y  X Y  X Y  X Y
  X Y  X Y    X Y  X Y 
 Y  X  X   X Y  Y 
 X Y
8. Demorgan’s Theorem
a ) X 1  X 2  X 3    X n  X 1  X 2  X 3  X n

b) X 1  X 2  X 3  X n  X 1  X 2  X 3    X n

9. Involution law

XX
Example 1
Simplify using Boolean algebra
Y  ABC  ABC  ABC  ABC
Y  ABC  ABC  ABC  ABC  ABC  ABC


Y  BC  A  A   BC  A  A   AC B  B 
Y  BC  BC  AC
Y C
Example 2
Simplify using Boolean algebra
Y  ABC  ABC  ABC  ABC  ABC
Y  ABC  ABC  ABC  ABC  ABC  ABC

Y  BC  A  A   BC  A  A   AC  B  B 

Y  BC  BC  AC

Page 30 of 34
5.4: Universality of NAND and NOR gates
5.5: Simplification techniques
The primary objective of all simplification procedures is to obtain an expression that has the
minimum number of terms. The techniques commonly used are:
1. The theorems of Boolean algebra
2. The Karnaugh map method
Sum-of-products Boolean expression
It is customary when starting a logic design problems, to first construct a truth table. The table
details the exact operation of the digital circuit. From the table, derive the sum of product of
Boolean expressions that describe the circuit behavior. This expression is also known as a
minterm expression.
It is also possible to write the Boolean expression in the form of product-of-sum also referred to
maxterm expression.

The  Nomenclature

The  notation is used to represent sum-of-products (minterm expression) Boolean expression.


We will illustrate these notations with the help of an example. Let us consider the following
Boolean function:

f  A, B, C , D   A.B.C  A.B.C.D  A.B.C.D  A.B.C.D

We will represent this function using  notation. The first step is to write the expanded sum-of-
products given by:

 
f  A, B, C , D   A.B.C. D  D  A.B.C.D  A.B.C.D  A.B.C.D

f  A, B, C , D   A.B.C.D A.B.C.D  A.B.C.D  A.B.C.D  A.B.C.D

Differrent terms are then arranged in ascending order of the binary numbers represented by
various terms, with true variables representing a '1' and a complemented variable representing a
'0'. The expression becomes

f  A, B, C , D   A.B.C.D  A.B.C.D  A.B.C.D  A.B.C.D A.B.C.D

Page 31 of 34
The different terms represent 0001, 0101, 1000, 1001 and 1111. The decimal equivalent of these
terms enclosed in the  then gives the  notation for the Boolean function. That is,

f  A, B, C , D    1,5,8,9,15

The complement of f  A, B, C , D  , that is, f   A, B, C , D  , canbe directly determined from the


 notation by including the left-out entries from the list of all possible numbers for a four-
variable function. That is

f   A, B, C , D     0, 2,3, 4, 6, 7,10,11,12,13,14 

Karnaugh map method


Boolean algebra is the basis for any simplification of logic circuits. The Karnaugh map method
depends on this and it is one of the easiest ways to simplify logic circuits. A Karnaugh map is a
graphical representation of the logic system. It can be drawn directly from either minterm (sum-
of-products) or maxterm (product-of-sum) Boolean expressions. Karnaugh maps are sometimes
referred to as K maps
Construction of a Karnaugh map
An n-variable karnaugh map has 2 n cells or squares. The K-map cells are labeled horizontally or
vertically so that adjacent cells differ only in one variable. Each cell in the top row is considered
to be adjacent to the corresponding cell in the bottom row. Each cell in the left most column is
considered to be adjacent to the corresponding cell in the right most column. Same for the top
most cells and bottom cells. The Gray code is used in filling the K-map.
General procedure
1. Write a minterm Boolean expression from the truth table
2. Plot a ‘1’ on the map for each ANDed group of variables
3. Draw loops around adjacent groups of two, four, eight or sixteen ‘1s’ on the map. (The
loops may overlap)
4. Eliminate the variable(s) that appear(s) with its (their) complement(s) with a loop, and
save the variable(s) that is (are) left.
5. Eliminate any redundant group i.e. a group in which all the 1’s are part of all other
groups.
6. Logically OR the groups that remain to form the simplified minterm expressions.
Filling of K-map

Page 32 of 34
There are various forms of K-maps for the same Boolean expression. But for convenience, we
will use the following configurations.
1. 2-variable K-map
A A

B AB AB
B AB AB

2. 3-variable K-map

AB AB AB AB
C ABC ABC ABC ABC
C ABC ABC ABC ABC

3. 4-variable K-map
AB AB AB AB
CD ABCD ABCD ABCD ABCD

CD ABCD ABCD ABCD ABCD


CD ABCD ABCD ABCD ABCD

CD ABCD ABCD ABCD ABCD


Note

1. A quart eliminates 2 variables that appear in both forms (complementary and


uncomplementary form)
2. A loop of octal eliminates 3 variables that appear in both forms (complementary and
uncomplementary form)
3. A loop of sixteen eliminates 4 variables that appear in both forms (complementary and
uncomplementary form)
The figures below represent an unusual situation of K-maps. Figure (a) represent a K-map with
no possibility of simplification. Figures (b) to (e) represent different forms of adjacent cells.

Page 33 of 34
Figure Some of unusual loop variations
Karnaugh maps with don’t care conditions
In some digital systems, certain input conditions never occur during normal operation; therefore,
the corresponding output never appears. Since the output never appears, it is indicated by an X in
the truth table. The X is called a don’t-care condition. Whenever you see an X in a truth table,
you can let it equal either 0 or 1, whichever produces a simpler logic circuit.
Note
 Given the truth table, draw a K-map with 0s, 1s and don’t-cares (Xs)
 Encircle the actual 1s on the K-map in the largest groups you can find by treating the
don’t-cares as 1s.
 After the actual 1s have been included in groups, disregard the remaining don’t-cares by
visualizing them as 0s.

Page 34 of 34

You might also like