SlideShare una empresa de Scribd logo
1 de 108
BOOLEAN ALGEBRA & LOGIC GATESUNIT-I
ITA401 : Introduction to
Computer Organization
Summer Course MCA
Instructor: Prof. Ramesh Ragala, SCSE, VITCC
Text Books
M. Morris Mano – Digital Logic and Computer
Design
1
OVERVIEW
Review of Binary Number Systems
Binary Arithmetic & Binary Codes
Boolean Algebra & Boolean Theorems
Truth tables & Boolean functions
Canonical & Standard forms
Logic Operations & Logic Gates
Karnough Map up to 6 variables (Don't Care
Condition)
Sum Of Products and Products Of Sum
OVERVIEW
Digital Computer and Digital Systems:
Digital computer: follows a sequence of
instructions, called programs that operate on
given data.
The user can change programs and data according
to specific need.
Digital system: best example is general purpose digital
computer.
Characteristics of digital system: manipulation of
discrete elements of information.
Discrete elements: set of meaningful symbols like
electric pulses, decimal digits, the letters of
OVERVIEW
Digital Computer and Digital Systems:
 A sequence of discrete elements of
information represents forms a language, that
is a discipline that conveys information.
In early day, the digital computers are used for
numerical computations.  discrete elements
are digits.
Digital computer  discrete information
processing system
The discrete elements of information are
OVERVIEW
Digital Computer and Digital Systems:

THE COMPUTER LEVEL HIERARCHY
6
 6:The level with which we are most
familiar.
 5:The level with which we interact when
we write programs in languages such
as C, Java.
 4:Acts upon assembly language
produced from 5.
 3: Controls executing processes on the
system.
 2:Programs written in machine
language. No need of compilers,
interpreters, or assemblers
 1: Control units can be
REVIEW OF BINARY NUMBER SYSTEMS
We are familiar to do computation using numbers 0 –
9.
These are digits of a digital system.
why should anyone bother to study the binary
number system?
 Computers.
Computers do not use 10 digits for computation.
Every computer processor is made of millions of tiny
switches that can be turned off or on.
These switches have two states: on / off.
Computer to perform its computations with a number
UNDERSTANDING OF NUMBER SYSTEMS
The base/radix of any number system is
determined by the number of digits in the system.
Example:
binary  base – 2 Number system. (0/1 two only) 
110.112
Decimal is a base – 10, because it uses ten digits. 
592.3410
Conversion between binary and decimal numbers
It needs
Relationship between digits of a given number
Position of those digits
UNDERSTANDING OF NUMBER SYSTEMS
In general, the relation between a digit, it position
and the base of the number system is expressed
by the following formula
  6.75
Hundreds Tens Ones . Tenth
s
Hundredt
hs
102 101 100 10-1 10-2
5 9 2 . 1 5
DIGIT * BASE POSITION
#
Fours Twos Ones . Halve
s
Fourth
22 21 20 2-1 2-2
1 1 0 . 1 1
UNDERSTANDING OF NUMBER SYSTEMS
 In order to convert a decimal number to it binary
equivalent  repeatedly divide the decimal number
by 2.
Division by 2 will either give a reminder 1 or 0.
The collection of the remainders will gives the binary
equivalent of given decimal number.
What is the procedure, if the decimal number
contains fractional.
Instead of dividing by 2, we repeatedly multiply the
decimal fraction by 2.
If the result is greater than or equal to 1, we add a 1
UNDERSTANDING OF NUMBER SYSTEMS
 In order to convert a decimal number to it binary
equivalent  repeatedly divide the decimal number
by 2.
Division by 2 will either give a reminder 1 or 0.
The collection of the remainders will gives the binary
equivalent of given decimal number.
What is the procedure, if the decimal number
contains fractional.
Instead of dividing by 2, we repeatedly multiply the
decimal fraction by 2.
If the result is greater than or equal to 1, we add a 1
NUMBER SYSTEMS – REPRESENTATION
Positive radix, positional number systems
A number with radix r is represented by a string of
digits:
An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m + 1 A- m
in which 0 < Ai < r and . is the radix point.
The string of digits represents the power series:
( ) ( )(Number)r
=
 +
j = - m
j
j
i
i = 0
i rArA
(Integer Portion) + (Fraction Portion)
i = n -
1
j = -
1
NUMBER SYSTEMS – EXAMPLES
General Decimal Binary
Radix (Base) r 10 2
Digits 0 => r - 1 0 => 9 0 => 1
0
1
2
3
Powers of 4
Radix 5
-1
-2
-3
-4
-5
r0
r1
r2
r3
r4
r5
r -1
r -2
r -3
r -4
r -5
1
10
100
1000
10,000
100,000
0.1
0.01
0.001
0.0001
0.00001
1
2
4
8
16
32
0.5
0.25
0.125
0.0625
0.03125
SPECIAL POWERS OF 2
 Smallest unit in computer is Bit (Binary Digit)
 Combination of such 4 bits is called Nibble
 Combination of such 8 bits is called Byte is
denoted "B"
 210 (1,024) is Kilo, denoted " K"
 220 (1,048,576) is Mega, denoted "M "
 230 (1,073, 741,824) is Giga, denoted "G "
 240 (1,099,511,627,776 ) is Tera, denoted " T "
 250 (1,125,899,906,842,624) is Peta, denoted
"P"
 260 (1,152,921,504,606,846,976) is Exa,
denoted "E"
BASIC CONCEPTS BEHIND THE BINARY SYSTEM
Recalling elementary school math (Decimal System)
H | T | O
1 | 9 | 3
Years later
10
2
|10
1
|10
0
1 | 9 | 3
Decimal system uses the digits 0-9 to represent numbers
1-hundreds plus 9-tens plus 3-
ones = 193
}
(1* 102
)+(9*101
)+(3*100
)= 193}
 It operates in base 2 rather than base 10(Binary System)
10
2
|10
1
|10
0
2
2
| 2
1
| 2
0
Instead of using the digits 0-9, we only use 0-1
What would the binary number 1011 be in decimal?
What would the binary number 1101be in decimal?
BINARY SYSTEM
BINARY SYSTEM CONTD..
1011=(1*2
3
)+(0*2
2
)+(1*2
1
)+(1*2
0
)
= (1*8) + (0*4) + (1*2) + (1*1)
= 11(not one one its eleven)
1101=(1*23
)+(1*22
)+(0*21
)+(1*20
)
= (1*8) + (1*4) + (0*2) + (1*1)
= 13
Like Binary we can define any r-base system.
r value for Binary is 2, for Decimal 10, Octal is 8 and
Hexadecimal is 16
BINARY ARITHMETIC -- ADDITION
 Four Rules:
Rule – 1 : 0 + 0 = 0
Rule – 2: 0 + 1 = 1
Rule – 3 : 1 + 0 = 1
Rule – 4: 1 + 1 = 10
Example 01111 + 00110 =????
Adding multiple binary numbers:
0111 + 0110 + 1101 + 0101 + 1110 =?
BINARY ARITHMETIC -- ADDITION
 First, we align the two numbers so that the radix point of each
number is located in the same column.
110.01
+ 1.011
 Next, we fill in the blank spaces with 0s and add the two numbers
together.
110.010
+ 001.011
 The first column adds to 1.
110.010
+ 001.011
1
 The second column adds to 102, so we write a 0 below it and
carry a 1 to the next column.
1
110.010
+ 001.011
01
 All of the remaining columns add to 1, so we write 1 below them.
1
110.010
+ 001.011
111.101
 This gives us a final answer of 111.1012.
1
110.010
+ 001.011
111.101
BINARY ARITHMETIC -- SUBTRACTION
 Four Rules:
Rule – 1 : 0 - 0 = 0
Rule – 2: 0 - 1 = 1 (Special)
Rule – 3 : 1 - 0 = 1
Rule – 4: 1 - 1 = 0
Example: 10101 – 1110 =????

BINARY ARITHMETIC -- SUBTRACTION
1.To compute the first column, we need to borrow a 1 from the next column. Recall
that two 1s generated a carry in addition. If we reverse this process, we can borrow a
1 from the second column and mark two 1s in the first column.
10
- 1
2.Once we borrow from the second column, we cross out the 1 and write 0 above it to
show this column is now empty. The 1 from the second column is now represented by
the two blue 1s in the first column.
1
01
10
- 1
3.To solve our subtraction problem, we take 1 away from our group of two blue 1s.
This leaves us with a single 1 which we write below the first column.
1
01
10
- 1
1
4.After cleaning up our work, we can see that the first column of our answer is
identical to Rule 2. Since we must borrow a 1 from the next column, 0 - 1 = 1.
10
- 1
1
BINARY ARITHMETIC -- MULTIPLICATION
 same techinique as decimal multiplication.
Example : multiply 110 by 10
Example : 1111 * 1011 = ?????

BINARY ARITHMETIC -- DIVISION
 same techinique as decimal division.
Example : 112 / 102 = ??
Example : divide the binary number 1000012 by 1102

BINARY ARITHMETIC
Addition (1-bit) Addition (multi-bit)
0 0 1 1 11
(carry)
+ 0 +1 +0 +1 1010 (10)
0 1 1 10 +1111 (15)
11001 (25)
Multiplication (1-bit) Multiplication(multi-
bit)
1*1=1, 1*0=0 101
0*1=0, 0*0=0 * 11
101
BINARY ARITHMETIC CONTD..
25
Division
10011(19)
11)111011(59/3)
-11____
101
-11_
101
11
10(2)
COMMONLY OCCURRING BASES
Name Radix Digits
Binary 2 0,1
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
The six letters (in addition to the 10 integers) in hexadecimal
represent:
26
Decimal
(Base 10)
Binary
(Base 2)
Octal
(Base 8)
Hexadecimal
(Base 16)
00 00000 00 00
01 00001 01 01
02 00010 02 02
03 00011 03 03
04 00100 04 04
05 00101 05 05
06 00110 06 06
07 00111 07 07
08 01000 10 08
09 01001 11 09
10 01010 12 0A
11 01011 13 0B
12 01100 14 0C
13 01101 15 0D
14 01110 16 0E
15 01111 17 0F
16 10000 20 10
NUMBERS IN DIFFERENT BASES
27
CONVERSION BETWEEN BASES
To convert from one base to another:
1) Convert the Integer Part
2) Convert the Fraction Part
3) Join the two results with a radix point
28
CONVERSION DETAILS
To Convert the Integral Part:
 Repeatedly divide the number by the new radix and save the remainders.
The digits for the new radix are the remainders in reverse order of their
computation. If the new radix is > 10, then convert all remainders > 10
to digits A, B, …
To Convert the Fractional Part:
 Repeatedly multiply the fraction by the new radix and save the integer
digits that result. The digits for the new radix are the integer digits in
order of their computation. If the new radix is > 10, then convert all
integers > 10 to digits A, B, …
29
EXAMPLE: CONVERT 11.37510 TO BASE 2
• Convert 11 to Base 2
• Convert 0.375 to Base 2:
• Join results together with the radix point:
30
ADDITIONAL ISSUE - FRACTIONAL PART
• Note that in this conversion, the fractional
part can become 0 as a result of the repeated
multiplications.
• In general, it may take many bits to get this
to happen or it may never happen.
• Example Problem: Convert 0.6510 to N2
• 0.65 = 0.1010011001001 …
• The fractional part begins repeating every 4 steps
yielding repeating 1001 forever!
• Solution: Specify number of bits to right of
radix point and round or truncate to this
number.
31
CHECKING THE CONVERSION
 To convert back, sum the digits times their respective powers of r.
 From the prior conversion of 11.37510
 10112 = 1*8 +0*4 + 1*2 +1*1
 = 8 + 2 + 1
 = 11
 0.0112 = 1/4 + 1/8
 = 0.25 + 0.125
 = 0.375
32
OCTAL (HEXADECIMAL) TO BINARY AND BACK
Octal (Hexadecimal) to Binary:
 Restate the octal (hexadecimal) as three (four) binary digits starting at
the radix point and going both ways.
Binary to Octal (Hexadecimal):
 Group the binary digits into three (four) bit groups starting at the radix
point and going both ways, padding with zeros as needed in the
fractional part.
 Convert each group of three(four) bits to an octal(hexadecimal).
33
OCTAL TO HEXADECIMAL VIA BINARY
Convert octal to binary.
Use groups of four bits and convert as above to
hexadecimal digits.
Example: Octal to Binary to Hexadecimal
 6 3 5 . 1 7 7 8
 110 011 101 . 001 111 111 2
Regroup:
 (000)1 1001 1101. 0011 1111 1(000) 2
Convert 1 9 D . 3 F 8 16 34
|| | |
| | | |
CONVERSION SUMMARY
To
From
Dec Bin Octal Hex
Dec -
Repeated /
or *
Thru Bin Thru Bin
Bin Add weights of 1s -
Convert
every 3
digits
Convert
every 4
digits
Octal Add digit*weight
Split every
digit to 3
- Thru Bin
Hex Add digit*weights
Split every
digit to 4
Thru Bin - 35
A FINAL CONVERSION NOTE
You can use arithmetic in other bases if you are careful:
Example: Convert 1011102 to Base 10 using binary arithmetic:
 Step 1 101110 / 1010 = 100 r 0110
 Step 2 100 / 1010 = 0 r 0100
 Converted Digits are 01002 | 01102
 or 4 6 10
36
BINARY NUMBERS AND BINARY CODING
Flexibility of representation
 Within constraints below, can assign any binary combination
(called a code word) to any data as long as data is uniquely
encoded.
Information Types
 Numeric
 Must represent range of data needed
 Very desirable to represent data such that simple, straightforward
computation for common arithmetic operations permitted
 Tight relation to binary numbers
 Non-numeric
 Greater flexibility since arithmetic operations not applied.
 Not tied to binary numbers
37
Given n binary digits (called bits), a binary code
is a mapping from a set of represented
elements to a subset of the 2n binary numbers.
Example: A
binary code
for the seven
colors of the
rainbow
Code 100 is
not used
NON-NUMERIC BINARY CODES
Binary Number
000
001
010
011
101
110
111
Color
Red
Orange
Yellow
Green
Blue
Indigo
Violet
38
Given M elements to be represented by a binary code, the
minimum number of bits, n, needed, satisfies the following
relationships:
 2n  M > 2(n – 1)
 n = log2 M where x , called the ceiling
function, is the integer greater than or equal to
x.
Example: How many bits are required to represent decimal
digits with a binary code?
NUMBER OF BITS REQUIRED
39
NUMBER OF ELEMENTS REPRESENTED
Given n digits in radix r, there are rn distinct
elements that can be represented.
But, you can represent m elements, m < rn
Examples:
You can represent 4 elements in radix r = 2 with n
= 2 digits: (00, 01, 10, 11).
You can represent 4 elements in radix r = 2 with n
= 4 digits: (0001, 0010, 0100, 1000).
This second code is called a "one hot" code.
40
DECIMAL CODES - BINARY CODES FOR DECIMAL
DIGITS
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0001
2 0010 0101 0110 0011
3 0011 0110 0101 0010
4 0100 0111 0100 0110
5 0101 1000 1011 0111
6 0110 1001 1010 0101
7 0111 1010 1001 0100
8 1000 1011 1000 1100
9 1001 1100 1111 1101
There are over 8,000 ways that you can chose 10
elements from the 16 binary numbers of 4 bits. A
few are useful:
BINARY CODES -- CLASSIFICATION OF BINARY CODES
• The digital data is represented, stored and transmitted
as group of binary bits. This group is also called as
binary code.
• How many Bits are needed????? 4
• The codes are broadly categorized into following four
categories.
• Weighted Codes
• Non-Weighted Codes
• Binary Coded Decimal Code
• Alphanumeric Codes
• Error Detecting Codes
• Error Correcting Codes
42
• What special property does the Gray code have in relation to
adjacent decimal digits?  used for error correction.
• two successive values differ in only one bit (binary digit)
GRAY CODE (REFLECTED CODE) – DECIMAL
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0001
8 1000 1100
9 1001 1101
BINARY CODED DECIMAL (BCD)
•The BCD code is the 8,4,2,1 code.
•8, 4, 2, and 1 are weights
•BCD is a weighted code
•This code is the simplest, most intuitive binary
code for decimal digits and uses the same
powers of 2 as a binary number, but only
encodes the first ten values from 0 to 9.
•Example: 1001 (9) = 1000 (8) + 0001 (1)
•How many “invalid” code words are there?
•What are the “invalid” code words? 44
WARNING: CONVERSION OR CODING?
• Do NOT mix up conversion of a decimal number to a binary
number with coding a decimal number with a BINARY CODE.
•1310 = 11012 (This is conversion)
•13  0001|0011 (This is coding)
45
BCD ARITHMETIC
Given a BCD code, we use binary arithmetic to add the digits:
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
Note that the result is MORE THAN 9, so must be
represented by 2 digits!
To correct the digit, subtract 10 by adding 6 modulo 16.
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
+0110 so add 6
carry = 10011 leaving 3 + cy
0001 | 0011Final answer (two digits)
If the digit sum is > 9, add one to the next significant digit
46
DIGITAL BCD CLOCK
47
ALPHANUMERIC CODES - ASCII CHARACTER CODES
• 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).
48
ASCII CODE
49
http://www.prenhall.com/mano
ASCII PROPERTIES
ASCII has some interesting properties:
Digits 0 to 9 span Hexadecimal values 3016to 3916
Upper case A-Z span 4116to 5A16.
Lower case a-z span 6116to 7A16.
• Lower to upper case translation (and vice versa)
occurs byflipping 6th bit
Delete (DEL) is all bits set,a carryover from when
punched paper tape was used to store messages.
Punching all holes in a row erased a mistake!
50
UNICODE
• 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
• See Reading Supplement – Unicode on the Companion
Website
51
PARITY BIT ERROR-DETECTION CODES
• 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.
52
4-BIT PARITY CODE EXAMPLE
• Fill in the even and odd parity bits:
• The codeword "1111" has even parity and the codeword
"1110" has odd parity. Both can be used to represent 3-bit
data.
Even Parity Odd Parity
Message - Parity Message - Parity
000 - 000 -
001 - 001
010 - 010 -
011 - 011 -
100 - 100 -
101 - 101 -
110 - 110 -
111 - 111 -
53
-
54
BASIC DEFINITIONS
• Binary Operators
• AND
z = x • y = x y z=1 if x=1
AND y=1
• OR
z = x + y z=1 if x=1 OR
y=1
• NOT
z = x = x’ z=1 if x=0
• Boolean Algebra
• Binary Variables: only ‘0’ and ‘1’ values
55
BOOLEAN ALGEBRA POSTULATES
• Closure
x, y ∈ S; z = x y , z ∈S ; S is closed under {N,+}
• Commutative Law
x • y = y • x x + y = y + x
• Identity Element
x • 1 = x x + 0 = x
• Complement
x • x’ = 0 x + x’ = 1
• Inverse
x, y∈ S; x y=y x=e ; e is Identity of S.
Additive inverse {R, x, -x}
*
*
*
*
56
BOOLEAN ALGEBRA THEOREMS
• Duality
• The dual of a Boolean algebraic expression is obtained by
interchanging the AND with OR operators and replacing the 1’s
by 0’s and the 0’s by 1’s.
• x • ( y + z ) = ( x • y ) + ( x • z )
• x + ( y • z ) = ( x + y ) • ( x + z )
• Theorem 1
• x • x = x x + x = x
• Theorem 2
• x • 0 = 0 x + 1 = 1
BOOLEAN ALGEBRA THEOREMS
Theorem 3: Involution
 ( x’ )’ = x ( x ) = x
Theorem 4: Associative & Distributive
 ( x • y ) • z = x • ( y • z )
 ( x + y ) + z = x + ( y + z )
 x • ( y + z ) = ( x • y ) + ( x • z )
 x + ( y • z ) = ( x + y ) • ( x + z )
Theorem 5: DeMorgan
 ( x • y )’ = x’ + y’ ( x + y )’ = x’ • y’
 ( x • y ) = x + y ( x + y ) = x • y
Theorem 6: Absorption
 x • ( x + y ) = x x + ( x • y ) = x
OPERATOR PRECEDENCE
• Parentheses
( . . . ) • ( . . .)
• NOT
x’ + y
• AND
x + x • y
• OR
])([ xwzyx ++
])([
)(
)(
)(
)(
xwzyx
xwzy
xwz
xw
xw
++
++
+
+
+
DEMORGAN’S THEOREM
)]([ edcba ++
)]([ edcba +++
))(( edcba ++
))(( edcba +++
))(( edcba ++
)( edcba ++
60
BOOLEAN FUNCTIONS
• Boolean Expression
Example: F = x + y’ z
• Truth Table
All possible combinations
of input variables
• Logic Circuit
x y z F
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 1
1 1 1 1
x
y
z
F
ALGEBRAIC MANIPULATION
• Literal:
A single variable within a term that may be complemented or
not.
• Use Boolean Algebra to simplify Boolean functions to
produce simpler circuits
Example: Simplify to a minimum number of literals
F = x + x’ y ( 3 Literals)
= x + ( x’ y )
= ( x + x’ ) ( x + y )
= ( 1 ) ( x + y ) = x + y ( 2 Literals)Distributive law (+ over •)
COMPLEMENT OF A FUNCTION
• DeMorgan’s Theorm
• Duality & Literal Complement
CBAF ++
CBAF ++
CBAF 
CBAF ++
CBAF 
CBAF 
63
CANONICAL FORMS
• Minterm
• Product (AND function)
• Contains all variables
• Evaluates to ‘1’ for a
specific combination
Example
A = 0 A B C
B = 0 (0) • (0) • (0)
C = 0
1 • 1 • 1
= 1
A B C Minterm
0 0 0 0 m0
1 0 0 1 m1
2 0 1 0 m2
3 0 1 1 m3
4 1 0 0 m4
5 1 0 1 m5
6 1 1 0 m6
7 1 1 1 m7
CBA
CBA
CBA
CBA
CBA
CBA
CBA
CBA
64
CANONICAL FORMS
• Maxterm
• Sum (OR function)
• Contains all variables
• Evaluates to ‘0’ for a
specific combination
Example
A = 1 A B C
B = 1 (1) + (1) + (1)
C = 1
0 + 0 + 0
= 0
A B C Maxterm
0 0 0 0 M0
1 0 0 1 M1
2 0 1 0 M2
3 0 1 1 M3
4 1 0 0 M4
5 1 0 1 M5
6 1 1 0 M6
7 1 1 1 M7
CBA ++
CBA ++
CBA ++
CBA ++
CBA ++
CBA ++
CBA ++
CBA ++
CANONICAL FORMS
• Truth Table to Boolean Function
A B C F
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
CBAF  CBA+ CBA+ ABC+
66
CANONICAL FORMS
A B C F
0 0 0 0 0
1 0 0 1 1
2 0 1 0 0
3 0 1 1 0
4 1 0 0 1
5 1 0 1 1
6 1 1 0 0
7 1 1 1 1
ABCCBACBACBAF +++
7541 mmmmF +++
 )7,5,4,1(F
CABBCACBACBAF +++
CABBCACBACBAF +++
CABBCACBACBAF 
))()()(( CBACBACBACBAF ++++++++
6320 MMMMF 
 (0,2,3,6)F
F
1
0
1
1
0
0
1
0
 Sum of Minterms
 Product of Maxterms
67
STANDARD FORMS
• Sum of Products (SOP)
ABCCBACBACBAF +++
AC
BBAC

+ )(
CB
AACB

+ )(
BA
BA
CCBA


+
)1(
)(
)()()( BBACCCBAAACBF +++++
ACBACBF ++
68
STANDARD FORMS
• Product of Sums (POS)
)( AACB +
)( BBCA +
)( CCBA +
)()()( AACBCCBABBCAF +++++
CBBACAF ++
CABBCACBACBAF +++
))()(( CBBACAF +++
TWO-LEVEL IMPLEMENTATIONS
• Sum of Products (SOP)
• Product of Sums (POS)
ACBACBF ++
))()(( CBBACAF +++
B’
C
FB’
A
A
C
A
C
FB’
A
B’
C
LOGIC OPERATORS
• AND
• NAND (Not AND)
x y NAND
0 0 1
0 1 1
1 0 1
1 1 0
x y AND
0 0 0
0 1 0
1 0 0
1 1 1
x
y
x • y
x
y
x • y
71
LOGIC OPERATORS
• OR
• NOR (Not OR)
x y OR
0 0 0
0 1 1
1 0 1
1 1 1
x y NOR
0 0 1
0 1 0
1 0 0
1 1 0
x
y
x + y
x
y
x + y
72
LOGIC OPERATORS
• XOR (Exclusive-OR)
• XNOR (Exclusive-NOR)
(Equivalence)
x y XOR
0 0 0
0 1 1
1 0 1
1 1 0
x y XNOR
0 0 1
0 1 0
1 0 0
1 1 1
x
y
x Å y
x  y
x y + x y
x
y
x Å y
x y + x y
73
LOGIC OPERATORS
• NOT (Inverter)
• Buffer
x NOT
0 1
1 0
x Buffer
0 0
1 1
x x
x x
74
MULTIPLE INPUT GATES

75
DEMORGAN’S THEOREM ON GATES
• AND Gate
• F = x • y F = (x • y) F = x + y
• OR Gate
• F = x + y F = (x + y) F = x • y
 Change the “Shape” and “bubble” all lines
SIMPLIFICATION OF BOOLEAN
FUNCTIONS
76
Algebraic Method
K-Map Method
Tabular Method
Schienman Method
Simplified expressions lead to simplified circuits
A function’s truth-table representation is unique; its
algebraic
expression is not
SIMPLIFY USING ALGEBRAIC
THEOREMS
• Advantage:
Purely based on Boolean Algebra theorems
• Disadvantage:
No Suitable algorithm to apply (Trial type of method)
F = xy’ + xy +yz
= x(y’ + y) + yz
= x(1) + yz
= x + yz
• How many Gates we minimized?
SIMPLIFY USING KARNAUGH MAP
• Advantage:
Simplest and Widely accepted
• Disadvantage:
Applicable for only up to Six variables
A two-variable function has four possible minterms. We can re-arrange
these minterms into a Karnaugh map (K-map).
x y minterm
0 0 x’y’
0 1 x’y
1 0 xy’
1 1 xy
Y
0 1
X
0 x’y’ x’y
1 xy’ xy
Y’ Y
X’ x’y’ x’y
X xy’ xy
SIMPLIFY USING KARNAUGH MAP
For a three-variable expression with inputs x, y, z, the arrangement of
minterms is more tricky
YZ
00 01 11 10
X
0 x’y’z’ x’y’z x’yz x’yz’
1 xy’z’ xy’z xyz xyz’
YZ
00 01 11 10
0 m0 m1 m3 m2
X
1 m4 m5 m7 m6
x y z minterm
0 0 0 x’y’z’
0 0 1 x’y’z
0 1 0 x’yz’
0 1 1 x’yz
1 0 0 xy’z’
1 0 1 xy’z
1 1 0 xyz’
1 1 1 xyz
y’ y
x’ x’y’z’ x’y’z x’yz x’yz’
x xy’z’ xy’z xyz xyz’
z’ z z’
Y
m 0 m1 m 3 m 2
X m 4 m 5 m7 m 6
Z
SIMPLIFY USING KARNAUGH MAP
80
• With this ordering, any group of 2, 4 or 8 adjacent squares on the map
contains common literals that can be factored out.
• “Adjacency” includes wrapping around the left and right sides:
•We’ll use this property of adjacent squares to do our
simplifications.
x’y’z + x’yz
= x’z(y’ + y)
= x’z  1
= x’z
Y
x’y’z’ x’y’z x’yz x’yz’
X xy’z’ xy’z xyz xyz’
Z
x’y’z’ + xy’z’ + x’yz’ +
xyz’
= z’(x’y’ + xy’ + x’y +
xy)
= z’(y’(x’ + x) + y(x’ +
x))
= z’(y’+y)
= z’
Y
x’y’z’ x’y’z x’yz x’yz’
X xy’z’ xy’z xyz xyz’
Z
SIMPLIFY USING KARNAUGH MAP
•K-maps define Boolean functions.
•K-maps are equivalent to Truth Tables or Boolean
Expressions.
•K-maps aid visually identifying Prime Implicants
(blocks of 2, 4, 8, ... adjacent squares whose values
are 1) and Essential Prime Implicants (Prime
Implicants that contain a 1-minterm that is not
included in any other Prime Implicants) in each
Boolean function.
•K-maps are good for manual simplification of
SIMPLIFY USING KARNAUGH MAP
• Imagine a two-variable sum of minterms:
x’y’ + x’y
• Both of these minterms appear in the top row of a Karnaugh map, which means
that they both contain the literal x’.
• What happens if you simplify this expression using Boolean algebra?
x’y’ + x’y = x’(y’ + y) [ Distributive ]
= x’  1 [ y + y’ = 1 ]
= x’ [ x  1 = x ]
Y
x’y’ x’y
X xy’ xy
SIMPLIFY USING KARNAUGH MAP
• Another example expression is x’y + xy.
• Both minterms appear in the right side, where y is
uncomplemented.
• Thus, we can reduce x’y + xy to just y.
• How about x’y’ + x’y + xy?
• We have x’y’ + x’y in the top row, corresponding to x’.
• There’s also x’y + xy in the right side, corresponding to y.
• This whole expression can be reduced to x’ + y.
Y
x’y’ x’y
X xy’ xy
Y
x’y’ x’y
X xy’ xy
SIMPLIFY USING KARNAUGH MAP
84
Let’s consider simplifying f(x,y,z) = xy + y’z + xz.
First convert the expression into a sum of minterms form, if it’s
not already.
• The easiest is to make a truth table , and then read off the
minterms.
• You can either write out the literals or use the minterm
shorthand.
Here is the truth table and sum of minterms for our example:
x y z f(x,y,z)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
f(x,y,z) = x’y’z + xy’z +
xyz’ + xyz
= m1 + m5 + m6 + m7
SIMPLIFY USING KARNAUGH MAP
85
• Next is drawing and filling in the K-map.
• Put 1s in the map for each minterm, and 0s in the other squares.
• use either the minterm or the shorthand to show where the 1s and
0s belong.
• In our example, we can write f(x,y,z) in two equivalent ways.
• In either case, the resulting K-map is shown below.
Y
x’y’z’ x’y’z x’yz x’yz’
X xy’z’ xy’z xyz xyz’
Z
f(x,y,z) = x’y’z + xy’z + xyz’ + xyz
Y
m0 m1 m3 m2
X m4 m5 m7 m6
Z
f(x,y,z) = m1 + m5 + m6 + m7
Y
0 1 0 0
X 0 1 1 1
SIMPLIFY USING KARNAUGH MAP
• Fill in the K-map directly from a truth table.
• The output in row i of the table goes into square mi of the K-map.
• Remember that the rightmost columns of the K-map are “switched.”
Y
m0 m1 m3 m2
X m4 m5 m7 m6
Z
x y z f(x,y,z)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Y
X
Z
Y
0 1 0 0
X 0 1 1 1
Z
SIMPLIFY USING KARNAUGH MAP
• The most difficult step is grouping together all the 1s in the K-map.
• Make rectangles around groups of one, two, four or eight 1s.
• All of the 1s in the map should be included in at least one rectangle.
• Do not include any of the 0s.
• Each group corresponds to one product term. For the simplest result:
• Make as few rectangles as possible, to minimize the number of products in the
final expression.
• Make each rectangle as large as possible, to minimize the number of literals in
each term.
Y
0 1 0 0
X 0 1 1 1
Z
SIMPLIFY USING KARNAUGH MAP
• Finally, you can find the Minimal Sum of Product (MSP).
• Each rectangle corresponds to one product term.
• The product is determined by finding the common literals in that
rectangle.
• For our example, we find that xy + y’z + xz = y’z + xy.
Y
0 1 0 0
X 0 1 1 1
Z
Y
x’y’z’ x’y’z x’yz x’yz’
X xy’z’ xy’z xyz xyz’
Z
SIMPLIFY USING KARNAUGH MAP
• Simplify the sum of minterms
• The final MSP here is x’z + y’z + xyz’.
Y
m0 m1 m3 m2
X m4 m5 m7 m6
Z
Y
0 1 1 0
X 0 1 0 1
Z
SIMPLIFY USING KARNAUGH MAP
• Grouping minterms is similar to the three-variable
case, but:
• You can have rectangular groups of 1, 2, 4, 8 or 16
minterms.
• You can wrap around all four sides
Y
m0 m1 m3 m2
m4 m5 m7 m6
m12 m13 m15 m14
X
W
m8 m9 m11 m10
Z
Y
w’x’y’z’ w’x’y’z w’x’yz w’x’yz’
w’xy’z’ w’xy’z w’xyz w’xyz’
wxy’z’ wxy’z wxyz wxyz’
X
W
wx’y’z’ wx’y’z wx’yz wx’yz’
Z
SIMPLIFY USING KARNAUGH MAP
Simplify w’y’z’ + wz + xyz + w’y
The resulting MSP is w’z’ + wz + yz or w’z’ + wz + w’y
Y
w’x’y’z’ w’x’y’z w’x’yz w’x’yz’
w’xy’z’ w’xy’z w’xyz w’xyz’
wxy’z’ wxy’z wxyz wxyz’
X
W
wx’y’z’ wx’y’z wx’yz wx’yz’
Z
Y
1 0 1 1
1 0 1 1
0 1 1 0
X
W
0 1 1 0
Z
Y
X
W
Z
Y
1 0 1 1
1 0 1 1
0 1 1 0
X
W
0 1 1 0
Z
KMAP WITH DON’T CARE CONDITIONS
92
• You don’t always need all 2n
input combinations in an n-
variable function.
• If you can guarantee that certain input combinations never
occur.
• If some outputs aren’t used in the rest of the circuit.
• We mark don’t-care outputs in truth tables and K-maps with
Xs.
x y z f(x,y,z)
0 0 0 0
0 0 1 1
0 1 0 X
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 X
1 1 1 1
KMAP WITH DON’T CARE CONDITIONS
93
• Minimize the given Boolean Expression
This notation means that input combinations wxyz = 0111, 1010 and 1101
(corresponding to minterms m7, m10 and m13) are unused.
Y
1 0 0 1
1 1 x 0
0 x 1 1
X
W
1 0 0 x
Z
KMAP WITH DON’T CARE CONDITIONS
94
f(w,x,y,z) = (0,2,4,5,8,14,15), d(w,x,y,z) = (7,10,13)
Y
1 0 0 1
1 1 x 0 X
W 0 x 1 1
1 0 0 x
Z
All prime implicants are circled. We can treat X’s as 1s if we
want, so the red group includes two X’s, and the light blue
group includes one X.
The only essential prime implicant is x’z’. (An essential
prime implicant is one that covers a minterm that is covered
by no other prime implicants.)
The MSP is x’z’ + wxy + w’xy’. It turns out some of the
groups are redundant; we can cover all of the minterms in
the map without them.
TABULAR METHOD OF MINIMIZATION
95
• The tabular method is particularly useful when
expression is having a large number of variables.
• The method reduces a function in SOP form to a set
of prime implicants from which as many variables are
eliminated as possible. These prime implicants are then
examined to see if some are redundant.
• The tabular method makes repeated use of the law A
+ = 1. As usual a variable in true form is denoted by 1,
in inverted form by 0, and the absence of a variable by a
dash ( - )
TABULAR METHOD OF MINIMIZATION
96
•Rules of Tabular Method
Consider a function of three variables f(A, B, C)
Consider the function:
TABULAR METHOD OF MINIMIZATION
97
• Listing the two minterms shows they can be combined
• Now consider the following
• Note that these variables cannot be combined
TABULAR METHOD OF MINIMIZATION
98
• The number of 1's in a term is significant and is referred
to as its index.
For example: f(A, B, C, D)
0000...........................Index 0
0010, 1000.................Index 1
1010, 0011, 1001.......Index 2
1110, 1011.................Index 3
1111...........................Index 4
The necessary condition for combining two terms is that
the indices
of the two terms must differ by one logic variable which
must also
TABULAR METHOD OF MINIMIZATION
99
Z = f(A,B,C) =
Tabulate the index groups in a column and
insert the
decimal value alongside
(0,1,4,5)
TABULAR METHOD OF MINIMIZATION
100
From the first list, we combine terms that differ by 1 digit only
from one index group to the next. These terms from the first list
are then separated into groups in the second list. Note that the
ticks are just there to show that one term has been combined with
another term. From the second list we can see that the expression
is now reduced to:
Z=A’B’+ B’C’ + B’C + AB’
TABULAR METHOD OF MINIMIZATION
101
From the second list note that the term having an index of 0 can
be combined with the terms of index 1. Bear in mind that the
dash indicates a missing variable and must line up in order to
get a third list. The final simplified expression is:
Z = B’
TABULAR METHOD OF MINIMIZATION
102
Consider the function
f(A, B, C, D) = (0,1,2,3,5,7,8,10,12,13,15)
In binary form.
(0000,0001,0010,0011,0101,0111,1000,1010,1100,11
01,1111)
In the index form
(0,1,1,2,2,3,1,2,2,3,4)
TABULAR METHOD OF MINIMIZATION
103
TABULAR METHOD OF MINIMIZATION
104
The prime Implicants are
F = A’B’+ B’D’ + A’D + BD + AC’D’ + ABC’
The chart is used to remove redundant prime implicants. A grid is
prepared having all the prime implicants listed at the left and all
the minterms of the function along the top. Each minterm covered
by a given prime implicant is marked in the appropriate position.
TABULAR METHOD OF MINIMIZATION
105
TABULAR METHOD OF MINIMIZATION
106
From the above chart
BD is an essential prime implicant. It is the only prime
implicant that covers the minterm decimal 15 and it
also includes 5, 7 and 13.
B’D’ is also an essential prime implicant. It is the only
prime implicant that covers the minterm denoted by
decimal 10 and it also includes the terms 0, 2 and 8.
TABULAR METHOD OF MINIMIZATION
107
The other minterms of the function are 1, 3 and 12
Minterm 1 is present in A’B’& A’D similarly Minterm 3
Therefore use either of these prime implicants for these
minterms.
Minterm 12 is present in AC’D’ & ABC’ either can be
used.
TABULAR METHOD OF MINIMIZATION
108
F = A’B’+ B’D’ + BD + AC’D’
or
F = A’D+ B’D’ + BD + AC’D’
or
F = A’B’+ B’D’ + BD + ABC’
or
F = A’D + B’D’ + BD + ABC’

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

binary number system
 binary number system binary number system
binary number system
 
Number system
Number systemNumber system
Number system
 
Number Systems Basic Concepts
Number Systems Basic ConceptsNumber Systems Basic Concepts
Number Systems Basic Concepts
 
Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental
 
Data representation
Data representationData representation
Data representation
 
Decimal number system
Decimal number systemDecimal number system
Decimal number system
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
 
Number+system (1)
Number+system (1)Number+system (1)
Number+system (1)
 
Number system
Number systemNumber system
Number system
 
Number system
Number systemNumber system
Number system
 
Number system
Number systemNumber system
Number system
 
Number systems r002
Number systems  r002Number systems  r002
Number systems r002
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
 
Computer number systems
Computer number systemsComputer number systems
Computer number systems
 
Number Systems and Binary Aritmetics
Number Systems and Binary AritmeticsNumber Systems and Binary Aritmetics
Number Systems and Binary Aritmetics
 
Number system
Number systemNumber system
Number system
 
Hexadecimal numbers
Hexadecimal  numbersHexadecimal  numbers
Hexadecimal numbers
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
 
01.number systems
01.number systems01.number systems
01.number systems
 
Convert Hexadecimal to decimal
Convert Hexadecimal to decimalConvert Hexadecimal to decimal
Convert Hexadecimal to decimal
 

Similar a Number System

FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...Arti Parab Academics
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1Deepak John
 
digital systems and information
digital systems and informationdigital systems and information
digital systems and informationKamran Zafar
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sssBaia Salihin
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdfAsthaChaurasia4
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).pptnamraashraf56
 
Data repersentation.
Data repersentation.Data repersentation.
Data repersentation.Ritesh Saini
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes Srikrishna Thota
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system CT Sabariah Salihin
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16John Todora
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversionRam Pratap Singh
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Ra'Fat Al-Msie'deen
 

Similar a Number System (20)

FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
digital systems and information
digital systems and informationdigital systems and information
digital systems and information
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sss
 
Computer Number system
Computer Number systemComputer Number system
Computer Number system
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdf
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
 
Data repersentation.
Data repersentation.Data repersentation.
Data repersentation.
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system Ee 202 chapter 1 number and code system
Ee 202 chapter 1 number and code system
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Module 4
Module 4Module 4
Module 4
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
 

Último

Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Number System

  • 1. BOOLEAN ALGEBRA & LOGIC GATESUNIT-I ITA401 : Introduction to Computer Organization Summer Course MCA Instructor: Prof. Ramesh Ragala, SCSE, VITCC Text Books M. Morris Mano – Digital Logic and Computer Design 1
  • 2. OVERVIEW Review of Binary Number Systems Binary Arithmetic & Binary Codes Boolean Algebra & Boolean Theorems Truth tables & Boolean functions Canonical & Standard forms Logic Operations & Logic Gates Karnough Map up to 6 variables (Don't Care Condition) Sum Of Products and Products Of Sum
  • 3. OVERVIEW Digital Computer and Digital Systems: Digital computer: follows a sequence of instructions, called programs that operate on given data. The user can change programs and data according to specific need. Digital system: best example is general purpose digital computer. Characteristics of digital system: manipulation of discrete elements of information. Discrete elements: set of meaningful symbols like electric pulses, decimal digits, the letters of
  • 4. OVERVIEW Digital Computer and Digital Systems:  A sequence of discrete elements of information represents forms a language, that is a discipline that conveys information. In early day, the digital computers are used for numerical computations.  discrete elements are digits. Digital computer  discrete information processing system The discrete elements of information are
  • 5. OVERVIEW Digital Computer and Digital Systems: 
  • 6. THE COMPUTER LEVEL HIERARCHY 6  6:The level with which we are most familiar.  5:The level with which we interact when we write programs in languages such as C, Java.  4:Acts upon assembly language produced from 5.  3: Controls executing processes on the system.  2:Programs written in machine language. No need of compilers, interpreters, or assemblers  1: Control units can be
  • 7. REVIEW OF BINARY NUMBER SYSTEMS We are familiar to do computation using numbers 0 – 9. These are digits of a digital system. why should anyone bother to study the binary number system?  Computers. Computers do not use 10 digits for computation. Every computer processor is made of millions of tiny switches that can be turned off or on. These switches have two states: on / off. Computer to perform its computations with a number
  • 8. UNDERSTANDING OF NUMBER SYSTEMS The base/radix of any number system is determined by the number of digits in the system. Example: binary  base – 2 Number system. (0/1 two only)  110.112 Decimal is a base – 10, because it uses ten digits.  592.3410 Conversion between binary and decimal numbers It needs Relationship between digits of a given number Position of those digits
  • 9. UNDERSTANDING OF NUMBER SYSTEMS In general, the relation between a digit, it position and the base of the number system is expressed by the following formula   6.75 Hundreds Tens Ones . Tenth s Hundredt hs 102 101 100 10-1 10-2 5 9 2 . 1 5 DIGIT * BASE POSITION # Fours Twos Ones . Halve s Fourth 22 21 20 2-1 2-2 1 1 0 . 1 1
  • 10. UNDERSTANDING OF NUMBER SYSTEMS  In order to convert a decimal number to it binary equivalent  repeatedly divide the decimal number by 2. Division by 2 will either give a reminder 1 or 0. The collection of the remainders will gives the binary equivalent of given decimal number. What is the procedure, if the decimal number contains fractional. Instead of dividing by 2, we repeatedly multiply the decimal fraction by 2. If the result is greater than or equal to 1, we add a 1
  • 11. UNDERSTANDING OF NUMBER SYSTEMS  In order to convert a decimal number to it binary equivalent  repeatedly divide the decimal number by 2. Division by 2 will either give a reminder 1 or 0. The collection of the remainders will gives the binary equivalent of given decimal number. What is the procedure, if the decimal number contains fractional. Instead of dividing by 2, we repeatedly multiply the decimal fraction by 2. If the result is greater than or equal to 1, we add a 1
  • 12. NUMBER SYSTEMS – REPRESENTATION Positive radix, positional number systems A number with radix r is represented by a string of digits: An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m + 1 A- m in which 0 < Ai < r and . is the radix point. The string of digits represents the power series: ( ) ( )(Number)r =  + j = - m j j i i = 0 i rArA (Integer Portion) + (Fraction Portion) i = n - 1 j = - 1
  • 13. NUMBER SYSTEMS – EXAMPLES General Decimal Binary Radix (Base) r 10 2 Digits 0 => r - 1 0 => 9 0 => 1 0 1 2 3 Powers of 4 Radix 5 -1 -2 -3 -4 -5 r0 r1 r2 r3 r4 r5 r -1 r -2 r -3 r -4 r -5 1 10 100 1000 10,000 100,000 0.1 0.01 0.001 0.0001 0.00001 1 2 4 8 16 32 0.5 0.25 0.125 0.0625 0.03125
  • 14. SPECIAL POWERS OF 2  Smallest unit in computer is Bit (Binary Digit)  Combination of such 4 bits is called Nibble  Combination of such 8 bits is called Byte is denoted "B"  210 (1,024) is Kilo, denoted " K"  220 (1,048,576) is Mega, denoted "M "  230 (1,073, 741,824) is Giga, denoted "G "  240 (1,099,511,627,776 ) is Tera, denoted " T "  250 (1,125,899,906,842,624) is Peta, denoted "P"  260 (1,152,921,504,606,846,976) is Exa, denoted "E"
  • 15. BASIC CONCEPTS BEHIND THE BINARY SYSTEM Recalling elementary school math (Decimal System) H | T | O 1 | 9 | 3 Years later 10 2 |10 1 |10 0 1 | 9 | 3 Decimal system uses the digits 0-9 to represent numbers 1-hundreds plus 9-tens plus 3- ones = 193 } (1* 102 )+(9*101 )+(3*100 )= 193}
  • 16.  It operates in base 2 rather than base 10(Binary System) 10 2 |10 1 |10 0 2 2 | 2 1 | 2 0 Instead of using the digits 0-9, we only use 0-1 What would the binary number 1011 be in decimal? What would the binary number 1101be in decimal? BINARY SYSTEM
  • 17. BINARY SYSTEM CONTD.. 1011=(1*2 3 )+(0*2 2 )+(1*2 1 )+(1*2 0 ) = (1*8) + (0*4) + (1*2) + (1*1) = 11(not one one its eleven) 1101=(1*23 )+(1*22 )+(0*21 )+(1*20 ) = (1*8) + (1*4) + (0*2) + (1*1) = 13 Like Binary we can define any r-base system. r value for Binary is 2, for Decimal 10, Octal is 8 and Hexadecimal is 16
  • 18. BINARY ARITHMETIC -- ADDITION  Four Rules: Rule – 1 : 0 + 0 = 0 Rule – 2: 0 + 1 = 1 Rule – 3 : 1 + 0 = 1 Rule – 4: 1 + 1 = 10 Example 01111 + 00110 =???? Adding multiple binary numbers: 0111 + 0110 + 1101 + 0101 + 1110 =?
  • 19. BINARY ARITHMETIC -- ADDITION  First, we align the two numbers so that the radix point of each number is located in the same column. 110.01 + 1.011  Next, we fill in the blank spaces with 0s and add the two numbers together. 110.010 + 001.011  The first column adds to 1. 110.010 + 001.011 1  The second column adds to 102, so we write a 0 below it and carry a 1 to the next column. 1 110.010 + 001.011 01  All of the remaining columns add to 1, so we write 1 below them. 1 110.010 + 001.011 111.101  This gives us a final answer of 111.1012. 1 110.010 + 001.011 111.101
  • 20. BINARY ARITHMETIC -- SUBTRACTION  Four Rules: Rule – 1 : 0 - 0 = 0 Rule – 2: 0 - 1 = 1 (Special) Rule – 3 : 1 - 0 = 1 Rule – 4: 1 - 1 = 0 Example: 10101 – 1110 =???? 
  • 21. BINARY ARITHMETIC -- SUBTRACTION 1.To compute the first column, we need to borrow a 1 from the next column. Recall that two 1s generated a carry in addition. If we reverse this process, we can borrow a 1 from the second column and mark two 1s in the first column. 10 - 1 2.Once we borrow from the second column, we cross out the 1 and write 0 above it to show this column is now empty. The 1 from the second column is now represented by the two blue 1s in the first column. 1 01 10 - 1 3.To solve our subtraction problem, we take 1 away from our group of two blue 1s. This leaves us with a single 1 which we write below the first column. 1 01 10 - 1 1 4.After cleaning up our work, we can see that the first column of our answer is identical to Rule 2. Since we must borrow a 1 from the next column, 0 - 1 = 1. 10 - 1 1
  • 22. BINARY ARITHMETIC -- MULTIPLICATION  same techinique as decimal multiplication. Example : multiply 110 by 10 Example : 1111 * 1011 = ????? 
  • 23. BINARY ARITHMETIC -- DIVISION  same techinique as decimal division. Example : 112 / 102 = ?? Example : divide the binary number 1000012 by 1102 
  • 24. BINARY ARITHMETIC Addition (1-bit) Addition (multi-bit) 0 0 1 1 11 (carry) + 0 +1 +0 +1 1010 (10) 0 1 1 10 +1111 (15) 11001 (25) Multiplication (1-bit) Multiplication(multi- bit) 1*1=1, 1*0=0 101 0*1=0, 0*0=0 * 11 101
  • 26. COMMONLY OCCURRING BASES Name Radix Digits Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Decimal 10 0,1,2,3,4,5,6,7,8,9 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The six letters (in addition to the 10 integers) in hexadecimal represent: 26
  • 27. Decimal (Base 10) Binary (Base 2) Octal (Base 8) Hexadecimal (Base 16) 00 00000 00 00 01 00001 01 01 02 00010 02 02 03 00011 03 03 04 00100 04 04 05 00101 05 05 06 00110 06 06 07 00111 07 07 08 01000 10 08 09 01001 11 09 10 01010 12 0A 11 01011 13 0B 12 01100 14 0C 13 01101 15 0D 14 01110 16 0E 15 01111 17 0F 16 10000 20 10 NUMBERS IN DIFFERENT BASES 27
  • 28. CONVERSION BETWEEN BASES To convert from one base to another: 1) Convert the Integer Part 2) Convert the Fraction Part 3) Join the two results with a radix point 28
  • 29. CONVERSION DETAILS To Convert the Integral Part:  Repeatedly divide the number by the new radix and save the remainders. The digits for the new radix are the remainders in reverse order of their computation. If the new radix is > 10, then convert all remainders > 10 to digits A, B, … To Convert the Fractional Part:  Repeatedly multiply the fraction by the new radix and save the integer digits that result. The digits for the new radix are the integer digits in order of their computation. If the new radix is > 10, then convert all integers > 10 to digits A, B, … 29
  • 30. EXAMPLE: CONVERT 11.37510 TO BASE 2 • Convert 11 to Base 2 • Convert 0.375 to Base 2: • Join results together with the radix point: 30
  • 31. ADDITIONAL ISSUE - FRACTIONAL PART • Note that in this conversion, the fractional part can become 0 as a result of the repeated multiplications. • In general, it may take many bits to get this to happen or it may never happen. • Example Problem: Convert 0.6510 to N2 • 0.65 = 0.1010011001001 … • The fractional part begins repeating every 4 steps yielding repeating 1001 forever! • Solution: Specify number of bits to right of radix point and round or truncate to this number. 31
  • 32. CHECKING THE CONVERSION  To convert back, sum the digits times their respective powers of r.  From the prior conversion of 11.37510  10112 = 1*8 +0*4 + 1*2 +1*1  = 8 + 2 + 1  = 11  0.0112 = 1/4 + 1/8  = 0.25 + 0.125  = 0.375 32
  • 33. OCTAL (HEXADECIMAL) TO BINARY AND BACK Octal (Hexadecimal) to Binary:  Restate the octal (hexadecimal) as three (four) binary digits starting at the radix point and going both ways. Binary to Octal (Hexadecimal):  Group the binary digits into three (four) bit groups starting at the radix point and going both ways, padding with zeros as needed in the fractional part.  Convert each group of three(four) bits to an octal(hexadecimal). 33
  • 34. OCTAL TO HEXADECIMAL VIA BINARY Convert octal to binary. Use groups of four bits and convert as above to hexadecimal digits. Example: Octal to Binary to Hexadecimal  6 3 5 . 1 7 7 8  110 011 101 . 001 111 111 2 Regroup:  (000)1 1001 1101. 0011 1111 1(000) 2 Convert 1 9 D . 3 F 8 16 34 || | | | | | |
  • 35. CONVERSION SUMMARY To From Dec Bin Octal Hex Dec - Repeated / or * Thru Bin Thru Bin Bin Add weights of 1s - Convert every 3 digits Convert every 4 digits Octal Add digit*weight Split every digit to 3 - Thru Bin Hex Add digit*weights Split every digit to 4 Thru Bin - 35
  • 36. A FINAL CONVERSION NOTE You can use arithmetic in other bases if you are careful: Example: Convert 1011102 to Base 10 using binary arithmetic:  Step 1 101110 / 1010 = 100 r 0110  Step 2 100 / 1010 = 0 r 0100  Converted Digits are 01002 | 01102  or 4 6 10 36
  • 37. BINARY NUMBERS AND BINARY CODING Flexibility of representation  Within constraints below, can assign any binary combination (called a code word) to any data as long as data is uniquely encoded. Information Types  Numeric  Must represent range of data needed  Very desirable to represent data such that simple, straightforward computation for common arithmetic operations permitted  Tight relation to binary numbers  Non-numeric  Greater flexibility since arithmetic operations not applied.  Not tied to binary numbers 37
  • 38. Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the 2n binary numbers. Example: A binary code for the seven colors of the rainbow Code 100 is not used NON-NUMERIC BINARY CODES Binary Number 000 001 010 011 101 110 111 Color Red Orange Yellow Green Blue Indigo Violet 38
  • 39. Given M elements to be represented by a binary code, the minimum number of bits, n, needed, satisfies the following relationships:  2n  M > 2(n – 1)  n = log2 M where x , called the ceiling function, is the integer greater than or equal to x. Example: How many bits are required to represent decimal digits with a binary code? NUMBER OF BITS REQUIRED 39
  • 40. NUMBER OF ELEMENTS REPRESENTED Given n digits in radix r, there are rn distinct elements that can be represented. But, you can represent m elements, m < rn Examples: You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11). You can represent 4 elements in radix r = 2 with n = 4 digits: (0001, 0010, 0100, 1000). This second code is called a "one hot" code. 40
  • 41. DECIMAL CODES - BINARY CODES FOR DECIMAL DIGITS Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray 0 0000 0011 0000 0000 1 0001 0100 0111 0001 2 0010 0101 0110 0011 3 0011 0110 0101 0010 4 0100 0111 0100 0110 5 0101 1000 1011 0111 6 0110 1001 1010 0101 7 0111 1010 1001 0100 8 1000 1011 1000 1100 9 1001 1100 1111 1101 There are over 8,000 ways that you can chose 10 elements from the 16 binary numbers of 4 bits. A few are useful:
  • 42. BINARY CODES -- CLASSIFICATION OF BINARY CODES • The digital data is represented, stored and transmitted as group of binary bits. This group is also called as binary code. • How many Bits are needed????? 4 • The codes are broadly categorized into following four categories. • Weighted Codes • Non-Weighted Codes • Binary Coded Decimal Code • Alphanumeric Codes • Error Detecting Codes • Error Correcting Codes 42
  • 43. • What special property does the Gray code have in relation to adjacent decimal digits?  used for error correction. • two successive values differ in only one bit (binary digit) GRAY CODE (REFLECTED CODE) – DECIMAL Decimal 8,4,2,1 Gray 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0001 8 1000 1100 9 1001 1101
  • 44. BINARY CODED DECIMAL (BCD) •The BCD code is the 8,4,2,1 code. •8, 4, 2, and 1 are weights •BCD is a weighted code •This code is the simplest, most intuitive binary code for decimal digits and uses the same powers of 2 as a binary number, but only encodes the first ten values from 0 to 9. •Example: 1001 (9) = 1000 (8) + 0001 (1) •How many “invalid” code words are there? •What are the “invalid” code words? 44
  • 45. WARNING: CONVERSION OR CODING? • Do NOT mix up conversion of a decimal number to a binary number with coding a decimal number with a BINARY CODE. •1310 = 11012 (This is conversion) •13  0001|0011 (This is coding) 45
  • 46. BCD ARITHMETIC Given a BCD code, we use binary arithmetic to add the digits: 8 1000 Eight +5 +0101 Plus 5 13 1101 is 13 (> 9) Note that the result is MORE THAN 9, so must be represented by 2 digits! To correct the digit, subtract 10 by adding 6 modulo 16. 8 1000 Eight +5 +0101 Plus 5 13 1101 is 13 (> 9) +0110 so add 6 carry = 10011 leaving 3 + cy 0001 | 0011Final answer (two digits) If the digit sum is > 9, add one to the next significant digit 46
  • 48. ALPHANUMERIC CODES - ASCII CHARACTER CODES • 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). 48
  • 50. ASCII PROPERTIES ASCII has some interesting properties: Digits 0 to 9 span Hexadecimal values 3016to 3916 Upper case A-Z span 4116to 5A16. Lower case a-z span 6116to 7A16. • Lower to upper case translation (and vice versa) occurs byflipping 6th bit Delete (DEL) is all bits set,a carryover from when punched paper tape was used to store messages. Punching all holes in a row erased a mistake! 50
  • 51. UNICODE • 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 • See Reading Supplement – Unicode on the Companion Website 51
  • 52. PARITY BIT ERROR-DETECTION CODES • 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. 52
  • 53. 4-BIT PARITY CODE EXAMPLE • Fill in the even and odd parity bits: • The codeword "1111" has even parity and the codeword "1110" has odd parity. Both can be used to represent 3-bit data. Even Parity Odd Parity Message - Parity Message - Parity 000 - 000 - 001 - 001 010 - 010 - 011 - 011 - 100 - 100 - 101 - 101 - 110 - 110 - 111 - 111 - 53 -
  • 54. 54 BASIC DEFINITIONS • Binary Operators • AND z = x • y = x y z=1 if x=1 AND y=1 • OR z = x + y z=1 if x=1 OR y=1 • NOT z = x = x’ z=1 if x=0 • Boolean Algebra • Binary Variables: only ‘0’ and ‘1’ values
  • 55. 55 BOOLEAN ALGEBRA POSTULATES • Closure x, y ∈ S; z = x y , z ∈S ; S is closed under {N,+} • Commutative Law x • y = y • x x + y = y + x • Identity Element x • 1 = x x + 0 = x • Complement x • x’ = 0 x + x’ = 1 • Inverse x, y∈ S; x y=y x=e ; e is Identity of S. Additive inverse {R, x, -x} * * * *
  • 56. 56 BOOLEAN ALGEBRA THEOREMS • Duality • The dual of a Boolean algebraic expression is obtained by interchanging the AND with OR operators and replacing the 1’s by 0’s and the 0’s by 1’s. • x • ( y + z ) = ( x • y ) + ( x • z ) • x + ( y • z ) = ( x + y ) • ( x + z ) • Theorem 1 • x • x = x x + x = x • Theorem 2 • x • 0 = 0 x + 1 = 1
  • 57. BOOLEAN ALGEBRA THEOREMS Theorem 3: Involution  ( x’ )’ = x ( x ) = x Theorem 4: Associative & Distributive  ( x • y ) • z = x • ( y • z )  ( x + y ) + z = x + ( y + z )  x • ( y + z ) = ( x • y ) + ( x • z )  x + ( y • z ) = ( x + y ) • ( x + z ) Theorem 5: DeMorgan  ( x • y )’ = x’ + y’ ( x + y )’ = x’ • y’  ( x • y ) = x + y ( x + y ) = x • y Theorem 6: Absorption  x • ( x + y ) = x x + ( x • y ) = x
  • 58. OPERATOR PRECEDENCE • Parentheses ( . . . ) • ( . . .) • NOT x’ + y • AND x + x • y • OR ])([ xwzyx ++ ])([ )( )( )( )( xwzyx xwzy xwz xw xw ++ ++ + + +
  • 59. DEMORGAN’S THEOREM )]([ edcba ++ )]([ edcba +++ ))(( edcba ++ ))(( edcba +++ ))(( edcba ++ )( edcba ++
  • 60. 60 BOOLEAN FUNCTIONS • Boolean Expression Example: F = x + y’ z • Truth Table All possible combinations of input variables • Logic Circuit x y z F 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 1 1 1 1 1 x y z F
  • 61. ALGEBRAIC MANIPULATION • Literal: A single variable within a term that may be complemented or not. • Use Boolean Algebra to simplify Boolean functions to produce simpler circuits Example: Simplify to a minimum number of literals F = x + x’ y ( 3 Literals) = x + ( x’ y ) = ( x + x’ ) ( x + y ) = ( 1 ) ( x + y ) = x + y ( 2 Literals)Distributive law (+ over •)
  • 62. COMPLEMENT OF A FUNCTION • DeMorgan’s Theorm • Duality & Literal Complement CBAF ++ CBAF ++ CBAF  CBAF ++ CBAF  CBAF 
  • 63. 63 CANONICAL FORMS • Minterm • Product (AND function) • Contains all variables • Evaluates to ‘1’ for a specific combination Example A = 0 A B C B = 0 (0) • (0) • (0) C = 0 1 • 1 • 1 = 1 A B C Minterm 0 0 0 0 m0 1 0 0 1 m1 2 0 1 0 m2 3 0 1 1 m3 4 1 0 0 m4 5 1 0 1 m5 6 1 1 0 m6 7 1 1 1 m7 CBA CBA CBA CBA CBA CBA CBA CBA
  • 64. 64 CANONICAL FORMS • Maxterm • Sum (OR function) • Contains all variables • Evaluates to ‘0’ for a specific combination Example A = 1 A B C B = 1 (1) + (1) + (1) C = 1 0 + 0 + 0 = 0 A B C Maxterm 0 0 0 0 M0 1 0 0 1 M1 2 0 1 0 M2 3 0 1 1 M3 4 1 0 0 M4 5 1 0 1 M5 6 1 1 0 M6 7 1 1 1 M7 CBA ++ CBA ++ CBA ++ CBA ++ CBA ++ CBA ++ CBA ++ CBA ++
  • 65. CANONICAL FORMS • Truth Table to Boolean Function A B C F 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 CBAF  CBA+ CBA+ ABC+
  • 66. 66 CANONICAL FORMS A B C F 0 0 0 0 0 1 0 0 1 1 2 0 1 0 0 3 0 1 1 0 4 1 0 0 1 5 1 0 1 1 6 1 1 0 0 7 1 1 1 1 ABCCBACBACBAF +++ 7541 mmmmF +++  )7,5,4,1(F CABBCACBACBAF +++ CABBCACBACBAF +++ CABBCACBACBAF  ))()()(( CBACBACBACBAF ++++++++ 6320 MMMMF   (0,2,3,6)F F 1 0 1 1 0 0 1 0  Sum of Minterms  Product of Maxterms
  • 67. 67 STANDARD FORMS • Sum of Products (SOP) ABCCBACBACBAF +++ AC BBAC  + )( CB AACB  + )( BA BA CCBA   + )1( )( )()()( BBACCCBAAACBF +++++ ACBACBF ++
  • 68. 68 STANDARD FORMS • Product of Sums (POS) )( AACB + )( BBCA + )( CCBA + )()()( AACBCCBABBCAF +++++ CBBACAF ++ CABBCACBACBAF +++ ))()(( CBBACAF +++
  • 69. TWO-LEVEL IMPLEMENTATIONS • Sum of Products (SOP) • Product of Sums (POS) ACBACBF ++ ))()(( CBBACAF +++ B’ C FB’ A A C A C FB’ A B’ C
  • 70. LOGIC OPERATORS • AND • NAND (Not AND) x y NAND 0 0 1 0 1 1 1 0 1 1 1 0 x y AND 0 0 0 0 1 0 1 0 0 1 1 1 x y x • y x y x • y
  • 71. 71 LOGIC OPERATORS • OR • NOR (Not OR) x y OR 0 0 0 0 1 1 1 0 1 1 1 1 x y NOR 0 0 1 0 1 0 1 0 0 1 1 0 x y x + y x y x + y
  • 72. 72 LOGIC OPERATORS • XOR (Exclusive-OR) • XNOR (Exclusive-NOR) (Equivalence) x y XOR 0 0 0 0 1 1 1 0 1 1 1 0 x y XNOR 0 0 1 0 1 0 1 0 0 1 1 1 x y x Å y x  y x y + x y x y x Å y x y + x y
  • 73. 73 LOGIC OPERATORS • NOT (Inverter) • Buffer x NOT 0 1 1 0 x Buffer 0 0 1 1 x x x x
  • 75. 75 DEMORGAN’S THEOREM ON GATES • AND Gate • F = x • y F = (x • y) F = x + y • OR Gate • F = x + y F = (x + y) F = x • y  Change the “Shape” and “bubble” all lines
  • 76. SIMPLIFICATION OF BOOLEAN FUNCTIONS 76 Algebraic Method K-Map Method Tabular Method Schienman Method Simplified expressions lead to simplified circuits A function’s truth-table representation is unique; its algebraic expression is not
  • 77. SIMPLIFY USING ALGEBRAIC THEOREMS • Advantage: Purely based on Boolean Algebra theorems • Disadvantage: No Suitable algorithm to apply (Trial type of method) F = xy’ + xy +yz = x(y’ + y) + yz = x(1) + yz = x + yz • How many Gates we minimized?
  • 78. SIMPLIFY USING KARNAUGH MAP • Advantage: Simplest and Widely accepted • Disadvantage: Applicable for only up to Six variables A two-variable function has four possible minterms. We can re-arrange these minterms into a Karnaugh map (K-map). x y minterm 0 0 x’y’ 0 1 x’y 1 0 xy’ 1 1 xy Y 0 1 X 0 x’y’ x’y 1 xy’ xy Y’ Y X’ x’y’ x’y X xy’ xy
  • 79. SIMPLIFY USING KARNAUGH MAP For a three-variable expression with inputs x, y, z, the arrangement of minterms is more tricky YZ 00 01 11 10 X 0 x’y’z’ x’y’z x’yz x’yz’ 1 xy’z’ xy’z xyz xyz’ YZ 00 01 11 10 0 m0 m1 m3 m2 X 1 m4 m5 m7 m6 x y z minterm 0 0 0 x’y’z’ 0 0 1 x’y’z 0 1 0 x’yz’ 0 1 1 x’yz 1 0 0 xy’z’ 1 0 1 xy’z 1 1 0 xyz’ 1 1 1 xyz y’ y x’ x’y’z’ x’y’z x’yz x’yz’ x xy’z’ xy’z xyz xyz’ z’ z z’ Y m 0 m1 m 3 m 2 X m 4 m 5 m7 m 6 Z
  • 80. SIMPLIFY USING KARNAUGH MAP 80 • With this ordering, any group of 2, 4 or 8 adjacent squares on the map contains common literals that can be factored out. • “Adjacency” includes wrapping around the left and right sides: •We’ll use this property of adjacent squares to do our simplifications. x’y’z + x’yz = x’z(y’ + y) = x’z  1 = x’z Y x’y’z’ x’y’z x’yz x’yz’ X xy’z’ xy’z xyz xyz’ Z x’y’z’ + xy’z’ + x’yz’ + xyz’ = z’(x’y’ + xy’ + x’y + xy) = z’(y’(x’ + x) + y(x’ + x)) = z’(y’+y) = z’ Y x’y’z’ x’y’z x’yz x’yz’ X xy’z’ xy’z xyz xyz’ Z
  • 81. SIMPLIFY USING KARNAUGH MAP •K-maps define Boolean functions. •K-maps are equivalent to Truth Tables or Boolean Expressions. •K-maps aid visually identifying Prime Implicants (blocks of 2, 4, 8, ... adjacent squares whose values are 1) and Essential Prime Implicants (Prime Implicants that contain a 1-minterm that is not included in any other Prime Implicants) in each Boolean function. •K-maps are good for manual simplification of
  • 82. SIMPLIFY USING KARNAUGH MAP • Imagine a two-variable sum of minterms: x’y’ + x’y • Both of these minterms appear in the top row of a Karnaugh map, which means that they both contain the literal x’. • What happens if you simplify this expression using Boolean algebra? x’y’ + x’y = x’(y’ + y) [ Distributive ] = x’  1 [ y + y’ = 1 ] = x’ [ x  1 = x ] Y x’y’ x’y X xy’ xy
  • 83. SIMPLIFY USING KARNAUGH MAP • Another example expression is x’y + xy. • Both minterms appear in the right side, where y is uncomplemented. • Thus, we can reduce x’y + xy to just y. • How about x’y’ + x’y + xy? • We have x’y’ + x’y in the top row, corresponding to x’. • There’s also x’y + xy in the right side, corresponding to y. • This whole expression can be reduced to x’ + y. Y x’y’ x’y X xy’ xy Y x’y’ x’y X xy’ xy
  • 84. SIMPLIFY USING KARNAUGH MAP 84 Let’s consider simplifying f(x,y,z) = xy + y’z + xz. First convert the expression into a sum of minterms form, if it’s not already. • The easiest is to make a truth table , and then read off the minterms. • You can either write out the literals or use the minterm shorthand. Here is the truth table and sum of minterms for our example: x y z f(x,y,z) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 f(x,y,z) = x’y’z + xy’z + xyz’ + xyz = m1 + m5 + m6 + m7
  • 85. SIMPLIFY USING KARNAUGH MAP 85 • Next is drawing and filling in the K-map. • Put 1s in the map for each minterm, and 0s in the other squares. • use either the minterm or the shorthand to show where the 1s and 0s belong. • In our example, we can write f(x,y,z) in two equivalent ways. • In either case, the resulting K-map is shown below. Y x’y’z’ x’y’z x’yz x’yz’ X xy’z’ xy’z xyz xyz’ Z f(x,y,z) = x’y’z + xy’z + xyz’ + xyz Y m0 m1 m3 m2 X m4 m5 m7 m6 Z f(x,y,z) = m1 + m5 + m6 + m7 Y 0 1 0 0 X 0 1 1 1
  • 86. SIMPLIFY USING KARNAUGH MAP • Fill in the K-map directly from a truth table. • The output in row i of the table goes into square mi of the K-map. • Remember that the rightmost columns of the K-map are “switched.” Y m0 m1 m3 m2 X m4 m5 m7 m6 Z x y z f(x,y,z) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Y X Z Y 0 1 0 0 X 0 1 1 1 Z
  • 87. SIMPLIFY USING KARNAUGH MAP • The most difficult step is grouping together all the 1s in the K-map. • Make rectangles around groups of one, two, four or eight 1s. • All of the 1s in the map should be included in at least one rectangle. • Do not include any of the 0s. • Each group corresponds to one product term. For the simplest result: • Make as few rectangles as possible, to minimize the number of products in the final expression. • Make each rectangle as large as possible, to minimize the number of literals in each term. Y 0 1 0 0 X 0 1 1 1 Z
  • 88. SIMPLIFY USING KARNAUGH MAP • Finally, you can find the Minimal Sum of Product (MSP). • Each rectangle corresponds to one product term. • The product is determined by finding the common literals in that rectangle. • For our example, we find that xy + y’z + xz = y’z + xy. Y 0 1 0 0 X 0 1 1 1 Z Y x’y’z’ x’y’z x’yz x’yz’ X xy’z’ xy’z xyz xyz’ Z
  • 89. SIMPLIFY USING KARNAUGH MAP • Simplify the sum of minterms • The final MSP here is x’z + y’z + xyz’. Y m0 m1 m3 m2 X m4 m5 m7 m6 Z Y 0 1 1 0 X 0 1 0 1 Z
  • 90. SIMPLIFY USING KARNAUGH MAP • Grouping minterms is similar to the three-variable case, but: • You can have rectangular groups of 1, 2, 4, 8 or 16 minterms. • You can wrap around all four sides Y m0 m1 m3 m2 m4 m5 m7 m6 m12 m13 m15 m14 X W m8 m9 m11 m10 Z Y w’x’y’z’ w’x’y’z w’x’yz w’x’yz’ w’xy’z’ w’xy’z w’xyz w’xyz’ wxy’z’ wxy’z wxyz wxyz’ X W wx’y’z’ wx’y’z wx’yz wx’yz’ Z
  • 91. SIMPLIFY USING KARNAUGH MAP Simplify w’y’z’ + wz + xyz + w’y The resulting MSP is w’z’ + wz + yz or w’z’ + wz + w’y Y w’x’y’z’ w’x’y’z w’x’yz w’x’yz’ w’xy’z’ w’xy’z w’xyz w’xyz’ wxy’z’ wxy’z wxyz wxyz’ X W wx’y’z’ wx’y’z wx’yz wx’yz’ Z Y 1 0 1 1 1 0 1 1 0 1 1 0 X W 0 1 1 0 Z Y X W Z Y 1 0 1 1 1 0 1 1 0 1 1 0 X W 0 1 1 0 Z
  • 92. KMAP WITH DON’T CARE CONDITIONS 92 • You don’t always need all 2n input combinations in an n- variable function. • If you can guarantee that certain input combinations never occur. • If some outputs aren’t used in the rest of the circuit. • We mark don’t-care outputs in truth tables and K-maps with Xs. x y z f(x,y,z) 0 0 0 0 0 0 1 1 0 1 0 X 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 X 1 1 1 1
  • 93. KMAP WITH DON’T CARE CONDITIONS 93 • Minimize the given Boolean Expression This notation means that input combinations wxyz = 0111, 1010 and 1101 (corresponding to minterms m7, m10 and m13) are unused. Y 1 0 0 1 1 1 x 0 0 x 1 1 X W 1 0 0 x Z
  • 94. KMAP WITH DON’T CARE CONDITIONS 94 f(w,x,y,z) = (0,2,4,5,8,14,15), d(w,x,y,z) = (7,10,13) Y 1 0 0 1 1 1 x 0 X W 0 x 1 1 1 0 0 x Z All prime implicants are circled. We can treat X’s as 1s if we want, so the red group includes two X’s, and the light blue group includes one X. The only essential prime implicant is x’z’. (An essential prime implicant is one that covers a minterm that is covered by no other prime implicants.) The MSP is x’z’ + wxy + w’xy’. It turns out some of the groups are redundant; we can cover all of the minterms in the map without them.
  • 95. TABULAR METHOD OF MINIMIZATION 95 • The tabular method is particularly useful when expression is having a large number of variables. • The method reduces a function in SOP form to a set of prime implicants from which as many variables are eliminated as possible. These prime implicants are then examined to see if some are redundant. • The tabular method makes repeated use of the law A + = 1. As usual a variable in true form is denoted by 1, in inverted form by 0, and the absence of a variable by a dash ( - )
  • 96. TABULAR METHOD OF MINIMIZATION 96 •Rules of Tabular Method Consider a function of three variables f(A, B, C) Consider the function:
  • 97. TABULAR METHOD OF MINIMIZATION 97 • Listing the two minterms shows they can be combined • Now consider the following • Note that these variables cannot be combined
  • 98. TABULAR METHOD OF MINIMIZATION 98 • The number of 1's in a term is significant and is referred to as its index. For example: f(A, B, C, D) 0000...........................Index 0 0010, 1000.................Index 1 1010, 0011, 1001.......Index 2 1110, 1011.................Index 3 1111...........................Index 4 The necessary condition for combining two terms is that the indices of the two terms must differ by one logic variable which must also
  • 99. TABULAR METHOD OF MINIMIZATION 99 Z = f(A,B,C) = Tabulate the index groups in a column and insert the decimal value alongside (0,1,4,5)
  • 100. TABULAR METHOD OF MINIMIZATION 100 From the first list, we combine terms that differ by 1 digit only from one index group to the next. These terms from the first list are then separated into groups in the second list. Note that the ticks are just there to show that one term has been combined with another term. From the second list we can see that the expression is now reduced to: Z=A’B’+ B’C’ + B’C + AB’
  • 101. TABULAR METHOD OF MINIMIZATION 101 From the second list note that the term having an index of 0 can be combined with the terms of index 1. Bear in mind that the dash indicates a missing variable and must line up in order to get a third list. The final simplified expression is: Z = B’
  • 102. TABULAR METHOD OF MINIMIZATION 102 Consider the function f(A, B, C, D) = (0,1,2,3,5,7,8,10,12,13,15) In binary form. (0000,0001,0010,0011,0101,0111,1000,1010,1100,11 01,1111) In the index form (0,1,1,2,2,3,1,2,2,3,4)
  • 103. TABULAR METHOD OF MINIMIZATION 103
  • 104. TABULAR METHOD OF MINIMIZATION 104 The prime Implicants are F = A’B’+ B’D’ + A’D + BD + AC’D’ + ABC’ The chart is used to remove redundant prime implicants. A grid is prepared having all the prime implicants listed at the left and all the minterms of the function along the top. Each minterm covered by a given prime implicant is marked in the appropriate position.
  • 105. TABULAR METHOD OF MINIMIZATION 105
  • 106. TABULAR METHOD OF MINIMIZATION 106 From the above chart BD is an essential prime implicant. It is the only prime implicant that covers the minterm decimal 15 and it also includes 5, 7 and 13. B’D’ is also an essential prime implicant. It is the only prime implicant that covers the minterm denoted by decimal 10 and it also includes the terms 0, 2 and 8.
  • 107. TABULAR METHOD OF MINIMIZATION 107 The other minterms of the function are 1, 3 and 12 Minterm 1 is present in A’B’& A’D similarly Minterm 3 Therefore use either of these prime implicants for these minterms. Minterm 12 is present in AC’D’ & ABC’ either can be used.
  • 108. TABULAR METHOD OF MINIMIZATION 108 F = A’B’+ B’D’ + BD + AC’D’ or F = A’D+ B’D’ + BD + AC’D’ or F = A’B’+ B’D’ + BD + ABC’ or F = A’D + B’D’ + BD + ABC’