0% found this document useful (0 votes)
4 views80 pages

Chapter 2 - Number Systems and Boolean Algebra

The document covers digital logic, focusing on number systems, Boolean algebra, and their applications in computer architecture. It explains various number systems, conversion methods, and the laws of Boolean algebra, including simplification techniques and canonical forms. Additionally, it introduces Karnaugh maps for logical network simplifications.
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)
4 views80 pages

Chapter 2 - Number Systems and Boolean Algebra

The document covers digital logic, focusing on number systems, Boolean algebra, and their applications in computer architecture. It explains various number systems, conversion methods, and the laws of Boolean algebra, including simplification techniques and canonical forms. Additionally, it introduces Karnaugh maps for logical network simplifications.
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/ 80

CSSE4205/ITSE305

Computer Architecture &


Organization
Chapter 2
DIGITAL LOGIC -
NUMBER SYSTEMS AND BOOLEAN ALGEBRA
Objectives
1. Explain the various number systems.
2. Compose the transformation of number systems.
3. Explain the laws and axioms of Boolean algebra.
4. Demonstrate SOP, POS and standard forms of Boolean
expressions.
5. Analyze various reduction methods on Boolean
expressions.
6. Compose reduced expressions using various reduction
methods.
7. Describe logic gates and its functions.
8. Compose circuits using Logic gates.
Number System
• a writing system for expressing numbers, that
is, a mathematical notation for representing
numbers of a given set, using digits or other
symbols in a consistent manner.
Number System
• Bases or Radix
– the number of unique digits, including zero, that a
positional numeral system uses to represent
numbers
Number System
• Bases or Radix
Examples
• 1010 represents the number ten in the decimal system.
• 102 represent the number two in a base/radix two
system (binary).
• 68 represent the number six in base/radix eight systems
(Octal).
• B16 represent the number eleven in base/radix sixteen
systems (Hexadecimal).
In general, 7N represents the number 7 in base/radix
N
Bases or Radix
Base Name Description

10 Decimal Its ten digits are "0–9".

• Used by nearly all computers


2 Binary
• The two digits are "0" and "1"

8 Octal The eight digits are "0–7".


The sixteen digits are "0–9" followed by
16 Hexadecimal
"A–F".

N Generic N unique digits from 0 to “N-1”


Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Decimal to any number system (N)
– Using Short Division by N with Remainder

Example:
Convert 15610 to binary
Decimal to Binary
Example:
Convert 15610 to binary
Convert 15610 to binary
156 / 2 = 78 with 0 remainder
78 / 2 = 39 with 0 remainder
39 / 2 = 19 with 1 remainder
19 / 2 = 9 with 1 remainder
9 / 2 = 4 with 1 remainder
4 / 2 = 2 with 0 remainder
2 / 2 = 1 with 0 remainder
1 / 2 = 0 with 1 remainder

15610 = 100111002
Exercise
Convert 15610 to octal
Convert 15610 to octal

156 / 8 = 19 with 4 remainder


19 / 8 = 2 with 3 remainder
2 / 8 = 0 with 2 remainder

15610 = 2348
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Any number system (N) to Decimal
– Sum of the products of powers of N

Example:
Convert 2348 to decimal (base 10)
Convert 2348 to Decimal (base 10)

4096 512 64 8 1
84 83 82 81 80

2348 = (2x82) + (3x81) + (4x80)


= (2x64) + (3x8) + (4x1)
= (128) + (24) + (4)
= 156
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Binary to Octal
• Group by 3 digits from the right
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Binary to Hexadecimal
• Group by 4 digits from the right
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Number Conversion
• Octal to binary
Binary
Octal
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
Number Conversion
• Decimal to any number system
• Any number system to Decimal
• Binary to Octal
• Binary to Hexadecimal
• Octal to Binary
• Hexadecimal to Binary
Number Conversion
• Hexadecimal to binary
Decimal Hexadecimal Binary
0 0 0 0 0 0
1 1 0 0 0 1
2 2 0 0 1 0
3 3 0 0 1 1
4 4 0 1 0 0
5 5 0 1 0 1
6 6 0 1 1 0
7 7 0 1 1 1
8 8 1 0 0 0
9 9 1 0 0 1
10 A 1 0 1 0
11 B 1 0 1 1
12 C 1 1 0 0
13 D 1 1 0 1
14 E 1 1 1 0
15 F 1 1 1 1
Exercise
1. Convert C59D16 to binary
2. Convert 110001111002 to octal
BINARY OPERATIONS
(REVIEW/REFRESHER)
Binary Addition
Binary Addition

1001 0111 1010


+ 0101 + 0011 + 1101
--------------- --------------- ---------------
Binary Addition

1001 0111 1010


+ 0101 + 0011 + 1101
--------------- --------------- ---------------
1110 1010 10111
1’s Complement
• In Binary Number System
• Change 1 to 0 and 0 to 1
Examples:
Binary Number 1’s Complement
101100 010011
0000 1111
1111 0000
2’s Complement
• 1’s complement + 1
Examples:

Binary Number 2’s Complement

101100 010011 + 1 = 010100


0000 1111 + 1 = 10000
111 000 + 1 = 001
Boolean Algebra
• Sub-area of algebra in which the values of the
variables are the truth values true and false,
usually denoted 1 and 0 respectively
Laws and Axioms of Boolean algebra
Sno Law OR AND
1 Commutative law A+B=B+A A.B = B.A
2 Associative law A+(B+C) = (A+B)+C A.(B.C) = (A.B).C
3 Distributive law A + (B.C) = (A + B).(A + C) A.(B + C) = A.B + A.C
4 A+A.B = A A.(A+B) = A
Absorption laws
5 A+ĀB = A+B A.(Ā+B) = A.B
6 Consensus Laws AB + ĀC+BC = AB+ĀC (A+B).(Ā+C).(B+C) = (A+B).(Ā+C)
7 A+0=A A.0 = 0
8 A+1=1 A.1 = A
Other Laws
9 A+A=A A.A = A
(Identity Laws)
10 A+Ā=1 A. Ā = 0
11 Ā=A
De Morgan’s
12 = • = +
Laws
Simplification of Boolean expressions
Simplify the following expression:
Z= (A + B) (A + C)
• Z = (A + B)(A + C)
• AA + AC + AB + BC - Distributive law
• A + AC + AB + BC - Identity AND law (A.A = A)
• A(1 + C) + AB + BC – Distributive law
• A.1 + AB + BC - Identity OR law (1 + C = 1)
• A(1 + B) + BC - Distributive law
• A.1 + BC - Identity OR law (1 + B = 1)
• Z = A + BC - Identity AND law (A.1 = A)
Simplification of Boolean expressions
Simplify C + :

• C+ Original Expression
• C + (+ ) DeMorgan's Law
• C + () Commutative Law
• (C + + Associative Laws
• 1+ Identity Law
• 1 Identity Law
Simplification of Boolean expressions
Simplify Y = ĀBC+ĀBC+ABC+ABC:

• ĀC(B+B)+AC(B+B) => Distributive Law


• ĀCB+ACB => Identity Law: B+B=B
• BC(Ā+A) => Distributive Law
• BC.1 => Identity Law: Ā+A=1
• BC => Identity Law:BC.1=BC

Thus Y = BC
Exercise
Show complete solution of the
following:

Simplify the expression using


laws/axioms:
B + BCD + B’CD + AB + A’B + B’C
Inverse of Boolean Expression
• Complement of Boolean expression
– all . signs are changed to + signs
– all + signs are changed to . Signs
– all 1s are changed to 0s
– all 0s are changed to 1s
– all literals are complemented
Inverse of Boolean Expression
Example: Find the complement of
1.X + Z + 0

= (0 + ) (Y + ) (1)
Canonical normal form
• Any Boolean expression may be expressed in
terms of either minterms or maxterms.
• For an expression with N variables, minterms
and maxterms are defined as follows :
– A minterm is the product of N distinct literals
where each literal occurs exactly once.
– A maxterm is the sum of N distinct literals where
each literal occurs exactly once.
Minterms and Maxterms for two-variable
expression

X Y Minterm Maxterm

0 0 X'.Y' X+Y
0 1 X'.Y X+Y'
1 0 X.Y' X'+Y
1 1 X.Y X'+Y'
Canonical Forms
• There are two canonical forms :
– sum-of-products (∑)
• Defined as the sum of the minterms
– Product-of-sums (π).
• Defined as the product of the maxterms.
Sum-of-products/Sum-of-minterms

∑(1,4,7)

F = x’y’z + xy’z’ + xyz


Product-of-sums/
Product-of-maxterms
π(0,2,3)

F = (x+y+z).( x+y'+z).( x+y'+z')


Canonical Form Conversion
• interchange the ∑ and π signs and replace the
row numbers with those not included in the
original form
• For example:
π(2,4,6) = ∑(0,1,3,5,7)
Canonical Form Conversion
Example:
Given F(A,B,C) = π(0,2,3,4,6)
1. Convert F to ∑
2. Write the expression from (1) using
minterms/maxterms.
Canonical Form Conversion
Example – Answers:
Given F(A,B,C) = π(0,2,3,4,6)
1. Convert F to ∑
= ∑(1,5,7)
2. Write the expression from (1) using
minterms/maxterms.
= A’B’C + AB’C + ABC
Standard Form
• In this form of the Boolean expression, all the
terms or variables are available in term.
• The standard forms are the expanded forms of
the Boolean expression which further can be
reduced using any reduction method.
Standard Form - Example
F = x + yz’ + xyz
= x (y+y’) (z+z’) + (x+x’)yz’ + xyz
[Using rules A+A’ = 1, and A.1 = A]
= (xy+xy’) (z+z’) + xyz’ + x’yz’ + xyz
= xyz + xyz’ + xy’z + xy’z’ + xyz’ + x’yz’ + xyz
= xyz’ + xy’z + xy’z’ + xyz’ + x’yz’ + xyz + xyz
= xyz’ + xy’z + xy’z’ + x’yz’ + xyz
[Using rule A+A = A]
= x’yz’ + xy’z’+ xy’z + xyz’ + xyz
[After re arranging the same output function]
Exercise
Show complete solution of the
following:

Convert following expression to


standard form:
• F(a,b,c) = ab+a’c+abc
K-Map Method
• A Karnaugh map or K-Map is a two-
dimensional truth-table
• logical network simplifications can be easily
recognized from a K-map
K-Map Method
1. Given expression should be in standard form.
2. Plot the terms of the expression in the k-map
table.
3. Group the terms according to the k-map
rules.
4. Get the common value(s) for each group.
5. Put together the common values in an
expression. This is now the simplified one.
K-Map rules for simplification

1. No zeros allowed.
2. No diagonals.
3. Only power of 2 numbers of cells in each group.
(20 = 1, 21 = 2, 22 = 4, 23 = 8)
4. Groups should be as large as possible.
5. Every “one” must be in at least one group.
6. Overlapping allowed.
7. Wrap around allowed.
8. Fewest number of groups possible.
Groups may not include any cell containing a zero

Groups may be horizontal or vertical, but not diagonal


Groups must contain 1, 2, 4, 8, or in general
2n cells
Each group should be as large as possible.
Each cell containing a one must be in at
least one group
Groups may overlap.
Groups may wrap around the table
Few groups as possible
Two Variables K-Map

0 0 0
0
Two Variables K-Map
Example: Solve F = X’Y + XY’ + XY

0
Three Variables K-Map
• There are eight minterms for three binary
variables.
• Therefore, the map consists of eight squares.
Three Variables K-Map
Example 1: Simplify F(X,Y,Z) = Σ (2, 3, 4, 5)
Three Variables K-Map
Example 2: Simplify F(X,Y,Z) = Σ (0, 2, 4, 5, 6)
Three Variables K-Map
Example 3: Simplify F(A, B, C) = Σ (1, 2, 3, 5, 7)
Exercise
Simplify using K-Map method:
F(A,B,C) = SOP(0,1,3,4,5)
Four Variables K-Map
• There are sixteen minterms for four binary variables.
• Therefore, the map consists of sixteen squares.
Four Variables K-Map
Example: Simplify F(W,X,Y,Z) = Σ (0,1, 2, 4, 5, 6, 8, 9, 12, 13, 14)
Exercise
F(A,B,C,D) = SOP(3,4,5,6,7,11,12,13,14,15)
Don’t Care (X) Conditions in K-Map
Example-1:
Minimize the following function in SOP minimal
form using K-Map:
f(A,B,C,D) = m(1, 5, 6, 12, 13, 14) + d(4)
Don’t Care (X) Conditions in K-Map
Example-2:
Minimize the following function in SOP minimal
form using K-Map:
F(A, B, C, D) = m(1, 2, 6, 7, 8, 13, 14, 15) + d(3, 5, 12)
Class Activity
Simplify the following expression using K-Map:
F(A,B,C)=ABC’ + ABC + AB’C’ + AB’C + A’B’C + A’BC
Logic Gate
• physical device implementing a Boolean
function
• primarily implemented using diodes or
transistors acting as electronic switches
allowing the construction of a physical model
of all of Boolean logic
AND & OR Gates
NOT gate
NAND & NOR Gates
EXOR & EXNOR Gates
Logisim Tool
• Draw the following using the Logisim Tool
Exercise
Draw a circuit for the expression
(A’ OR B AND C ) AND D’

You might also like