0% found this document useful (0 votes)
140 views47 pages

Bca-Ist Sem (Computer Architecture) - Unit-1 Notes

The document outlines the Von Neumann architecture, which includes components such as the Control Unit, Arithmetic and Logic Unit (ALU), Memory Unit, and various registers, and is foundational to modern computer design. It also explains the Central Processing Unit (CPU) and its role in executing instructions, as well as the different number systems used in computing, including binary, octal, decimal, and hexadecimal. Additionally, it covers conversion methods between these number systems and basic binary operations like addition, subtraction, multiplication, and division.

Uploaded by

rathiprince12345
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)
140 views47 pages

Bca-Ist Sem (Computer Architecture) - Unit-1 Notes

The document outlines the Von Neumann architecture, which includes components such as the Control Unit, Arithmetic and Logic Unit (ALU), Memory Unit, and various registers, and is foundational to modern computer design. It also explains the Central Processing Unit (CPU) and its role in executing instructions, as well as the different number systems used in computing, including binary, octal, decimal, and hexadecimal. Additionally, it covers conversion methods between these number systems and basic binary operations like addition, subtraction, multiplication, and division.

Uploaded by

rathiprince12345
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/ 47

Von Neumann Architecture

Von Neumann architecture was first published by John von Neumann in 1945.

His computer architecture design consists of a Control Unit, Arithmetic and Logic Unit (ALU),
Memory Unit, Registers and Inputs/Outputs.

Von Neumann architecture is based on the stored-program computer concept, where instruction
data and program data are stored in the same memory. This design is still used in
most computers produced today.

Central Processing Unit (CPU)

The Central Processing Unit (CPU) is the electronic circuit responsible for executing the
instructions of a computer program.

It is sometimes referred to as the microprocessor or processor.

The CPU contains the ALU, CU and a variety of registers.


Registers

Registers are high speed storage areas in the CPU. All data must be stored in a register before
it can be processed.

Holds the memory location of data that needs to be


MAR Memory Address Register
accessed

MDR Memory Data Register Holds data that is being transferred to or from memory

AC Accumulator Where intermediate arithmetic and logic results are stored

PC Program Counter Contains the address of the next instruction to be executed

Current Instruction
CIR Contains the current instruction during processing
Register

Arithmetic and Logic Unit (ALU)

The ALU allows arithmetic (add, subtract etc) and logic (AND, OR, NOT etc) operations to be
carried out.

Control Unit (CU)

The control unit controls the operation of the computer’s ALU, memory and input/output devices,
telling them how to respond to the program instructions it has just read and interpreted from the
memory unit.

The control unit also provides the timing and control signals required by other computer
components.
Buses

Buses are the means by which data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory.

A standard CPU system bus is comprised of a control bus, data bus and address bus.

Carries the addresses of data (but not the data) between the processor and
Address Bus
memory

Carries data between the processor, the memory unit and the input/output
Data Bus
devices

Carries control signals/commands from the CPU (and status signals from
Control Bus other devices) in order to control and coordinate all the activities within the
computer

Memory Unit

The memory unit consists of RAM, sometimes referred to as primary or main memory. Unlike a
hard drive (secondary memory), this memory is fast and also directly accessible by the CPU.

RAM is split into partitions. Each partition consists of an address and its contents (both
in binary form).

The address will uniquely identify every location in the memory.

Loading data from permanent memory (hard drive), into the faster and directly accessible
temporary memory (RAM), allows the CPU to operate much quicker.
NUMBER SYSTEM
Number systems are the technique to represent numbers in the computer system architecture,
every value that you are saving or getting into/from computer memory has a defined number
system.

Computer architecture supports following number systems.

 Binary number system


 Octal number system
 Decimal number system
 Hexadecimal (hex) number system

BINARY NUMBER SYSTEM

A Binary number system has only two digits that are 0 and 1. Every number (value) represents
with 0 and 1 in this number system. The base of binary number system is 2, because it has only
two digits.

OCTAL NUMBER SYSTEM

Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with
0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has
only 8 digits.

DECIMAL NUMBER SYSTEM

Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents
with 0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10,
because it has only 10 digits.

HEXADECIMAL NUMBER SYSTEM

A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F.
Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number
system. The base of hexadecimal number system is 16, because it has 16 alphanumeric values.
Here A is 10, B is 11, C is 12, D is 14, E is 15 and F is 16.

Number system Base(Radix) Used digits Example


Binary 2 0,1 (11110000)2
Octal 8 0,1,2,3,4,5,6,7 (360)8
Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10
0,1,2,3,4,5,6,7,8,9,
Hexadecimal 16 (F0)16
A,B,C,D,E,F

CONVERSIONS
DECIMAL TO OTHER

1. DECIMAL TO BINARY

Decimal Number System to Other Base

To convert Number system from Decimal Number System to Any Other Base is quite easy;
you have to follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which you want
to convert the number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most
Significant Bit (MSB).

Decimal to Binary Conversion Result


Decimal Number is : (12345)10

Binary Number is
(11000000111001)2

2. DECIMAL TO OCTAL

Decimal to Octal Conversion Result


Decimal Number is : (12345)10

Octal Number is
(30071)8

3. DECIMAL TO HEXADECIMAL
Decimal to Hexadecimal Conversion Result
Example 1
Decimal Number is : (12345)10

Hexadecimal Number is
(3039)16

Example 2
Decimal Number is : (725)10 Hexadecimal Number is
(2D5)16
Convert
10, 11, 12, 13, 14, 15
to its equivalent...
A, B, C, D, E, F

BINARY TO OTHER
A) Multiply the digit with 2(with place value exponent). Eventually add all the multiplication
becomes the Decimal number.
1. BINARY TO DECIMAL

2. BINARY TO OCTAL

An easy way to convert from binary to octal is to group binary digits into sets of three, starting
with the least significant (rightmost) digits.

Binary: 11100101 = 11 100 101


011 100 101 Pad the most significant digits with zeros if
necessary to complete a group of three.

Then, look up each group in a table:


Binary: 000 001 010 011 100 101 110 111
Octal: 0 1 2 3 4 5 6 7

Binary = 011 100 101


Octal = 3 4 5 = 345 oct

3. BINARY TO HEXADECIMAL

An equally easy way to convert from binary to hexadecimal is to group binary digits into sets of
four, starting with the least significant (rightmost) digits.

Binary: 11100101 = 1110 0101

Then, look up each group in a table:


Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101


Hexadecimal = E 5 = E5 hex

OCTAL TO OTHER

1. OCTAL TO BINARY

Converting from octal to binary is as easy as converting from binary to octal. Simply look up
each octal digit to obtain the equivalent group of three binary digits.

Octal: 0 1 2 3 4 5 6 7
Binary: 000 001 010 011 100 101 110 111

Octal = 3 4 5
Binary = 011 100 101 = 011100101 binary

2. OCTAL TO HEXADECIMAL

When converting from octal to hexadecimal, it is often easier to first convert the octal number
into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex:

(from the previous example)


Octal = 3 4 5

Binary = 011 100 101 = 011100101 binary


Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits.

Binary: 0000 0001 0010 0011 0100 0101 0110 0111

Hexadecimal: 0 1 2 3 4 5 6 7

Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal: 8 9 A B C D E F

Binary = 1110 0101

Hexadecimal = E 5 = E5 hex

Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals
hexadecimal E5.

3. OCTAL TO DECIMAL

The conversion can also be performed in the conventional mathematical way, by showing each
digit place as an increasing power of 8.

345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

OR

Converting octal to decimal can be done with repeated division.

1. Start the decimal result at 0.


2. Remove the most significant octal digit (leftmost) and add it to the result.
3. If all octal digits have been removed, you’re done. Stop.
4. Otherwise, multiply the result by 8.
5. Go to step 2.

Octal Digits Operation Decimal Result Operation Decimal Result


345 +3 3 ×8 24
45 +4 28 ×8 224
5 +5 229 done.
 (345)8 =(229)10

HEXADECIMAL TO OTHER
1. HEXADECIMAL TO BINARY

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal.


Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits.

Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 8 9 A B C D E F
Binary: 1000 1001 1010 1011 1100 1101 1110 1111

Hexadecimal = A 2 D E
Binary = 1010 0010 1101 1110 = 1010001011011110 binary

2. HEXADECIMAL TO OCTAL
1's complement

The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is
called as taking complement or 1's complement. Example of 1's Complement is as follows.

Binary Addition

It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.
In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given
column and a carry of 1 over to the next column.

Example − Addition

2's complement

The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB)
of 1's complement of the number.

2's complement = 1's complement + 1

Example of 2's Complement is as follows.


Rules of Binary Addition
 0 + 0 = 0
 0 + 1 = 1
 1 + 0 = 1
 1 + 1 = 0, and carry 1 to the next more significant bit

For example,

00011010 + 00001100 = 00100110 1 1 Carries


0 0 0 1 1 0 1 0 = 26(base 10)
+ 0 0 0 0 1 1 0 0 = 12(base 10)
0 0 1 0 0 1 1 0 = 38(base 10)

00010011 + 00111110 = 01010001 1 1 1 1 1 carries


0 0 0 1 0 0 1 1 = 19(base 10)
+ 0 0 1 1 1 1 1 0 = 62(base 10)
0 1 0 1 0 0 0 1 = 81(base 10)

Rules of Binary Multiplication

 0 x 0 = 0
 0 x 1 = 0
 1 x 0 = 0
 1 x 1 = 1, and no carry or borrow bits

For example,

00101001 × 00000110 = 11110110 0 0 1 0 1 0 0 1 = 41(base 10)


× 0 0 0 0 0 1 1 0 = 6(base 10)
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1

0 0 1 1 1 1 0 1 1 0 = 246(base 10)

Binary Division

Binary division is the repeated process of subtraction, just as in decimal division.

For example,

00101010 ÷ 00000110 = 1 1 1 = 7(base 10)


00000111
1 1 0 ) 0 0 1 1
0 1 0 1 0 = 42(base 10)
- 1 1 0 = 6(base 10)

1 borrows
1
1 0 0 1
- 1 1 0

1 1 0
- 1 1 0

10000111 ÷ 00000101 = 1 1 0 1 1 = 27(base 10)


00011011
135(base
1 0 1 ) 1 0 0 1
0 0 1 1 1 =
10)
- 1 0 1 = 5(base 10)
1
1 1 0
- 1 0 1

1 1
- 0

1 1 1
- 1 0 1

1 0 1
- 1 0 1

Example − Division
18

2.7 Binary Arithmetic


Binary arithmetic is essential in all types of digital systems. To understand these
systems, you must know the basics of binary addition, subtraction, multiplication,
and division.

2.7.1 Binary Addition


The four basic rules for adding binary digits (bits) are as follows:
0 + 0 = 0 Sum of 0 with a carry of 0
0 + 1 = 1 Sum of 1 with a carry of 0
1 + 0 = 1 Sum of 1 with a carry of 0
1 + 1 = 10 Sum of 0 with a carry of 1

Notice that the first three rules result in a single bit and in the fourth rule the
addition of two 1s yields a binary two (10). When binary numbers are added, the
last condition creates a sum of 0 in a given column and a carry of 1 over to the
next column to the left, as illustrated in the following examples:

Example: Add 11 + 1

Sol.

Carry Carry
1 1
0 1 1
+ 0 0 1
1 0 0
In the right column, 1 + 1 = 0 with a carry of 1 to the next column to the left. In
the middle column, 1 + 1 + 0 = 0 with a carry of 1 to the next column to the left.
In the left column, 1 + 0 + 0 = 1.
Carry bits
1 + 0 + 0 = 0 1 Sum of 1 with a carry of 0
1 + 1 + 0 = 1 0 Sum of 0 with a carry of 1
1 + 0 + 1 = 1 0 Sum of 0 with a carry of 1
1 + 1 + 1 = 1 1 Sum of 1 with a carry of 1
19

Example: Add 111 + 11

Sol.
Carry Carry
1 1
1 1 1
+ 1 1
1 0 1 0

2.7.2 Binary Subtraction


The four basic rules for subtracting bits are as follows:

0-0=0
1-1=0
1-0=1
10 - 1 = 1 0 - 1 with a borrow of 1

When subtracting numbers, you sometimes have to borrow from the next column
to the left. A borrow is required in binary only when you try to subtract a 1 from
a 0. In this case, when a 1 is borrowed from the next column to the left, a 10 is
created in the column being subtracted, and the last of the four basic rules just
listed must be applied.

Example: Subtract 0112 from 1012.

Sol.
Left column: Middle column:
When a 1 is borrowed, Borrow 1 from next column
a 0 is left, so 0 - 0 = 0. to the left, making a 10 in
this column, then 10 - 1 = 1.
0
1 10 1
- 0 1 1
0 1 0

18/5/2021
20

2.7.3 Binary Multiplication


The four basic rules for multiplying bits are as follows:

0 × 0 = 0, 0 × 1 = 0, 1 × 0 = 0, 1 × 1 = 1
Multiplication is performed with binary numbers in the same manner as with
decimal numbers. It involves forming partial products, shifting each successive
partial product left one place, and then adding all the partial products.

Example: Perform the following binary multiplications:

(a) 112 × 112 (b) 1012 × 1112

Sol.

2.7.4 Binary Division


Division in binary follows the same procedure as division in decimal

Example: Perform the following binary divisions: (a) 1102 ÷ 112 (b) 1102 ÷ 102

Sol.

18/5/2021
21

2.8 Complements of Binary Numbers


The 1’s complement and the 2’s complement of a binary number are important
because they permit the representation of negative numbers. The method of 2’s
complement arithmetic is commonly used in computers to handle negative
numbers.

2.8.1 Finding the 1’s Complement


The 1’s complement of a binary number is found by changing all 1s to 0s
and all 0s to 1s, as illustrated below:

The simplest way to obtain the 1’s complement of a binary number with a
digital circuit is to use parallel inverters (NOT circuits), as shown in Figure
below for an 8-bit binary number.

Example of inverters used to obtain the 1’s complement of a binary number.

2.8.2 Finding the 2’s Complement


The 2’s complement of a binary number is found by adding 1 to the LSB of the
1’s complement. 2’s complement = (1’s complement) + 1

18/5/2021
22

Example: Find the 2’s complement of 10111000 using the alternative method.

Sol.

Related Problem:
Find the 2’s complement of 11000000.

The 2’s complement of a negative binary number can be realized using inverters
and an adder, as indicated in Figure below. This illustrates how an 8-bit number
can be converted to its 2’s complement by first inverting each bit (taking the 1’s
complement) and then adding 1 to the 1’s complement with an adder circuit.

Example of obtaining the 2’s complement of a negative binary number.

To convert from a 1’s or 2’s complement back to the true


(uncomplemented) binary form, use the same two procedures described
previously. To go from the 1’s complement back to true binary, reverse all the
bits. To go from the 2’s complement form back to true binary, take the 1’s
complement of the 2’s complement number and add 1 to the least significant bit.

18/5/2021
23

2.8.3 1’s Complement Form


Positive numbers in 1’s complement form are represented the same way as the
positive sign-magnitude numbers. Negative numbers, however, are the 1’s
complements of the corresponding positive numbers. For example, using eight
bits, the decimal number 225 is expressed as the 1’s complement of +25
(00011001) as
11100110
In the 1’s complement form, a negative number is the 1’s complement of the
corresponding positive number.

Example: Find the 1’s complement of 00010011.

Sol.
Change each bit in a number to get the 1’s complement. The 1’s complement of
a binary number is found by changing all 1s to 0s and all 0s to 1s, as illustrated
below:
0 0 0 1 0 0 1 1 Binary number

↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓

1 1 1 0 1 1 0 0 1's complement

2.8.4 2’s Complement Form


Positive numbers in 2’s complement form are represented the same way as in the
signmagnitude and 1’s complement forms. Negative numbers are the 2’s
complements of the corresponding positive numbers. Again, using eight bits, let’s
take decimal number 225 and express it as the 2’s complement of +25 (00011001).
Inverting each bit and adding 1, you get
-25 = 11100111

In the 2’s complement form, a negative number is the 2’s complement of the
corresponding positive number.

18/5/2021
24

Example: Represent −2 in 2’s complement.

Sol.

2 = 0 0 1 0

1 1 0 1 1’s complement

+ 1 results in 2’s complement

1 1 1 0 = -2

2.9 Binary Coded Decimal (BCD)

Binary coded decimal (BCD) is a way to express each of the decimal digits with a
binary code. There are only ten code groups in the BCD system, so it is very easy
to convert between decimal and BCD. Because we like to read and write in
decimal, the BCD code provides an excellent interface to binary systems.
Examples of such interfaces are keypad inputs and digital readouts.

2.9.1 The 8421 BCD Code


The 8421 code is a type of BCD (binary coded decimal) code. Binary coded
decimal means that each decimal digit, 0 through 9, is represented by a binary code
of four bits. The designation 8421 indicates the binary weights of the four bits (23,
22, 21, 20). The ease of conversion between 8421 code numbers and the familiar
decimal numbers is the main advantage of this code. All you have to remember
are the ten binary combinations that represent the ten decimal digits as shown in
Table below. The 8421 code is the predominant BCD code, and when we refer to
BCD, we always mean the 8421 code unless otherwise stated.

In BCD, 4 bits represent each decimal digit.

18/5/2021
25

2.9.1.1 Invalid Codes


You should realize that, with four bits, sixteen numbers (0000 through 1111) can
be represented but that, in the 8421 code, only ten of these are used. The six code
combinations that are not used—1010, 1011, 1100, 1101, 1110, and 1111—are
invalid in the 8421 BCD code.
To express any decimal number in BCD, simply replace each decimal digit with
the appropriate 4-bit code, as shown by example below.

Example: Convert each of the following decimal numbers to BCD:

(a) 35 (b) 98 (c) 170 (d) 2469

Sol.

It is equally easy to determine a decimal number from a BCD number. Start at the
right-most bit and break the code into groups of four bits. Then write the decimal
digit represented by each 4-bit group.

Example: Convert each of the following BCD codes to decimal:

(a) 10000110 (b) 001101010001 (c) 1001010001110000

Sol.

18/5/2021
26

2.9.1.2 Applications
Digital clocks, digital thermometers, digital meters, and other devices with seven-
segment displays typically use BCD code to simplify the displaying of decimal
numbers. BCD is not as efficient as straight binary for calculations, but it is
particularly useful if only limited processing is required, such as in a digital
thermometer.

2.9.2 BCD Addition


BCD is a numerical code and can be used in arithmetic operations. Addition is the
most important operation because the other three operations (subtraction,
multiplication, and division) can be accomplished by the use of addition. Here is
how to add two BCD numbers:

Step 1: Add the two BCD numbers.


Step 2: If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
Step 3: If a 4-bit sum is greater than 9, or if a carry out of the 4-bit group is
generated, it is an invalid result. Add 6 (0110) to the 4-bit sum in order to skip the
six invalid states and return the code to 8421. If a carry results when 6 is added,
simply add the carry to the next 4-bit group.

Example: Add the following BCD numbers:


(a) 0011 + 0100 (b) 00100011 + 00010101
(c) 10000110 + 00010011 (d) 010001010000 + 010000010111
Sol.

Note that in each case the sum in any 4-bit column does not exceed 9, and the
results are valid BCD numbers.

18/5/2021
27

Example: Add the following BCD numbers:


(a) 1001 + 0100 (b) 1001 + 1001
(c) 00010110 + 00010101 (d) 01100111 + 01010011
Sol.

18/5/2021
28

Advantages of BCD Codes Disadvantages of BCD Codes


1. BCD coding is similar to the 1. Each decimal number requires four
binary equivalent of decimal bits to be represented in the BCD
numbers 0–9. code.
2. BCD has no limitation for number 2. Arithmetic operations in BCD or
size. weighted codes are much
complicated as it deals with more
number of bits and also it has
different set of rules.
3. It is easier to convert decimal 3. BCD is less efficient than binary.
numbers from or to BCD than to
binary form.

2.10 Digital Codes


Many specialized codes are used in digital systems. You have just learned about
the BCD code; now let’s look at a few others. Some codes are strictly numeric,
like BCD, and others are alphanumeric; that is, they are used to represent numbers,
letters, symbols, and instructions. The codes introduced in this section are the Gray
code, the ASCII code, and the Unicode.

2.10.1 The Gray Code


The Gray code is unweighted and is not an arithmetic code; that is, there are no
specific weights assigned to the bit positions. The important feature of the Gray
code is that it exhibits only a single bit change from one code word to the next in
sequence. This property is important in many applications, such as shaft position
encoders, where error susceptibility increases with the number of bit changes
between adjacent numbers in a sequence. The table below is a listing of the 4-bit
Gray code for decimal numbers 0 through 15. Binary numbers are shown in the
table for reference. Like binary numbers, the Gray code can have any number of
bits. Notice the single-bit change between successive Gray code words. For
instance, in going from decimal 3 to decimal 4, the Gray code changes from 0010
to 0110, while the binary code changes from 0011 to 0100, a change of three bits.
The only bit change in the Gray code is in the third bit from the right: the other
bits remain the same.

18/5/2021
29

The single bit change characteristic of the Gray code minimizes the chance for
error.

2.10.1.1 Binary-to-Gray Code Conversion


Conversion between binary code and Gray code is sometimes useful. The
following rules explain how to convert from a binary number to a Gray code word:
1. The most significant bit (left-most) in the Gray code is the same as the
corresponding MSB in the binary number.
2. Going from left to right, add each adjacent pair of binary code bits to get the
next Gray code bit. Discard carries.

Example: The conversion of the binary number 10110 to Gray code is as


Sol.

The Gray code is 11101.

18/5/2021
30

2.10.1.2 Gray-to-Binary Code Conversion


To convert from Gray code to binary, use a similar method; however, there are
some differences. The following rules apply:
1. The most significant bit (left-most) in the binary code is the same as the
corresponding bit in the Gray code.
2. Add each binary code bit generated to the Gray code bit in the next adjacent
position. Discard carries.

Example: The conversion of the Gray code word 11011 to binary is as follows:
Sol.

The binary number is 10010.

Example: (a) Convert the binary number 11000110 to Gray code.


(b) Convert the Gray code 10101111 to binary.
Sol.

18/5/2021
31

2.10.2 Alphanumeric codes


In order to communicate, you need not only numbers but also letters and other
symbols. Alphanumeric codes are codes that represent numbers and alphabetic
characters (letters). At a minimum, an alphanumeric code must represent 10
decimal digits and 26 letters of the alphabet, for a total of 36 items. This number
requires six bits in each code combination because five bits are insufficient
(25 = 32). There are 64 total combinations of six bits, so there are 28 unused code
combinations.
We need spaces, periods, colons, semicolons, question marks, etc. We also
need instructions to tell the receiving system what to do with the information. With
codes that are six bits long, we can handle decimal numbers, the alphabet, and 28
other symbols.

2.10.3 ASCII
ASCII is the abbreviation for American Standard Code for Information
Interchange. Pronounced “askee,” ASCII is a universally accepted alphanumeric
code used in most computers and other electronic equipment. Most computer
keyboards are standardized with ASCII. When you enter a letter, a number, or
control command, the corresponding ASCII code goes into the computer.
ASCII has 128 characters and symbols represented by a 7-bit binary code.
Actually, ASCII can be considered an 8-bit code with the MSB always 0. This
8-bit code is 00 through 7F in hexadecimal. The first 32 ASCII characters are
nongraphic commands that are never printed or displayed and are used only for
control purposes. Examples of the control characters are “null,” “line feed,” “start
of the text,” and “escape.” The other characters are graphic symbols that can be
printed or displayed and include the letters of the alphabet (lowercase and
uppercase), the ten decimal digits, punctuation signs, and other commonly used
symbols.
Info Note: A computer keyboard has a dedicated microprocessor that constantly
scans keyboard circuits to detect when a key has been pressed and released. A
unique scan code is produced by computer software representing that particular
key. The scan code is then converted to an alphanumeric code (ASCII) for use by
the computer.

18/5/2021
32

2.10.3.1 The ASCII Control Characters


The first 32 codes in the (ASCII Table) below represent the control characters.
These are used to allow devices such as a computer and printer to communicate
with each other when passing information and data. The control key function
allows a control character to be entered directly from an ASCII keyboard by
pressing the control key (CTRL) and the corresponding symbol.

18/5/2021
33

Example Use ASCII table to determine the binary ASCII codes that are entered
from the computer’s keyboard when the following C language program statement
is typed in. Also express each code in hexadecimal. If (x > 5)
Sol.
The ASCII code for each symbol is found in ASCII table.

18/5/2021
Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

Chapter-2
BOOLEAN ALGEBRA

 Introduction:
 An algebra that deals with binary number system is called “Boolean Algebra”.
 It is very power in designing logic circuits used by the processor of computer system.
 The logic gates are the building blocks of all the circuit in a computer.
 Boolean algebra derives its name from the mathematician George Boole (1815-1864) who is
considered the “Father of symbolic logic”.
 Boolean algebra deals with truth table TRUE and FALSE.
 It is also called as “Switching Algebra”.

 Binary Valued Quantities – Variable and Constants:


 A variable used in Boolean algebra or Boolean equation can have only one of two variables.
The two values are FALSE (0) and TRUE (1)
 A Sentence which can be determined to be TRUE or FALSE are called logical statements or
truth functions and the results TRUE or FALSE is called Truth values.
 The variables which can store the truth values are called logical variables or binary valued
variables. These can store one of the two values 1 or 0.
 The decision which results into either YES (TRUE or 1) or NO (FALSE or 0) is called Binary
decision.

 Truth Table:
 A truth table is a mathematical table used in logic to computer functional values of logical
expressions.
 A truth table is a table whose columns are statements and whose rows are possible scenarios.
 Example: Consider the logical expression
Logical Statement: Meals = “Ram prefer rice and roti for the meal”
Y = A AND B (Logical Variables: Y, A, B, Logical Operator AND)
Ram Prefer Rice Ram Prefer Roti Meals
FALSE FALSE FALSE
FALSE TRUE FALSE
TRUE FALSE FALSE
TRUE TRUE TRUE

1|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 If result of any logical statement or expression is always TRUE or 1, it is called Tautology and
if the result is always FALSE or 0, it is called Fallacy.

 Logical Operators:
 There are three logical operator, NOT, OR and AND.
 These operators are now used in computer construction known as switching circuits.

 NOT Operator:
 The Not operator is a unary operator. This operator operates on single variable.
 The operation performed by Not operator is called complementation.
 The symbol we use for it is bar.
 𝐗 means complementation of X
 If X=1, X=0 If X=0, X=1
 The Truth table and the Venn diagram for the NOT operator is:
X X
1 0
0 1

 OR Operator:
 The OR operator is a binary operator. This operator operates on two variables.
 The operation performed by OR operator is called logical addition.
 The symbol we use for it is ‘+’.
 Example: X + Y can be read as X OR Y
 The Truth table and the Venn diagram for the NOT operator is:
X Y X+Y
0 0 0
0 1 1
1 0 1
1 1 1

 AND Operator:
 The AND operator is a binary operator. This operator operates on two variables.
 The operation performed by AND operator is called logical multiplication.
 The symbol we use for it is ‘.’.
 Example: X . Y can be read as X AND Y
2|Page Keerthi Kumar H.M
Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 The Truth table and the Venn diagram for the NOT operator is:
X Y X.Y
0 0 0
0 1 0
1 0 0
1 1 1

 Evaluation of Boolean Expression using Truth Table:


 To create a truth table, follow the steps given below.
 Step 1: Determine the number of variables, for n variables create a table with 2n rows.
o For two variables i.e. X, Y then truth table will need 22 or 4 rows.
o For three variables i.e. X, Y, Z, then truth table will need 23 or 8 rows.
 Step 2: List the variables and every combination of 1 (TRUE) and 0 (FALSE) for the given
variables
 Step 3: Create a new column for each term of the statement or argument.
 Step 4: If two statements have the same truth values, then they are equivalent.

 Example: Consider the following Boolean Expression F=X+ 𝐘


 Step 1: This expression as two variables X and Y, then 22 or 4 rows.
 Step 2: List the variables and every combination of X and Y.
 Step 3: Create a new column 𝐘 of the statement, and then fill the truth values of Y in that
column.
 Step 4: The final column contain the values of X+ 𝐘.
X Y Y X+ 𝐘
0 0 1 1
0 1 0 0
1 0 1 1
1 1 0 1

 Exercise Problems:
1. Prepare a table of combination for the following Boolean algebra expressions.
a) X Y + XY b) XY Z + X Y Z
2. Verify using truth table for the following Boolean algebra.
a) X + XY = X b) X + Y = X . Y

3|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Boolean Postulates:
 The fundamental laws of Boolean algebra are called as the postulates of Boolean algebra.
 These postulates for Boolean algebra originate from the three basic logic functions AND, OR
and NOT.
 Properties of 0 and 1:
I. If X ≠ 0 then X = 1, and If X ≠1 then X = 0
II. OR relation ( Logical Addition)
a. 0 + 0 = 0 c. 1 + 0 = 1
b. 0 + 1 = 1 d. 1 + 1 = 1
III. AND relation ( Logical Multiplication)
a. 0 . 0 = 0 c. 1 . 0 = 0
b. 0 . 1 = 0 d. 1 . 1 = 1
IV. Complement Rules
a. 0 = 1 b. 1 = 0
 Principle of Duality Theorem:
 This is very important principle used in Boolean algebra.
 Principle of Duality states that;
o Changing each OR sign (+) to an AND sign (.)
o Changing each AND sign (.) to an OR sign (+)
o Replacing each 0 by 1 and each 1 by 0.
 The derived relation using duality principle is called dual of original expression.
 Example: Take postulate II, related to logical addition:
1) 0 + 0 = 0 2) 0 + 1 = 1 3) 1 + 0 = 1 4) 1 + 1 = 1
2. Now working according to above relations, + is changed to . and 0’s replaced by 1’s
a) 1 . 1 = 1 b) 1 . 0 = 0 c) 0 . 1 = 0 d) 0 . 0 = 0
 which are nothing but same as that of postulate III related to logical multiplication.
 So 1, 2, 3, 4, are the duals of a, b, c, d.
 Example: Find the duals for the following Boolean Expression
Sl No Boolean Expression Duals
1 X+0=X X.1=X
2 X+1=1 X.0=0
3 X.X=0 X+X=1
4 X . ( Y + Z) X + ( Y . Z)
5 X + X.Y = X + Y X.(X + Y) = X.Y

4|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Boolean Theorems:
 Boolean Theorem can be proved by substituting all possible values of the variable that are 0
and 1.
 This technique of proving theorem is called Proof by perfect induction.
Sl No Theorem Sl No Theorem
Properties of 0 and 1 Associative Law
1 0+X=X 12 X .(Y.Z) = (X.Y).Z
2 1+X=1 13 (X+Y).Z = X+(Y.Z)
3 0.X=0 Distributive Law
4 1.X=X 14 X.(Y+Z) = X.Y + X.Z
Indempotence Law 15 X+Y.Z = (X+Y).(X+Z)
5 X+X=X Absorption Law
6 X.X=X 16 X + XY = X
Complementary Law 17 X(X+Y) = X
7 X+X=1 18 XY + XY = X
8 X.X=0 19 (X+Y)(X+Y)= X
Involution Law 20 X+XY = X+Y
9 X=X 21 X(X+Y) = XY
Commutative Law
10 X+Y=Y+X
11 X.Y=Y.X
 Theorem 1: 0+X=X
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =0+X then LHS =0+X
0 X 0+X
=0+0 =0+1
0 0 0
=0 =1
0 1 1
= RHS = RHS

 Theorem 2: 1+X=1
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =1+X then LHS =1+X
1 X 1+X
=1+0 =1+1
1 0 1
=1 =1
1 1 1
= RHS = RHS
5|Page Keerthi Kumar H.M
Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Theorem 3: 0.X=0
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =0.X then LHS =0.X
0 X 0.X
=0.0 =0.1
0 0 0
=0 =0
0 1 0
= RHS = RHS

 Theorem 4: 1.X=X
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =1.X then LHS =1.X
1 X 0.X
=1.0 =1.1
1 0 0
=0 =1
1 1 1
= RHS = RHS

 Indempotence Law: “This law states that when a variable is combines with itself
using OR or AND operator, the output is the same variable”.

 Theorem 5: X+X=X
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =X+X then LHS =X+X
X X X+X
=0+0 =1+1
0 0 0
=0 =1
1 1 1
= RHS = RHS

 Theorem 6: X.X=X
Proof: If X = 1 Using Truth Table
Proof: If X = 0
then LHS =X.X
then LHS =X.X X X X.X
=1.1
=0+0 0 0 0
=1
=0 1 1 1
= RHS
= RHS

 Complementary Law: “This law states that when a variable is And ed with its
complement is equal to 0 and a variable is OR ed with its complement is equal to 1”.

6|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Theorem 7: X+𝐗=1
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =X+X then LHS =X+X
X 𝐗 X+𝐗
=0+1 =1+0
0 1 1
=1 =1
1 0 1
= RHS = RHS

 Theorem 8: X.𝐗=0
Proof: If X = 0 Proof: If X = 1 Using Truth Table
then LHS =X.X then LHS =X.X
X 𝐗 X.𝐗
=0.1 =1.0
0 1 0
=0 =0
1 0 0
= RHS = RHS

 Involution Law: “This law states that when a variable is inverted twice is equal to
the original variable”.
 Theorem 9: 𝐗=X
Proof: If X = 0, then X = 1 Using Truth Table
Take complement again, then X = 0 i.e. X 𝐗
X 𝐗
If X = 1, then X = 0
0 1 0
Take complement again, then X = 1 i.e. X 1 0 1

 Commutative Law: “This law states that the order in which two variable are Or ed
or AND ed make no difference”.

 Theorem 10: X+Y=Y+X


Proof: If Y = 0 Proof: If Y = 1 Using Truth Table
then LHS =X+Y then LHS =X+Y
X Y X+Y Y+X
=X+0 =X+1
0 0 0 0
=X =1
0 1 1 1
RHS =Y+X RHS =Y+X
1 0 1 1
=0+X =1+X
1 1 1 1
=X =1
Therefore LHS = RHS Therefore LHS = RHS

7|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Theorem 11: X.Y=Y.X


Proof: If Y = 0 Proof: If Y = 1 Using Truth Table
then LHS =X.Y then LHS =X.Y
X Y X.Y Y.X
=X.0 =X.1
0 0 0 0
=0 =X
0 1 0 0
RHS =Y.X RHS =Y.X
1 0 0 0
=0.X =1.X
1 1 1 1
=0 =X
Therefore LHS = RHS Therefore LHS = RHS

 Associative Law: “This law allows the removal of brackets from an expression and
regrouping of the variables”.

 Theorem 12: X.(Y.Z) = (X.Y).Z


Proof: If Y = 0 Proof: If Y = 1 Using Truth Table
LHS = X.(Y.Z) LHS = X.(Y.Z)
X Y Z XY YZ X.(Y.Z) (X.Y).Z
= X.(0.Z) = X.(1.Z)
0 0 0 0 0 0 0
= X.0 = X.Z
0 0 1 0 0 0 0
=0 = XZ
0 1 0 0 0 0 0
RHS = (X.Y).Z RHS = (X.Y).Z
0 1 1 0 1 0 0
= (X.0).Z = (X.1).Z
1 0 0 0 0 0 0
= 0.Z = X.Z
1 0 1 0 0 0 0
=0 = XZ
1 1 0 1 0 0 0
Therefore LHS = RHS Therefore LHS = RHS
1 1 1 1 1 1 1

 Theorem 13: X+(Y+Z) = (X+Y)+Z


Proof: If Y = 0 Proof: If Y = 1 Using Truth Table
LHS = X+(Y+Z) LHS = X+(Y+Z)
X Y Z X+Y Y+Z X+(Y+Z) (X+Y)+Z
= X+(0+Z) = X+(1+Z)
0 0 0 0 0 0 0
= X+Z = X+1 0 0 1 0 1 1 1
=1 0 1 0 1 1 1 1
RHS = (X+Y)+Z RHS = (X+Y)+Z 0 1 1 1 1 1 1
= (X+0)+Z = (X+1).Z 1 0 0 1 0 1 1
= X+Z = 1+Z 1 0 1 1 1 1 1
1 1 0 1 1 1 1
Therefore LHS = RHS =1
1 1 1 1 1 1 1
Therefore LHS = RHS

8|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Distributive Law: “This law allows the multiplying or factoring out an expression”.
 Theorem 14: X.(Y+Z) = XY + XZ
Proof: If X = 0 Proof: If X = 1
LHS = X.(Y+Z) LHS = X.(Y+Z)
= 0.(Y+Z) = 1.(Y+Z)
=0 = Y+Z
RHS = XY + XZ RHS = XY + XZ
= 0.Y+0.Z = 1.Y+1.Z
=0 = Y+Z
Therefore LHS = RHS Therefore LHS = RHS

 Theorem 15: (𝑋 + 𝑌) (𝑋 + 𝑍) = 𝑋 + 𝑌𝑍
LHS: (𝑋 + 𝑌) (𝑋 + 𝑍) = 𝑋𝑋 + 𝑋𝑍 + 𝑋𝑌 +𝑌𝑍
= 𝑋 + 𝑋𝑍 + 𝑋𝑌 + 𝑌𝑍
= 𝑋(1 + 𝑍) + 𝑋𝑌 + 𝑌𝑍
Important
= 𝑋 + 𝑋𝑌 + 𝑌𝑍
2 Marks
= 𝑋(1 + 𝑌) + 𝑌𝑍
= 𝑋 + 𝑌𝑍
= RHS

 Absorption Law: “This law enables a reduction of complicated expression to a


simpler one by absorbing common terms”.
17) X (X+Y) = X 18) XY + X𝐘 = X
16) X+XY = X
LHS = X (X+Y) LHS = XY + XY
LHS = X + XY
= XX + XY = X(Y+Y)
= X (1 + Y)
= X + XY = X.1
=X
= X (1+Y) =X
= RHS
=X = RHS
19) (X+Y) (X+𝐘)= X
20) X + 𝐗Y = X+Y 21) X (𝐗+Y) = XY
LHS = (X+Y) (X+Y)
LHS = X + XY LHS = X (X+Y)
= XX + XY + XY +YY
= (X + X ) (X+Y) = X. X + X.Y
= X + XY + XY + 0
= 1. (X+Y) = 0 + XY
= X (1 + Y + Y)
= X+Y = XY
= X. 1
= RHS = RHS
=X

9|Page Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 DeMorgan’s Theorem:
 DeMorgan’s First Theorem:
o Statement: “When the OR sum of two variables is inverted, this is same as inverting
each variable individually and then AND ing these inverted variables”
o This can be written as 𝐗 + 𝐘 = 𝐗. 𝐘
Important
o We can prove the DeMorgan’s First theorem by using Truth Table is 5 Marks
X Y 𝐗 𝐘 X+Y 𝐗 + 𝐘 𝐗. 𝐘
0 0 1 1 0 1 1
0 1 1 0 1 0 0
1 0 0 1 1 0 0
1 1 0 0 1 0 0

o Compare the column 𝐗 + 𝐘 and 𝐗. 𝐘. Both of these are identical. Hence the DeMorgan’s
first theorem is proved.
 DeMorgan’s Second Theorem:
o Statement: “When the AND product of two variables is inverted, this is same as
inverting each variable individually and then OR ing these inverted variables”
o This can be written as 𝐗. 𝐘 = 𝐗+𝐘
o We can prove the DeMorgan’s Second theorem by using Truth Table is:
X Y 𝐗 𝐘 X.Y 𝐗. 𝐘 𝐗+𝐘
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0

o Compare the column 𝐗. 𝐘 and 𝐗+𝐘. Both of these are identical. Hence the DeMorgan’s
Second theorem is proved.
 Application of DeMorgan’s Theorem:
o It is used in simplification of Boolean expression.
o DeMorgan’s law commonly apply to text searching using Boolean operators AND, OR and
NOT.
o It is useful in the implementation of the basic gates operations with alternative gates.

10 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Simplification of Boolean Expression:


 Simplification of Boolean expression can be achieved by two popular methods:
o Algebraic Manipulation
Important
o Karnaugh Maps
2 Marks
 Algebraic Manipulation:

1) 𝐗 𝐘 Z + 𝐗 Y Z + X 𝐘 2) XYZ + XYZW + XZ

=XYZ+XYZ+XY = XYZ (1 + W) + XZ

= XZ (Y + Y) + X Y = XYZ . 1 + XZ

= XZ 1 + X Y = XZ (Y + 1)
= XZ
= XZ + X Y
3) Z(Y+Z)(X+Y+Z)
= (ZY + ZZ) (X+Y+Z) 4) 𝐗 + 𝐗 𝐘 + 𝐘 + 𝐗 + 𝐘 𝐗 𝐘

= (ZY + Z) (X+Y+Z) =X+XY+ Y+XXY+YXY


= Z(X+Y+Z) [Theorem 16 X+XY=Z] =X+XY+ Y+ 0+0
= ZX + ZY + ZZ = (X + X) (X + Y) + Y
= ZX + ZY + Z = 1 (X + Y) + Y
= Z(X+Y+1) =X+Y+Y
= Z(1) =X+1
=Z =1

 Exercise Problems: Simplify using Algebraic Manipulation


1) (A + B). A + B

2) AB + AB + A B

3) B(A+C) + AB + BC + C
 Exercise Problems: Solving using DeMorgan’s Theorem
1) (A + C). B + D

2) AB + C)

11 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Minterm:
 Minterm is a product of all the literal (with or without bar) within the logic system.
 (OR) A single variable or the logical product of several variables. The variables may or may not
be complemented.
 A variable may appear either in its normal form (X) or in its complement form (X)
 If a variable value is 0 then its complemented otherwise it is in its normal form.
 For example, if you have two variables X & Y, there are four possible combination can be formed
with AND operation. Each of these four AND operations represents one of the Boolean
expressions terms and is called a Minterm or a standard product.
X Y Minterm Designation
0 0 XY m0
0 1 XY m1
1 0 XY m2
1 1 XY m3
 A symbol for each Minterm is also shown in the table and is of the form mj where j denotes the
decimal equivalent of the binary number of the Minterm designated.
 For example, the Minterm 𝐗 𝐘 𝐙 whose combination is 1 1 0 can be written as m6 as decimal
equivalent of 1 1 0 is 6.
 A Boolean expression may be represented from a given truth table by forming a Minterm for each
combination of the variables which produces as 1 in the function, and then taking the OR
(Logical Addition) of all those terms.
 Assume the truth table
X Y Z Output Minterm Designation
0 0 0 0 XYZ m0
0 0 1 0 XYZ m1
0 1 0 1 XYZ m2 Minterm
0 1 1 1 XYZ Results 1
m3
1 0 0 0 XYZ m4
1 0 1 0 XYZ m5
1 1 0 1 XYZ m6
1 1 1 0 XYZ m7
 The Boolean function of truth table is obtained by OR ing (Add) three Minterm i.e. 010 (X Y Z),
011 (X Y Z), 110 (X Y Z). Since each of these Minterm results is 1 (output).
12 | P a g e Keerthi Kumar H.M
Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

f (X, Y, Z) = 𝐗 𝐘 𝐙 + 𝐗 Y Z + 𝐗 𝐘 𝐙 = m2 + m3 + m6
 The above Boolean function is the sum of three product terms. This type of expression is known as
Sum of Product (SOP) expression.
f (X, Y, Z) = ∑ (2, 3, 6)
 Where f is a Boolean function with three variables (X, Y, Z) and it can be read as function f is sum
of 2nd, 3rd, and 6th Minterm.
 Sum of Product (SOP): A Sum of product expression is a product term or several product terms
logically added.

 Find the Minterm designation for the following:


1) X Y Z
Binary Equivalent =100
Decimal Equivalent = 1 x 22 + 0 x 21 + 0 x 20
=4+0+0
=4
So, 𝐗 𝐘 𝐙 = m4
2) A B C D
Binary Equivalent =1010
Decimal Equivalent = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20
=8+0+2+0
= 10
So, 𝐀 𝐁 𝐂 𝐃 = m10

 What are the fundamental products for each of the input words; ABCD = 0010, ABCD =110,

ABCD=1110. Write SOP expression.


Solution: The SOP expression is: 𝐀 𝐁 𝐂 𝐃 + A B 𝐂 + A B C 𝐃

 Maxterm:
 Maxterm is a sum of all the literal (with or without bar) within the logic system.
 (OR) A single variable or the logical sum of several variables. The variables may or may not be
complemented.
 A variable may appear either in its normal form (X) or in its complement form (X)
 If a variable value is 1 then its complemented otherwise it is in its normal form.
 For example, if you have two variables X & Y, there are four possible combination can be formed
with OR operation. Each of these four OR operations represents one of the Boolean expressions

13 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

terms and is called a Minterm or a standard product.


X Y Minterm Designation
0 0 X+Y M0
0 1 X+ Y M1
1 0 X+Y M2
1 1 X+ Y M3
 A symbol for each Maxterm is also shown in the table and is of the form Mj where j denotes the
decimal equivalent of the binary number of the Maxterm designated.
 For example, the Maxterm 𝐗 + 𝐘 + 𝐙 whose combination is 0 0 1 can be written as M1 as decimal
equivalent of 0 0 1 is 1.
 A Boolean expression may be represented from a given truth table by forming a Maxterm for each
combination of the variables which produces as 0 in the function, and then taking the AND
(Logical Multiplication) of all those terms.
 Assume the truth table
X Y Z Output Minterm Designation
0 0 0 0 X+Y+Z M0
0 0 1 0 𝐗+𝐘+ 𝐙 M1
0 1 0 1 X+Y+Z M2 Maxterm
0 1 1 1 X+ Y+Z M3 Results 0

1 0 0 0 𝐗+Y+Z M4
1 0 1 0 𝐗+ 𝐘+𝐙 M5
1 1 0 1 X+ Y+Z M6
1 1 1 0 𝐗+ 𝐘+ 𝐙 M7
 The Boolean function of truth table is obtained by AND ing (Multiply) five Maxterm i.e. 000, 001,
100, 101, 111. Since each of these Maxterm results is 0 (output).
f (X, Y, Z) = (X + Y + Z)(𝐗 + 𝐘 + 𝐙)( 𝐗 + Y + Z)( 𝐗 + 𝐘 + 𝐙)( 𝐗 + 𝐘 + 𝐙)= M0.M1.M4.M5.M7
 The above Boolean function is the product of three sum terms. This type of expression is known as
Product of Sum (POS) expression.
f (X, Y, Z) = π (0, 1, 4, 5, 7)
 Where f is a Boolean function with three variables (X, Y, Z) and it can be read as function f is
product of 0th, 1st, 4th, 5th and 7th Maxterm.
 Product of Sum (POS): A product of sum expression is a sum term or several sum terms
logically multiplied.

14 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Canonical Form:
 Boolean expression expressed as sum of Minterms or product of Maxterms are called
canonical forms.
 For example, the following expressions are the Minterm canonical form and Maxterm canonical
form of two variables X and Y.
o Minterm Canonical = f(X, Y) = X + X Y + X Y + X Y + X Y
o Maxterm Canonical = f(X, Y) = X + Y X + Y (X + Y)
 The Minterm canonical expression is the sum of all Minterms. Each Minterm contain all the
variables.
 The maxterm canonical expression is the product of all Maxterms. Each Maxterm contain all the
variables.

 Conversion of SOP into Canonical form:


1) Convert the Boolean function f(X, Y) = X + X Y into canonical form.
 Solution: The given Boolean function f(X, Y) = X + X Y ------ (i)
 It has two variables and sum of two Minterms. The first term X is missing one variable. So to
make it of two variables it can be multiplied by (Y + Y), as (Y + Y) = 1.
Therefore, X = X Y + Y = XY + XY
 Substitute the value of X in (i) we get
f(X, Y) = X Y + X Y + X Y
 Here, the term X Y appear twice, according to theorem X+X =X, it is possible to remove one o
them.
f(X, Y) = X Y + X Y
 Rearrange the Minterm in ascending order
f(X, Y) = X Y + X Y
= m 2 + m3
f(X, Y) = ∑ (2, 3)
2) Convert the Boolean function f(X, Y) = X + Y Z into canonical form.

 Conversion of POS into Canonical form:


1) Convert the Boolean function F(X, Y, Z) = X + Y (Y + Z) into canonical form.
 Solution: The given Boolean function
F(X,Y,Z) = X + Y (Y + Z) ------ (i)
 It has three variables and product of two Maxterms. Each Maxterm is missing one variable.

15 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 The first term can be written as


X+Y = (X+Y+Z. Z ) Since Z. Z = 0
 Using distributive law (X + YZ) = (X + Y) (X + Z), we can write
X+Y = (X+Y+Z) (X+Y+ Z ) ------ (ii)
 The Second term can be written as
Y + Z = (Y+Z+X. X )
Y+Z = (Y+Z+X) (Y+Z+X ) ------ (iii)
 Substitute (ii) and (iii) in (i) we get
F(X, Y, Z) = (X+Y+Z) (X+Y+ Z ) (Y+Z+X) (Y+Z+X )
 The term (X+Y+Z) appear twice and according to theorem X . X = X
F(X, Y, Z) = (X+Y+Z) (X+Y+ Z ) (Y+Z+X )
 Rearrange the Maxterm in ascending order.
F(X, Y, Z) = (X+Y+Z) (X+Y+ Z ) (X + Y + Z)
= M0. M1. M4
F(X, Y, Z) = π (0, 1, 4)
2) Convert the Boolean function F (A, B, C) = AB + A C into product of sum (POS) form.

 Karnaugh Map: Important


5 Marks
 A graphical display of the fundamental products in a truth table.
 Fundamental Product: The logical product of variables and complements that produces a high
output for a given input condition.
 The map method provides simple procedure for minimizing the Boolean function.
 The map method was first proposed by E.W. Veitch in 1952 known as “Veitch Diagram”.
 In 1953, Maurice Karnaugh proposed “Karnaugh Map” also known as “K-Map”.

 Construction of K-Map:
 The K-Map is a pictorial representation of a truth table made up of squares.
 Each square represents a Minterm or Maxterm.
 A K-Map for n variables is made up of 2n squares.

 Single Variable K-Map:


 A one variable K-Map is shown in the following figure.
 The one variable Boolean expression is of the form f(A).
 There are two Minterms (A and A ) for one variable.

16 | P a g e Keerthi Kumar H.M


Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Hence the map consists of 2 squares (i.e. 2n square, 21 = 2 square)


A A A A 0 1 A
A A 0 1 m0 m1
Minterm Basic Labelling

 In one variable K-map:


o One square represents one Minterm.
o Two adjacent squares represents a function which is always true i.e. f (A) = 1.

 Two Variable K-Map:


 The two variable Boolean expressions are of the form f (A, B).
 There are four Minterms ( A B , AB, AB and AB for two variable.
 Hence the map consists of 4 squares (i.e. 2n square, 22 = 4 square)
B B 0 1
A AB AB 0 00 01 A m0 m1
A AB AB 1 10 11 A m2 m3
Minterm Basic Labelling

 Three Variable K-Map:


 The three variable Boolean expressions are of the form f (A, B, C).
 There are eight Minterms ( ABC , ABC, ABC, ABC, ABC , ABC, ABC, and ABC) for three
variable.
 Hence the map consists of 8 squares (i.e. 2n square, 23 = 8 square)
BC BC
BC BC BC BC 00 01 11 10
A A ABC ABC ABC ABC A 0 000 001 011 010
A ABC ABC ABC ABC 1 100 101 111 110
Minterms Basic Labelling
 Note: The ordering of variable i.e. 00, 01, 11 & 10 is in gray (reflected binary code) one should
not use straight binary code i.e. 00, 01, 10, 11. The straight binary code was used in Veitch
diagram but Mr. Karnaugh modified the veitch diagram and use reflected binary code.

 Four Variable K-Map: Important


5 Marks
 The four variable Boolean expressions are of the form f (A, B, C, D).
 There are sixteen Minterms for four variables.
17 | P a g e Keerthi Kumar H.M
Chapter 2- Boolean Algebra II PUC, MDRPUC, Hassan

 Hence the map consists of 8 squares (i.e. 2n square, 24 = 16 square).


 The rows and columns are numbered in a reflected code system.

CD CD

CD CD CD CD 00 01 11 10

AB ABCD ABCD ABCD ABCD 00 0000 0001 0011 0010

AB AB ABCD ABCD ABCD ABCD AB 01 0100 0101 0111 0110

AB ABCD ABCD ABCD ABCD 11 1100 1101 1111 1110

AB ABCD ABCD ABCD ABCD 10 1000 1001 1011 1010

Minterms Basic Labelling

CHAPTER 2 – BOOLEAN ALGEBRA BLUE PRINT


VSA (1 marks) SA (2 marks) LA (3 Marks) Essay (5 Marks) Total
- 02 Question - 01 Question 03 Question
- Question no 11, 12 - Question no 27 09 Marks

Important Questions
 2 Marks Question:
1. Prove that X + XY = X [March 2015, March 2017]
2. Define Minterm and Maxterm [March 2015, March 2016]
3. State and prove Involution law. [June 2015]
4. State and prove Commutative law using truth table. [June 2016]
5. What is principle of duality? Give Example [June 2015, March 2017]
6. Prove algebraically that (𝑋+𝑌) (𝑋+𝑍)=𝑋+𝑌𝑍 [March 2016]
7. Prove: (X+Y) (X+(Y) = X [June 2016]
8. Prove algebraically that 𝑋+X𝑌=𝑋+𝑌
9. Draw a general K-map for four variables A, B, C and D.
 5 Marks Question:
1. Give the Boolean function F (W, X, Y, Z) = ∑ (0, 4, 8, 9, 10, 11, 12, 13, 15). Reduce it by
using K-Map. [March 2015]
2. Reduce F (A, B, C, D) = ∑ (1, 2, 3, 4, 5, 7, 9, 11, 12, 13, 14, 15) using K-Map [June 2015]
3. Using K-Map, Simplify the following expression in four variables
F (A, B, C, D) = m1 + m2 + m4 + m5 + m9 + m11 + m12 + m13. [March 2016]
18 | P a g e Keerthi Kumar H.M

You might also like