0% found this document useful (0 votes)
34 views145 pages

CA - Unit 1 - SEP-1

The document provides an overview of number systems used in computer architecture, including binary, octal, decimal, and hexadecimal systems. It explains the positional value of digits in these systems and outlines methods for converting between them, as well as the concept of complements in binary arithmetic. Additionally, it covers basic binary arithmetic operations and the use of 2's complement for handling positive and negative numbers.

Uploaded by

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

CA - Unit 1 - SEP-1

The document provides an overview of number systems used in computer architecture, including binary, octal, decimal, and hexadecimal systems. It explains the positional value of digits in these systems and outlines methods for converting between them, as well as the concept of complements in binary arithmetic. Additionally, it covers basic binary arithmetic operations and the use of 2's complement for handling positive and negative numbers.

Uploaded by

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

COMPUTER ARCHITECTURE

UNIT – I

By: Amruta Gadad


Assistant Professor
St. Francis De Sales College(Autonomous)
What is Number System?
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

2
Decimal Number System
 Decimal number system is a base 10 number system having 10 digits from 0
to 9.
 This means that any numerical quantity can be represented using these 10
digits.
 Decimal number system is also a positional value system.
 This means that the value of digits will depend on its position
 Say we have three numbers – 734, 971 and 207. The value of 7 in all three
numbers is different−
 In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 102
 In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 101
 In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

3
Binary Number System

 The easiest way to vary


instructions through electric signals
is two-state system – on and off. In any binary number, the rightmost digit
 On is represented by 1 and off by is called least significant bit (LSB) and
0, though 0 is not actually no signal leftmost digit is called most significant
but signal at a lower voltage. bit (MSB).
 The number system having just
these two digits – 0 and 1 – is
called binary number system.

4
Octal Number System

 Octal number
system has eight
digits – 0, 1, 2, 3, 4, 5,
6 and 7.
 Octal number system
Decimal equivalent of any octal number is sum of
is also a positional
product of each digit with its positional value.
value system with 7268 = 7×82 + 2×81 + 6×80
where each digit has = 448 + 16 + 6
its value expressed in = 47010
powers of 8

5
Hexadecimal Number System
 Hexadecimal number
system has 16 symbols – 0
to 9 and A to F where A is
equal to 10, B is equal to 11
and so on till F.

Decimal equivalent of any


 Hexadecimal number system
hexadecimal number is sum of
is also a positional value
system with where each product of each digit with its
positional
27FB value.
16 = 2×16 + 7×16 + 15×16 +
3 2 1
digit has its value expressed
in powers of 16, 10×160
= 8192 + 1792 + 240 +10
= 10234
Here A is
10 10, B is 11, C is 12, D is
13, E is 14 and F is 15.

6
Number System Conversions
Binary to Decimal
Decimal conversion is The binary number
done to convert a system is used in
number given in the computers and
binary number electronic systems
system to its to represent data
equivalent value in and it consists of
the decimal number only two digits
The binary number which are 0 and 1.
system.
system has a base of 2
because it has only two
digits to represent any
number.

8
Binary to Decimal
 Step 2: Now multiply each digit in the binary number starting from the right with
its respective weight based on its position and evaluate the product.

 Step 3: Now, express the binary number as a decimal number: 1011012 = 4510

9
Exercises
 Convert 11102, from binary to decimal using the binary to decimal
formula.
 Convert 11112, from binary to decimal using the binary to decimal
formula.
 Convert 10102, from binary to decimal using the binary to decimal
formula.

10
Decimal to Binary Then, the
Decimal to remainders are
binary conversion is noted down till we
done through get 0 as the final
various methods. quotient. After this
One of the methods step, these
to convert decimal remainders are
to binary is by written in reverse
dividing the given order to get the
decimal number binary value of the
recursively by 2. given decimal
number.

11
Decimal to binary conversion

 To convert numbers
from decimal to binary,
the given decimal
number is divided
repeatedly by 2 and
the remainders are
noted down till we get
0 as the final quotient.

12
Exercises
 25
 39
 72
 55

13
Decimal to Octal

 In the number system, each of the types has its own base number i.e. octal
number has a base number of 8 and the decimal number has a base number of
10.
 To convert decimal to octal, we need to divide the decimal number by the octal
base number 8 and write the acquired remainder in reverse to derive at the
equivalent octal number.

14
Convert Decimal to Octal

 In this method, the decimal number is divided by 8, each time a reminder is


obtained from the previous digit.
 The first remainder obtained is the least significant digit(LSD) and the last
remainder is the most significant digit(MSD).
 Once the quotient is less than 8, we obtain the octal number by writing the
remainder in reverse order.

15
Example
 Convert the decimal number (85)10 to an octal number.
 Step 1: Check if the decimal number is less than 8. If yes, the octal number is
the same. If no, then proceed forward. In this case, 85 is more than 8 so let's go
to step 2.
 Step 2: Divide 85 by 8 (octal base number).
 Note down the quotient and the remainder in the quotient-remainder form.
Repeat this process (dividing the quotient again by 8) until we get the quotient
to be less than 8.

16
Example

17
Exercises
 67
 99
 350

18
Octal to decimal

19
20
Exercises
 (121)8
 (454)8

21
Hexadecimal Number System

 The base of a hexadecimal system is 16. The 16 symbols involved in this


system include 10 decimal digits and the first six letters of the English
alphabet, i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Here, the alphabets
can be treated 10, 11, 12, 13, 14 and 15, respectively.

22
Conversion from Hex to Decimal
 Convert 7CF (hex) to decimal.
 Given hexadecimal number is 7CF.
 In hexadecimal system,
 7=7
 C = 12
 F = 15
 To convert this into a decimal number system, multiply each digit with the powers
of 16 starting from units place of the number.
 7CF = (7 × 162) + (12 × 161) + (15 × 160)
 = (7 × 256) + (12 × 16) + (15 × 1)
 = 1792 + 192 + 15
 = 1999

23
 Convert (1DA6)16 to decimal.
 Convert (E8B)16 to decimal system.
 (2bf)16

24
Conversion from Decimal to Hexadecimal number
system

 Take decimal number as dividend.


 Divide this number by 16 (16 is base of hexadecimal so
divisor here).
 Store the remainder in an array (it will be: 0 to 15 because
of divisor 16, replace 10, 11, 12, 13, 14, 15 by A, B, C, D, E,
F respectively).
 Repeat the above two steps until the number is greater
than zero.
 Print the array in reverse order (which will be equivalent
hexadecimal number of given decimal number).

25
Convert 60010 into a hexadecimal number.

26
Binary to octal Conversion

27
Octal to Binary Conversion

28
Hexa Decimal to Binary Conversion

29
Binary to Hexa Decimal Number
(1000101)2

Start from the right and divide into 4 Blocks


0100 0101

30
Octal to Hexa Decimal Number
 Step1: Convert Octal to Binary
 Group 4 bits together and represent equivalent hexa decimal digit

31
Hexa decimal to Octal conversion
 Step1: Convert Hexa decimal to binary
 Step2: Regrouping the bits into 3 bits

32
Complements
Complements
 complement number system An alternative representation of numbers in
a fixed-radix number system
 Complements are used in the digital computer in order to simplify the
subtraction operation and for logical manipulation.
 For Each Radix system( Radix r represents the number system)
 There are 2 types of Complements(r, r-1) complements
 r-radix complement,r-1=Diminished radix complement.

34
Binary system Complements
 There are 2 complements in Binary System
1. 1’s Complement
2. 2’s complement

35
1’s Complement
 To generate a 1’s complement for any given binary number, you only
need to invert that number.
 For a binary number like 110010, the 1’s complement would be 001101.

36
2’s complement
 To generate a 2’s complement for any given binary number, you need to invert
it. Then you need to add 1 to the LSB (Least Significant Bit) of the generated
result.
 1’s complement + 1

37
Complements of numbers
The r and r-1’s complement can be found for all the number systems.
Basically there are 4 number systems and hence r and r-1’s complements can
be found for only these 4 number systems.
r-1 )’s Complement
•Given a number N in base r having n digits,
•the (r- 1)’s complement of N is defined as
(rn - 1) - N
•For decimal numbers the
base or r = 10 and r- 1= 9,
•so the 9’s complement of N 9 9 9 9 9
is (10n-1)-N
•99999……. - N
- Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
9’s complement Examples

2- Find the 9’s complement of 546700 and 9 9 9 9 9 9


12389

The 9’s complement of 546700 is 999999 -


- 5 4 6 7 0 0

546700= 453299 4 5 3 2 9 9

and the 9’s complement of 12389 is


99999- 12389 = 87610. 9 9 9 9 9

- 1 2 3 8 9

8 7 6 1 0

Note: Similarly we can find the r and (r-1)’s complements for any given number of
octal and hexadecimal numbers also
r’s Complement

•Given a number N in base r having n digits,


•the r’s complement of N is defined as
rn - N.

•For decimal numbers the


base or r = 10,
1 0 0 0 0 0
•so the 10’s complement of N
is 10n-N. - Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit

•100000……. - N
Number Systems Arithmetic
Binary Arithmetic

 Binary Arithmetic includes the basic operation


like
1. Binary addition
2. Binary Subtraction
3. Binary multiplication
4. Binary Division.

42
Binary Addition

 The addition of 2 Binary numbers is performed exactly same as the


decimal number addition.

43
Addition using 2’s complement
 The 2’s complement is most commonly used code for processing positive
and negative binary numbers. There are 4 different cases
1. Both the numbers are positive
2. Larger of 2 numbers are positive
3. The larger of 2 numbers are negative
4. Both the numbers are negative

44
 Case 2: Larger of 2 numbers are positive
Example: 1101 and -1001
 First, find the 2's complement of the negative number 1001. So, for finding 2's complement,
change all 0 to 1 and all 1 to 0 or find the 1's complement of the number 1001. The 1's
complement of the number 1001 is 0110, and add 1 to the LSB of the result 0110. So the 2's
complement of number 1001 is 0110+1=0111
 Add both the numbers, i.e., 1101 and 0111;
1101+0111=1 0100
 By adding both numbers, we get the end-around carry 1. We discard the end-around carry. So,
the addition of both numbers is 0100.

45
Case 3: The larger of 2 numbers are negative
Example: 1101 and -1110
 First, find the 2's complement of the negative number 1110. So, for finding 2's
complement, add 1 to the LSB of its 1's complement value 0001.
0001+1=0010
 Add both the numbers, i.e., 1101 and 0010;
1101+0010= 1111
 Find the 2's complement of the result 1110 that is the final result. So, the 2's complement
of the result 1110 is 0001, and add a negative sign before the number so that we can
identify that it is a negative number.

46
Case 4: Both the numbers are negative
Example: -1101 and -1110 in five-bit register
 Firstly find the 2's complement of the negative numbers 01101 and 01110. So, for finding
2's complement, we add 1 to the LSB of the 1's complement of these numbers. 2's
complement of the number 01110 is 10010, and 01101 is 10011.
 We add both the complement numbers, i.e., 10001 and 10010;
10010+10011= 1 00101
 By adding both numbers, we get the end-around carry 1. This carry is discarded and the
final result is the 2.s complement of the result 00101. So, the 2's complement of the result
00101 is 11011, and we add a negative sign before the number so that we can identify
that it is a negative number.

47
Binary Subtraction
 Binary subtraction is one of the four binary operations, where we perform the
subtraction method for two binary numbers (comprising only two digits, 0 and
1).
 This operation is similar to the basic arithmetic subtraction performed on
decimal numbers in Maths.
 Binary Subtraction
 0–0=0
 1–0=1
 1–1=0
 0 – 1 = 1 (Borrow 1)

48
Case i) Binary subtraction without borrowing
Case ii) Binary subtraction with borrowing

Case i) Binary subtraction without borrowing


Subtract 100 from 1111 .Here number 4 is represented in binary as 100 and number 15 is
represented as 1111.

49
Case ii) Binary subtraction with borrowing:

50
Binary Subtraction Using 2's
Complement
 Step 1: Determine the 2’s complement of the smaller number
 Step 2: Add this to the larger number.
 Step 3: Omit the carry. Note that there is always a carry in this case.

51
Binary Multiplication
 The binary multiplication is very much similar to the usual multiplication method of
integers.
 First, we need to multiply each digit of one binary number to each digit of another binary
number.

52
Binary Division
 The binary division operation is similar to
the base 10 decimal system, except the base 2.
 The division is probably one of the most
challenging operations of the basic arithmetic operations.
 Solve 01111100 ÷ 0010

53
Octal Arithmetic
 Octal rules are similar to the decimal or binary arithmetic.

 This number system is normally used to enter long strings of binary data into a
digital system like a microcomputer.

 This makes the task of entering binary data in a microcomputer easier.

 Arithmetic operations can be performed by converting the octal numbers to


binary numbers and then using the rules of binary arithmetic.
Octal Addition
Octal Subtraction
Application of Octal Number System
Hexadecimal Arithmetic
 Hexadecimal rules are similar to the decimal, octal or binary arithmetic.

 The information can be handled only in binary form in a digital circuit and
it Is easier to enter the information using hexadecimal number system.

 Arithmetic operations can be performed by converting the Hexadecimal


numbers to binary numbers and then using the rules of binary arithmetic.
Hexadecimal Addition
Hexadecimal Subtraction
Binary Coded Decimal

Introduction:
Although binary data is the most efficient storage scheme;
every bit pattern represents a unique, valid value. However,
some applications may not be desirable to work with binary
data.
For instance, the internal components of digital clocks keep
track of the time in binary. The binary value must be
converted to decimal before it can be displayed.
Binary Coded Decimal

Because a digital clock is preferable to store the value as a series of decimal


digits, where each digit is separately represented as its binary equivalent, the
most common format used to represent decimal data is called binary coded
decimal, or BCD.
64 1) BCD Numeric Format

Every four bits represent one decimal digit.


 Use decimal values
from 0 to 9
65 1) BCD Numeric Format

 4-bit values above 9 are not used in BCD.


The unused 4-bit values are:
BCD Decimal
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15
66 1) BCD Numeric Format

Multi-digit decimal numbers are stored as multiple


groups of 4 bits per digit.
Summary of BCD addition
Add two
BCD
numbers

Sum <= Sum > 9, Sum < =


9, carry = carry = 0 9, carry =
0 1

Add 6 to
Answer is sum to Add 6 to
correct no get sum to
correction correct get
required answer correct
answer
BCD arithmetic
BCD Addition
BCD subtraction

 Two methods:
1. 9’s complement method
2. 10’s complement method
BCD subtraction using 9’s
complement
 Perform BCD subtraction using 9’s
complement method (A)10 - (B)10
1. Obtain 9’s complement of no. B

2. Add no. A and 9’s complement of no. B

3. If carry is generated in step 2 then add it to sum to obtain final result. The

carry is called as end around carry.

4. If carry is not produced then the result is negative hence take 9’s complement

of the result.
Examples
 Perform (8)10 - (3)10

8
9’s complement
of 3
Ex.
Ex.
Ex.
Solve following subtraction of decimal
numbers using 9’s complement method.

1. Perform (7)10 - (3)10


2. Perform (4)10 - (7)10
3. Perform (83)10 - (21)10
4. Perform (52)10 – (89)10
BCD subtraction 10’s complement method

 Perform BCD subtraction using 10’s


complement method (A)10 - (B)10
1. Obtain 10’s complement of no. B
2. Add no. A and 10’s complement of no. B
3. If carry is generated in step 2 then discard it.
4. If carry is not produced then the result is negative hence take 10’s
complement of the result.
Example using 10’s complement
Binary Codes
1.7 Binary Codes
83

Digital data is represented, stored and transmitted as groups of binary digits also known as binary
code.

Weighted codes: In weighted codes, each digit is assigned a specific weight according to its position.
Non-weighted codes: In non-weighted codes are not appositionally weighted.
Reflective codes: A code is reflective when the code is self complementing. In other words, when the code for 9 is the
complement the code for 0, 8 for 1, 7 for 2, 6 for 3 and 5 for 4.
Sequential codes: In sequential codes, each succeeding 'code is one binary number greater than its preceding code.
Alphanumeric codes: Codes used to represent numbers, alphabetic characters, symbols
Error defecting and correcting codes: Codes which allow error defection and correction are called error detecting and'
correcting codes.
Non-weighted binary code.

 Non-weighted code is used for special applications where a binary


weight is unnecessary. Non-weighted code does not use positional
weights to convert binary code to other systems like decimal,
hexadecimal, octal, or any other system. Examples of non-weighted
code include excess-3 code and gray code.
Excess-3 Code
 Excess-3 code is also known as XS-3 code. Excess-3 code is a non-
weighted code derived from the 8421 BCD code. Every number on
the 8421 code is incremented by 0011 to achieve the XS-3 code. 3 is
the decimal equivalent of 0011, hence the name XS-3.
Gray Code
 Gray code is a non-weighted code that is used as a unit distance code.
It cannot be used for any arithmetic operations like addition,
subtraction, multiplication, and division (Boolean algebraic
operations). Gray code implements a unique system where only one-
bit changes for every decimal number. This ensures alignment and
synchronicity, thus reducing the error rate.
Alphanumeric codes

Computers work with only 0’s and 1’s. However, there is a need for more advanced
forms of communication with machines. This is why alphanumeric code is
important. It includes 26 characters for the letters of the alphabet, and 10 more for
symbols like !@#$%^&.
1-5 ALPHANUMERIC CODES - ASCII Character Codes
Chapter 1

90

Alphanumeric code represents both numbers and alphabetical characters. The most
common types of alphanumeric code are EBCDIC and ASCII.
American Standard Code for Information Interchange
This code is a popular code used to represent information sent as character-based
data. It uses 7-bits to represent:
 94 Graphic printing characters.
 34 Non-printing characters
Some non-printing characters are used for text format (e.g. BS = Backspace, CR =
carriage return)
Other non-printing characters are used for record marking and flow control (e.g.
STX and ETX start and end text areas).
ASCII Character Code
91
EBCDIC
 EBCDIC stands for Extended Binary Coded Decimal Interchange Code. EBCDIC code is an 8-bit code that is mainly used
in IBM mainframe and IBM midrange computer operating systems.
UNICODE
 Unicode is an international character encoding standard that provides a unique number for every character
across languages and scripts, making almost all characters accessible across platforms, programs, and devices.

 Unicode is a universal character encoding standard. This standard includes roughly 100000 characters to
represent characters of different languages. While ASCII uses only 1 byte the Unicode uses 4 bytes to represent
characters. Hence, it provides a very wide variety of encoding. It has three types namely UTF-8, UTF-16, UTF-
32. Among them, UTF-8 is used mostly it is also the default encoding for many programming languages.

 UNICODE extends ASCII to 65,536 universal characters codes


 For encoding characters in world languages
 Available in many modern applications
 2 byte (16-bit) code words
Error détection codes

 Error detection and correction code plays an important role in the transmission of
data from one source to another. The noise also gets added into the data when it
transmits from one system to another, which causes errors in the received binary
data at other systems. The bits of the data may change(either 0 to 1 or 1 to 0)
during transmission.

 It is impossible to avoid the interference of noise, but it is possible to get back the
original data. For this purpose, we first need to detect either an error z is present
or not using error detection codes. If the error is present in the code, then we will
correct it with the help of error correction codes.
 Error-Detecting Code
96

 To detect errors in data communication and processing, an eighth bit


is sometimes added to the ASCII character to indicate its parity.
 A parity bit is an extra bit included with a message to make the total
number of 1's either even or odd.
 Example:
 Consider the following two characters and their even and odd parity:
 Error-Detecting Code
97

 Redundancy (e.g. extra information), in the form of extra bits, can be


incorporated into binary code words to detect and correct errors.
 A simple form of redundancy is parity, an extra bit appended onto the code
word to make the number of 1’s odd or even. Parity can detect all single-bit
errors and some multiple-bit errors.
 A code word has even parity if the number of 1’s in the code word is even.
 A code word has odd parity if the number of 1’s in the code word is odd.
 Example:
Message A: 10001001 1 (even parity)
Message B: 10001001 0 (odd parity)
Digital Computers
DIGITAL COMPUTER:
 Consists of electronic components and electromechanical devices.
 These components can maintain only two discrete states (i.e high
voltage/low voltage or ON/OFF).
 The word digital implies that the information in the computer is
represented by variables that take a finite number of discrete values
(0 or 1).
 By using various coding techniques (groups of bits) can be made to
represent not only binary numbers but also other decimal digits,
letters, or meaningful symbols
 Digital computer’s functions are:
 General Purpose machine
 more reliable and accurate results.
 Count Quantities rather than measuring
 Input / Output in digits as well as in graphical form. 99
Block Diagram of Digital Computer

100
101
A Digital Computer Example

Memory

Control
CPU unit Datapath

Inputs: Keyboard, Outputs: CRT,


mouse, modem, LCD, modem,
Input/Output
microphone speakers

Synchronous or
Asynchronous?
Transfer of information
102

Figure 1.1 Transfer of information among register


103
Transfer of information
 The other major component of a
digital system
 Circuit elements to manipulate
individual bits of information
 Load-store machine
LD R1;
LD R2;
ADD R3, R2, R1;
SD R3;

Figure 1.2 Example of binary information processing


Logic Gates
105

 Digital
 Concerned with the interconnection among digital components and
modules
 Best Digital System example is General Purpose
Computer
 Logic Design
 Deals with the basic concepts and tools used to design digital
hardware consisting of logic circuits
 Circuits to perform arithmetic operations (+, -, x, ÷)
 Digital Signal : Decimal values are difficult to represent in electrical systems. It
106 is easier to use two voltage values than ten.

 Digital Signals have two basic states:

1 (logic “high”, or H, or “on”)


0 (logic “low”, or L, or “off”)
 Digital values are in a binary format. Binary means 2 states.

 A good example of binary is a light (only on or off)

on off

Power switches have labels “1” for on and “0” for off.
Binary Logic
107
 Definition of Binary Logic
 Binary logic consists of binary variables and a set of logical operations.
 The variables are designated by letters of the alphabet, such as A, B, C, x, y, z, etc, with
each variable having two and only two distinct possible values: 1 and 0,
 Three basic logical operations: AND, OR, and NOT.
Binary Logic gates
 Truth Tables, Boolean Expressions, and Logic Gates

AND OR NOT
x y z x y z x z
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1

z=x•y=xy z=x+y z = x = x’

x x x
y z y z z
Universal Gate

 NAND and NOR Gates are called Universal Gates because AND, OR
and NOT gates can be implemented &created by using these gates.

NAND Gate Implementations NOR Gate Implementations


111
Boolean Algebra
 Boolean Algebra is used to analyse and simplify the digital (logic) circuits.
 It uses only the binary numbers i.e. 0 and 1. It is also called as Binary
Algebra or logical Algebra.
 Boolean algebra was invented by George Boole in 1854.
 There is no negative and fractional numbers
 Boolean algebra uses Boolean Variables and Boolean operators.
 There are 3 Basic operators AND,OR,NOT.
 A Boolean Expression is combination of Boolean Variables and Boolean
Operators.
 A Boolean Function has one or more input variables and Produces the result
based on the input.

112
Truth Table:
 Boolean function can be uniquely and completely described by truth table.
 A truth table lists all possible values of input combinations of the function and
produces the output for all combinations.
Rule in Boolean Algebra:
 Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.
 Complement of a variable is represented by an over bar (-). Thus, complement of
variable B is represented as . Thus if B = 0 then = 1 and B = 1 then = 0.
 OR ing of the variables is represented by a plus (+) sign between them. For example
OR ing of A, B, C is represented as A + B + C.
 Logical AND ing of the two or more variable is represented by writing a dot between
them such as A.B.C. Sometime the dot may be omitted like ABC.

113
Boolean Laws
 There are six types of Boolean Laws.
1. Commutative law
2. Associative law
3. Distributive law
4. AND law
5. OR Law
6. INVERSION law

114
 Commutative law:
Any binary operation which satisfies the following expression is referred to as
commutative operation.

Commutative law states that changing the sequence of the variables does
not have any effect on the output of a logic circuit.
 Associative law:
This law states that the order in which the logic operations are performed is
irrelevant as their effect is the same.

115
 Distributive law:
Distributive law states the following condition.

 AND law:
These laws use the AND operation. Therefore they are called as AND laws.

 OR law
These laws use the OR operation. Therefore they are called as OR laws.

 INVERSION law:
This law uses the NOT operation. The inversion law states that double inversion
of a variable results in the original variable itself.

116
Duality Principle:
 According to the duality principle, if we have theorems of Boolean Algebra for any one
type of operation then the operation can be converted into another type of operation.
 In other words AND can be converted to OR and OR can be converted into AND
 We can interchange '0 with 1', '1 with 0', '(+) sign with (.) sign' and '(.) sign with (+)
sign' to perform dual operation. T

117
De Morgan's Theorem
 This theorem explains that the complements of the products of all the terms are equal
to the sums of the complements of each and every term
 Likewise, the complements of the sums of all the terms are equal to the products of the
complements of each and every term.
 There are 2 theorems in DeMorgan’s
1. Theorem 1:

2. Theorem 2:

118
 Theorem 1: This theorem explains that the complements of the products of all the terms
are equal to the sums of the complements of each and every term

 The LHS (left-hand side) of this theorem represents the NAND gate that has inputs A
and B. On the other hand, the RHS (right-hand side) of this theorem represents the OR
gate that has inverted inputs.
 The OR gate here is known as a Bubbled OR.

119
120
 Theorem 2: The complements of the sums of all the terms are equal to the products of
the complements of each and every term.

 The left-hand side of this theorem represents the NOR gate that has inputs A and B. On
the other hand, the right-hand side represents the AND gate that has inverted inputs.
 The AND gate here is known as a Bubbled AND.

121
122
Draw a logic diagram
for the following
expression:
(a)
ab+b’c+c’a’
(b) (a+b).
(a+b’).c

123
Function Minimization using Boolean
Algebra
Show that;
1. ab + ab' = a
ab + ab' = a(b+b') = a.1=a
2.
(a + b)(a + b') = a
(a + b)(a + b') = a.a +a.b' +a.b+b.b'
= a + a.b' +a.b + 0
= a + a.(b' +b) + 0
= a + a.1 +0
= a +a
= a
Function Minimization using Boolean
Algebra

 Examples:

(a) a + ab = a(1+b)=a

(b) a(a + b) = a.a +ab=a+ab=a(1+b)=a.

(c) a + a'b = (a + a')(a + b)=1(a + b) =a+b

(d) a(a' + b) = a. a' +ab=0+ab=ab


Converting from Truth Table to Boolean
Function
 In designing digital circuits, the designer often begins with a truth
table describing what the circuit should do.
 The design task is largely to determine what type of circuit will
perform the function described in the truth table.
 While some people seem to have a natural ability to look at a truth
table and immediately envision the necessary logic gate or relay logic
circuitry for the task, there are procedural techniques available for the
rest of us.
 Here, Boolean algebra proves its utility in a most dramatic way!
Converting from Truth Table to Boolean
Function
 This problem will be solved by showing that any Boolean
function can be represented by a Boolean sum of Boolean
products of the variables and their complements or the
product of sums.

 There are two ways to convert from truth tables to Boolean


functions:
1. Using Sum of Products /Minterms
2. Using Product of Sums /Maxterms
Converting from Truth Table to Boolean Function

A B C Minterm
0 0 0 0 m0 ABC
1 0 0 1 m1 ABC
2 0 1 0 m2 ABC
3 0 1 1 m3 ABC
4 1 0 0 m4 ABC
5 1 0 1 m5 ABC
6 1 1 0 m6 ABC
7 1 1 1 m7 ABC
128 /
28
Converting from Truth Table to Boolean
Function
A B C Maxterm
0 0 0 0 M0 A  B  C
1 0 0 1 M1 A  B  C
2 0 1 0 M2 A  B  C
3 0 1 1 M3 A  B  C
4 1 0 0 M4 A  B  C
5 1 0 1 M5 A  B  C
6 1 1 0 M6 A  B  C
7 1 1 1 M7 A  B  C

129 /
28
Converting from Truth Table to Boolean Function
 Truth Table to Boolean Function

A B C F F  A BC  A BC  A BC  ABC
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
Using
Minterms 130 /
28
Converting from Truth Table to Boolean Function
 Truth Table to Boolean Function
F ( A  B  C ) ( A  B  C )( A  B  C ) ( A  B  C )
A B C F
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0 Using
Maxterms 131 /
28
Converting from Truth Table to Boolean Function
 Sum of Minterms A B C F F
F  A BC  A BC  A BC  ABC 0 0 0 0 0 1
1 0 0 1 1 0
F m1  m4  m5  m7
2 0 1 0 0 1
F  (1,4,5,7)
3 0 1 1 0 1
•Product of Maxterms 4 1 0 0 1 0
F  A BC  ABC  ABC  ABC 5 1 0 1 1 0
F  A BC  ABC  ABC  ABC 6 1 1 0 0 1
7 1 1 1 1 0
F  A BC  ABC  ABC  ABC
F ( A  B  C )( A  B  C )( A  B  C )( A  B  C )
F M 0 M2 M3 M6
F  (0,2,3,6) 132 /
28
Karnaugh Maps
 Karnaugh maps (K-maps) are graphical representations of
Boolean functions.
 One map cell corresponds to a row in the truth table.
 Also, one map cell corresponds to a minterm or a maxterm in the
Boolean expression
 Multiple-cell areas of the map correspond to standard terms.
 A K-map provides a systematic method for simplifying Boolean
expressions and, if properly used, will produce the simplest SOP
or POS expression possible, known as the minimum expression.
What is K-Map
 It’s similar to truth table; instead of being organized (i/p
and o/p) into columns and rows, the K-map is an array of
cells in which each cell represents a binary value of the
input variables.
 The cells are arranged in a way so that simplification of a
given expression is simply a matter of properly grouping
the cells.
 K-maps can be used for expressions with 2, 3, 4, and 5
variables.
Karnaugh Map
2-variable K-map
3-variable Karnaugh map

 The 3-variable karnaugh map is an array of eight cells.


 In this case A, B and C are used for the variables although
other letters could be used.
 Binary values of A is along the left side and the value of B
and C is across the top
3-Variable K-map

AB\C 0 1
A\BC 00 01 11 10

00 0 1 0 0 1 3 2

1 4 5 7 6
01 2 3

11 6 7

10 4 5
Three-Variable K-Maps

f  (0,4) B C f  (4,5) A B f  (0,1,4,5) B f  (0,1,2,3) A

BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 1 1
1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0

f  (0,4) A C f  (4,6) A C f  (0,2) A C f  (0,2,4,6) C

BC BC BC BC
A 00 01 11 10 A 00 01 11 10 A 00 01 11 10 A 00 01 11 10
0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1
1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1
The 4-variable Karnaugh Map
 The 4-variable karnaugh map is an array of sixteen cells

 Binary values of A and B are along the left side and the
values of C and D are across the top.

 The value of a given cell is the binary value of A and B at the


left in the same row combined with the binary values of C
and D at the top of the same column.
4-Variable K-map

AB\CD 00 01 11 10

00 0 1 3 2

01 4 5 7 6

11 12 13 15 14

10 8 9 11 10
Determining the Minimum SOP Expression
from the Map

CD
00 01 11 10 B  A C  AC D
AB
00 1 1 AC
01 1 1 1 1 B
11 1 1 1 1
AC D
10 1
Four-Variable K-Maps
CD CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 1 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 0 0

01 0 0 0 0 01 0 1 0 0 01 0 0 0 0 01 1 0 0 1

11 0 0 0 0 11 0 1 0 0 11 0 1 1 0 11 0 0 0 0

10 1 0 0 0 10 0 0 0 0 10 0 0 0 0 10 0 0 0 0

f  (5,13) B  C  D f  (13,15) A  B  D f  (4,6) A  B  D


f  (0,8) B  C  D

CD CD CD CD
00 01 11 10 00 01 11 10 00 01 11 10 00 01 11 10
AB AB AB AB
00 0 0 1 1 00 0 0 0 0 00 0 0 1 1 00 1 0 0 1

01 0 0 1 1 01 1 0 0 1 01 0 0 0 0 01 0 0 0 0

11 0 0 0 0 11 1 0 0 1 11 0 0 0 0 11 0 0 0 0

10 0 0 0 0 10 0 0 0 0 10 0 0 1 1 10 1 0 0 1

f  (2,3,6,7) A  C f  (4,6,12,14) B  D f  (2,3,10,11 ) B  C f  (0,2,8,10) B  D


Mapping Directly from a Truth
Table O/P
I/P
A B C X C
0 1
0 0 0 1 AB
0 0 1 0
00 1
0 1 0 0
0 1 1 0 01
1 0 0 1
1 0 1 0 11
1 1
1 1 0 1
10
1 1 1 1 1
Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy