0% found this document useful (0 votes)
0 views

Lecture 1(Engr. Irshad Hussain)

The document outlines the rules and expectations for a Computer Architecture and Logic Design course taught by Engr. Irshad Hussain, including mandatory attendance, preparation for quizzes, and assignment submission policies. It details the marks distribution for assessments and emphasizes the importance of understanding number systems and digital representation. Recommended readings and office hours for additional support are also provided.

Uploaded by

Hanif Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Lecture 1(Engr. Irshad Hussain)

The document outlines the rules and expectations for a Computer Architecture and Logic Design course taught by Engr. Irshad Hussain, including mandatory attendance, preparation for quizzes, and assignment submission policies. It details the marks distribution for assessments and emphasizes the importance of understanding number systems and digital representation. Recommended readings and office hours for additional support are also provided.

Uploaded by

Hanif Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
You are on page 1/ 98

Computer

Architecture and Logic


Design
Lecture: 01
Engr. Irshad Hussain
Department of Software Engineering,
UET ATD
General Rules
 All Classes are mandatory. Miss a class Miss a question
 Listen carefully and take notes appropriately. Do Not Write
everything
 Come prepared. Try to remain ahead of me.
 Quiz can happen any time. Be prepared
 Assignments to be submitted on or before the time given.
 Will not accept it afterwards. Assignments will only be checked for
completeness and not for correctness. Your job to find the right
answers.
 You can work in groups but no copying allowed.
 If I suspect copying in assignments, quizzes or exam papers I will
disqualify you.
 No mobile phones in my class or exams.
 Work on a daily basis and Attend the review sessions
 Review lectures and Ask questions
Marks Distribution
 Theory 100%
 First Midterm 25%
 Quizzes + Assignments 10%
 Project 15%
 Final 50%
 Stress will be on mid-terms and final exam.
 Never ask about pattern of the paper and
never try to guess it.
Recommended Reading
 Textbook:
Material
 Logic and Computer Design Fundamentals

by Morris Mano and Charles Kime


 3rd Edition
 Prentice Hall 2004
 Will largely follow book:
 May change order slightly
 Will encourage use of HDL
 Course outline can be obtained from
Academic Office
Office Hours
 There will be two ways to consult after class:
 You can come to my office during the following
times without any appointment
 Tuesday 1330 to 1500
 Thursday 1330 to 1500
 Outside these times you will have to arrange for
an appointment which you may or may not get.
 You are strongly encouraged to discuss your
problems with me during scheduled office
hours but I will strongly discourage any
discussion just before exams.
You might encounter this
You will see a lot of this
Which may be converted to this
/*
* A 32-bit counter with only 4 bits of output. The idea is
* to select which of the counter stages you want to pass on.
*
* Anselmo Lastra, November 2002
*/

module cntr_32c(clk,res,out);
input clk;
input res;
output [3:0] out;

reg [31:0] count;

always @ (posedge res or posedge clk)


if(res)
count <= 0;
else
count <= count + 1;
assign out[3] = count[28];
assign out[2] = count[27];
assign out[1] = count[26];
assign out[0] = count[25];

endmodule
How is it done
 Draw your schematics
 Write it down in Verilog HDL
 Simulate using a simulator like ModelSIM
 Use ModelSIM to create timing diagram
 See if your model works
Digital Systems and
Information
Overview
 Introduction to Digital Systems
 Digital Systems (examples and general remarks)
 Basic Digital System Structure (basic components and their function)
 Number Systems
 Positional Number Systems (decimal, binary, octal, and hexadecimal)
 Number Conversions (r-to-decimal, decimal-to-r, other conversions)
 Representations of Numbers in Digital Computers
 Integer Numbers (unsigned and signed representations)
 Real Numbers (floating-point representation)
 Arithmetic Operations
 General Remarks
 Unsigned, Signed, and Floating-Point Binary Operations
 Decimal Codes
 BCD code, Excess-3 code, Seven-Segment Code
 Alphanumeric Codes
 ASCII and Unicode
Digital vs. Analog
 Analog – infinite resolution
 Like (old fashioned) radio dial
 We’ll do very little with analog
 VGA, maybe sound
 Digital – a finite set of values
 Like money
 Can’t get smaller than cents
 Typically also has maximum value
Digital Systems: Example
 Modern Digital Computers
The best known example of a digital system
Most striking properties are: generality and flexibility
Basic Digital System Structure
CPU: Central Processing
Unit
Data Path: arithmetic and
logic operations
Control Unit: make sure
that the sequence of
data path operations is
correct
Storage: no memory = no
system
Input/Output: allow the
system to interact with
the outside world
Digital Systems: More Examples
Binary Signaling
 Zero volts
 FALSE or 0
 3.3 or 5 volts
 TRUE or 1
 Modern chips down to 1V

 Why not multilevel signaling?


Discrete Data
 Some data inherently discrete
 Names (sets of letters)
 Some quantized
 Music recorded from microphone
 Note that other examples like music from CD or
electronic keyboard already quantized
 Mouse movement is quantized
 Well, some mice
Digital Systems: General
Remarks
A Digital System manipulates discrete elements/quantities of
information
 Discrete quantities of information emerge from:
 the nature of the data being processed

 the data may be purposely quantized from continues values

 Early computer systems were used mostly for numeric


computations: the discrete elements used were the digits, hence
the term digital computer/system emerged.
 In general, any system uses an alphabet (set of symbols) to
represent information
 The English language system uses an alphabet of 26 symbols

(letters)
 The decimal number system uses an alphabet of 10 symbols

(digits)
 What about the alphabet of the Digital Systems?
The Digital Systems’ Alphabet is
Binary
Digital Systems use only one alphabet with two symbols (digits)
‘0’ and ‘1’ (hence binary ).
 A binary digit is called a bit
 Information is represented by groups of bits

 Why is a binary alphabet used?


 Digital systems have a basic building block called a switch, that

can only be “on” or “off”, i.e., two discrete values ‘0’ and ‘1’ can
be distinguished.
 An electronic device, called a transistor, physically implements

the switch.
 The two discrete values are physically represented by ranges of

voltage values called HIGH and LOW.


 “on” (closed) switch corresponds to bit value ‘0’ and is represented by
LOW voltage value (between 0.0 and 1.0 Volt).
 “off” (open) switch corresponds to bit value ‘1’ and is represented by
HIGH voltage value (between 4.0 and 5.0 Volts).
 More information will be given later in another lecture.
Homework
 None, but…
 I expect you to know number systems well and be
able to do conversions and arithmetic
 Decimal – Binary
 Binary – Decimal
 Decimal – Hex
 Hex – Decimal
 Can do some of the problems – 1-2, 1-4, 1-7 if you
think you need a refresher. Answers on book
website.
Reading
 Skim chapter 1
 Quick read to make sure you’re comfortable with
material
 Read Chapter 2
Information Representation
 All information in Digital Systems is represented in
binary form.
 All information that is not binary is converted to
binary before processed by a Digital Systems.
 Decimal numbers are expressed in the binary
number system or by means of a binary code.
 How is this done?
 That is not too difficult, once we understand how all number
systems, not only the decimal one (0-9), have a similar
formal representation and how a number in one number
system can be converted into another.
 Let us look into number systems and conversions.
Number Systems
Number Systems are employed in arithmetic to represent numbers
by strings of digits. There are two types of number systems:
 Positional number systems
 The meaning of each digit depends on its position in the number.

 Example:

 Decimal number system (we know it very well and use it in everyday
arithmetic).
 585.5 is a decimal number in positional code – “5 hundreds plus 8
tens plus 5 units plus 5 tenths”. The hundreds, tens, units, and tenths
are powers of 10 implied by the position of the digits.
 Decimal number system is said to be of base or radix 10 because it
uses10 distinct digits (0 – 9) and the digits are multiplied by power of
10:
585.5 = 5x102 + 8x101 + 5x100 + 5x10-1
 Non-positional number systems
 Old Roman numbers: for example, XIX equals to 19
Positional Number Systems
We can represent numbers in any number system with
base r
 Number in positional code

(An-1An-2…A1A0.A-1A-2…A-m+1A-m)r
 r is the base (radix) of the system, r Є {2, 3, …, I}.

every digit Ai Є {0, 1, 2, …, r-1}, where {0, 1, 2, …, r-1} is
the digit set.
 “.” is called the radix point.

An-1 is referred to as the most significant digit.

A-m is referred to as the least significant digit.
 Number in base r expressed as power series of r
 .
 Example: a number in number systems with base 5
 (132.4)5 = 1x52 + 3x51 + 2x50 + 4x5-1 = 25 + 15 + 2 + 0.8 =
(42.8)10
Binary Number System
This is the system used for arithmetic in all digital computers
 Number in positional code
 (b b …b b b b …b
n-1 n-2 1 0 -1 -2 -m+1b-m)r
 r = 2 is the base of the binary system.

 every digit b Є {0, 1}


i
 the digits b in a binary number are called bits
i
 b
n-1 is referred to as the most significant bit (MSB).
 b
-m is referred to as the least significant bit (LSB).
 Number in base 2 expressed as power series of 2
 b
n-1 2 + bn-2 2 n-2 +…+ b1 2 1 + b0 2 0 + b-1 2 -1 + b-2 2 -2 +…
n-1

+ b-m+1 2 –m+1+ b-m 2 -m


 Example: a number in the binary number system
 (1011.01) = 1x23 + 0x22 + 1x21 + 1x20 + 0x2-1 + 1x2-2
2

= 8 + 2 + 1 + 0.25 =(11.25)10
Burn this table into your memory
POWER OF TWO TABLE
Other Useful Number System
Apart from the ordinary binary number system, the octal (base-8) and the
hexadecimal (base-16) number systems are useful for representing
binary quantities indirectly because their bases are powers of two.
These systems have a more compact representation of binary
quantities.
 Octal number system

(on-1on-2…o1o0.o-1o-2…o-m+1o-m)8

every digit oi Є {0, 1, 2, 3, 4, 5, 6, 7}.

on-18 n-1 + on-28 n-2 +…+ o18 1 + o08 0 + o-18 -1 + o-28 -2 +…+ o-m+18 –m+1 +o-m8 –m

(127.4)8 = 1x82 + 2x81 + 7x80 + 4x8-1 = (87.5)10 = (001 010 111.100)2
 Hexadecimal number system

(hn-1hn-2…h1h0.h-1h-2…h-m+1h-m)16

every digit hi Є {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}.

hn-116 n-1 + hn-216 n-2 +…+ h116 1 + h016 0 + h-116 -1 + h-216 -2 +…+ h-m+116 –m+1+ h-
m16
–m


(B6F.4)16 = 11x162 + 6x161 + 15x160 + 4x16-1 = (2927.25)10
= (1011 01101111.0100)2
Hexadecimal
 Strings of 0s and 1s too hard to write
 Use base-16 or hexadecimal – 4 bits
Dec Bin Hex Dec Bin Hex
0 0000 0 8 1000 8
1 0001 1 9 1001 9
2 0010 2 10 1010 ?
3 0011 3 11 1011 ?
4 0100 4 12 1100 ?
5 0101 5 13 1101 ?
6 0110 6 14 1110 ?
7 0111 7 15 1111 ?
Hexadecimal
 Letters to represent 10-15

Dec Bin Hex Dec Bin Hex


0 0000 0 8 1000 8
1 0001 1 9 1001 9
2 0010 2 10 1010 a
3 0011 3 11 1011 b Why use
4 0100 4 12 1100 c base 16?
5 0101 5 13 1101 d
• Power of 2
6 0110 6 14 1110 e
7 0111 7 15 1111 f • Size of byte
Another Important Table
Numbers with different bases
Conversion from base r to

Decimal
The conversion of a number in base r to decimal number (base 10) is
done by expanding the number in power series and adding all the
terms as shown below:

(An-1An-2…A1A0.A-1A-2…A-m+1A-m)r =
An-1 r n-1 + An-2 r n-2 +…+ A1 r 1 + A0 r 0 + A-1 r -1 + A-2 r -2 +…+ A-m+1 r –m+1 + A-m r –m

 Example of converting Binary (base 2) to Decimal (base 10):


(1011.01)2 = 1x23 + 0x22 + 1x21 + 1x20 + 0x2-1 + 1x2-2 = 8 + 2 + 1 + 0.25 = (11.25)10
 Example of converting number in base 5 to Decimal (base 10):
(132.4)5 = 1x52 + 3x51 + 2x50 + 4x5-1 = 25 + 15 + 2 + 0.8 = (42.8)10
 Example of converting Octal (base 8) to Decimal (base 10):
(127.4)8 = 1x82 + 2x81 + 7x80 + 4x8-1 = (87.5)10
 Example of converting Hexadecimal (base 16) to Decimal (base 10):
(B6F.4)16 = 11x162 + 6x161 + 15x160 + 4x16-1 = (2927.25)10
Converting Binary to Decimal
 Easy, just multiply digit by power of 2
 Just like a decimal number is represented
 Example follows
Binary  Decimal Example

7 6 5 4 3 2 1 0

27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

What is 10011100 in decimal?

1 0 0 1 1 1 0 0

128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156
Decimal to Binary
 A little more work than binary to decimal
 Some examples
 3 = 2 + 1 = 11 (that’s 1•21 + 1•20)
 5 = 4 + 1 = 101 (that’s 1•22 + 0•21 + 1•20)
Algorithm – Decimal to Binary
 Find largest power-of-two smaller than
decimal number
 Make the appropriate binary digit a ‘1’
 Subtract the power of 2 from decimal
 Do the same thing again
Decimal  Binary Example
 Convert 28 decimal to binary
32 is too large, so use 16
Binary  10000 Decimal  28 – 16 = 12
Next is 8
Binary  11000 Decimal  12 – 8 = 4
Next is 4
Binary  11100 Decimal  4 – 4 = 0
7 6 5 4 3 2 1 0
27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1
Conversion from Decimal to base
rIf the number has a radix point then separate the number into an integer
The conversion is done as follows:
1.
part and a fraction part, since the two parts must be converted differently.
2. The conversion of a decimal integer part to a number in base r is done by
dividing the integer part and all successive quotients by r and
accumulating the remainders.
3. The conversion of a decimal fraction part to a number in base r is done by
multiplying the fractional parts by r and accumulating integers.

Example of converting Decimal (base 10) to Binary (base 2): (41.6875)10


Other Conversions
 Binary to Octal or Hexadecimal: grouping bits starting from the
radix point
 (1101010.01)2 to Octal (groups of 3): (001|101|010.010|)2 = (152.2)8
 (1101010.01)2 to Hex (groups of 4): (0110|1010.0100|)2 = (6A.4)16
 Octal to Binary: convert each digit to binary using 3 bits
 (475.2)8 = (100 111 101. 010)2
 Hexadecimal to Binary: convert each digit to binary using 4 bits
 (7A5F.C)16 = (0111 1010 0101 1111. 1100)2 = (111101001011111.11)2
 Hexadecimal to Octal
 Hexadecimal → Binary → Octal

 Octal to Hexadecimal
 Octal → Binary → Hexadecimal
Bin Hex
Hex to Binary 0000 0
0001 1
 Convention – write 0x before number
0010 2
 Hex to Binary – just convert digits 0011 3
0100 4

0x2ac 0101 5
0110 6
0111 7
1000 8
0010 1010 1100
1001 9
0x2ac = 001010101100 1010 a
1011 b
1100 c
No magic – remember hex digit = 4 bits 1101 d
1110 e
1111 f
Bin Hex
Binary to Hex 0000 0
0001 1
0010 2
0011 3
 Just convert groups of 4 bits 0100 4

101001101111011 0101 5
0110 6

0101  0011  0111  1011 0111


1000
7
8
1001 9
1010 a
5 3 7 b 1011 b
1100 c
1101 d
101001101111011 = 0x537b 1110 e
1111 f
Dec Hex
Hex to Decimal 0 0
1 1
 Just multiply each hex digit by decimal
2 2
value, and add the results.
3 3
0x2ac 4 4
5 5
6 6
2 • 256 + 10 • 16 + 12 • 1 = 684 7 7
8 8

    9 9


10 a
163 162 161 160
11 b
4096 256 16 1 12 c
13 d
14 e
15 f
Decimal to Hex
Analogous to decimal  binary.
1. Find largest power-of-16 smaller than
decimal number
2. Divide by power-of-16. The integer result
is hex digit.
3. The remainder is new decimal number.
4. Do the same thing again
Dec Hex
Decimal to Hex 0 0
1 1
684 2 2

684/256 = 2 0x2__ 3
4
3
4

684%256 = 172 5
6
5
6
172/16 = 10 = a 0x2a_ 7 7
8 8
172%16 = 12 = c 0x2ac 9 9
10 a
   
11 b
163 162 161 160 12 c
4096 256 16 1 13 d
14 e
15 f
Number Ranges
 The range of numbers in base (radix) r depends on the number of digits
used to represent the numbers.
 Assume the number (An-1An-2…A1A0.A-1A-2…A-m+1A-m)r represented by n
digits for the integer part and m digits for the fraction part.
 The smallest integer number is 0 and the largest is (r-1) r n-1 + (r-1) r n-2 +…
+ (r-1)r 1 + (r-1) r 0 = rn-1 ,i.e., the range is from 0 to rn-1
 The smallest fraction number is 0.0 and the largest is (r-1) r -1 + (r-1) r -2 +
…+ (r-1) r –m+1 + (r-1) r –m=1- r –m, i.e., the range is from 0.0 to 1- r –m
 The range of numbers is from 0.0 to rn - r –m
 Examples:
 Largest 3-digit integer decimal (base 10) number is 10 3-1 = 1000 - 1 = 999

Largest 8-digit integer binary (base 2) number is (11111111) 2 ,i.e., 28-1 = 255
 Largest 5-digit decimal (base 10) fraction is 1-10-5 = 1 – 0.00001 = 0.99999
 Largest 16-digit binary (base 2) fraction is 1-2-16 = 0.9999847412

 What about the range of negative numbers?


Representations of Numbers in
Digital Computers (1)
Representations of Numbers in
Digital Computers (2)
Representations of Numbers in
Digital Computers (3)
Representations of Numbers in
Digital Computers (4)
Arithmetic Operations
Unsigned Binary Subtraction
Signed Binary
Addition/Subtraction
Arithmetic -- addition
 Binary similar to decimal arithmetic

No carries 1 0 1 1 0 0 Carries

0 1 1 0 0 1 0 1 1 0
+ 1 0 0 0 1 + 1 0 1 1 1

1 1 1 0 1 1 0 1 1 0 1

1+1 is 2 (or 102), which results in a carry


Arithmetic -- subtraction

No borrows 0 0 1 1 0 Borrows

1 0 1 1 0 1 1 1 1 0
- 1 0 0 1 0 - 1 0 0 1 1

0 0 1 0 0 0 1 0 1 1

0 - 1 results in a borrow
Arithmetic -- multiplication

1 0 1 1 Successive additions of
X 1 0 1 multiplicand or zero,
multiplied by 2 (102).
1 0 1 1
0 0 0 0
Note that multiplication
by 102 just shifts bits
1 0 1 1
left.
1 1 0 1 1 1
Binary Floating-point Operations
Decimal Codes
 The binary number system is the most natural
system for a digital computer, but people are
accustomed to the decimal system.
 How to resolve this difference?
 Convert decimal numbers to binary, perform all arithmetic
calculations in binary, and then convert the binary result
back to decimal.
 You already know how to do this.
 Digital computers can do this as well, but:
 We have to store the decimal numbers in the computer in a
way that they can be converted to binary.
 Since the computer can accept only binary values, we must
represent the decimal digits by a code that contains 1’s and
0’s.
BCD
 Binary Coded Decimal
 Decimal digits stored in binary
 Four bits/digit
 Like hex, except stops at 9
 Example
931 is coded as 1001 0011 0001
 Remember: these are just encodings. Meanings are
assigned by us.
Binary Coded Decimals (BCD) - 1
 The BCD code is the most commonly used code.
Each decimal digit (0, 1, 2, …, 9) is coded by a4-bit
string (half a byte) called BCD digit.
 A decimal number is converted to a BCD number by
replacing each decimal digit of the number with the
corresponding BCD digit code.
 Example:

 A BCD number needs more bits than its equivalent


binary value. However, the advantages of using BCD
are:
 Computer input and output data are handled by people
who use the decimal system.
 BCD numbers are decimal numbers (not binary
numbers) even though they are represented in bits.
 Computers can store decimal numbers using BCD,
convert the BCD numbers to binary, perform binary
operations, and convert the result back to BCD.
Binary Coded Decimals (BCD) - 2
Other Useful Decimal
Codes:Excess-3 Code
Other Useful Decimal Codes:
Seven-Segment Code
Other Codes Exist
 Non positional
 Example: Gray Code
 Only one bit changes at a time
 000,001,011,010,110,111,101,100
 Why is this useful?

 Actually there’s a family of Gray codes

Ref: http://lib-www.lanl.gov/numerical/bookcpdf/c20-2.pdf
Shaft Encoder
Character Codes
 From numbers to letters
 ASCII
 Stands for American Standard Code for
Information Interchange
 Only 7 bits defined
 Unicode
 You may make up your own code for the
MIPS VGA
Even Parity
 Sometimes high-order bit of ASCII coded to
enable detection of errors
 Even parity – set bit to make number of 1’s
even
 Examples
A (01000001) with even parity is 01000001
C (01000011) with even parity is 11000011
Odd Parity
 Similar except make the number of 1’s odd
 Examples
A (01000001) with odd parity is 11000001
C (01000011) with odd parity is 01000011
Error Detection
 Note that parity detects only simple errors
 One, three, etc. bits
 More complex methods exist
 Some that enable recovery of original info
 Cost is more redundant bits
Alphanumeric Codes
 Many applications of digital computers require the handling of
data consisting not only of numbers, but also of letters.
 Alphanumeric character set of English includes:

 The 10 decimal digits


 The 26 letters of the alphabet (uppercase and lowercase letters)
 Several (more than three) special characters
 We need to code these symbols
 The code must be binary – computers can handle only 0’s and 1’s
 We need binary code of at least seven bits (27 = 128 symbols)
 American Standard Code for Information Interchange (ASCII)
 ASCII is a 7-bit standard code for representing the symbols of the
English language.
 Unicode
 A 16-bit standard code for representing the symbols and ideographs
for the world’s languages.
ASCII Code
Table
Can we also talk digitally?
Can we also see digitally?
Combinational Logic
Circuits Part I -
Theoretical Foundations
Overview
 Boolean Algebra
 Basic Logic Operations
 Basic Identities
 Basic Principles, Properties, and Theorems
 Boolean Function and Representations
 Truth Table
 Canonical and Standard Forms
 Minterms and Maxterms
 Canonical Sum-Of-Products and Product-Of-Sums forms
 Standard Sum-Of-Products and Product-Of-Sums forms
 Conversions
 Karnaugh Maps (K-Maps)
 2, 3, 4, and 5 variable K-maps
 Complement of a Boolean function
Combinational Logic Circuits
 Digital Systems are made out of digital
circuits.
 Digital circuits are hardware components that
manipulate binary information.
 Certain well defined basic (small) digital
circuits are called Logic Gates.
 Gates have inputs and outputs and perform
specific mathematical logic operations.
 Outputs of gates are connected to inputs of
other gates to form a digital combinational
logic circuit.
Boolean Algebra
 In order to analyze and design digital combinational
logic circuits we need a mathematical system.
 Binary logic system called Boolean Algebra is used.
 George Boole (1815-1864): “An investigation of the
laws of thought” – a book published in 1854
introducing the mathematical theory of logic.
 Boolean Algebra deals with binary variables that
take 2 discrete values (0 and 1), and with logic
operations.
 Binary/logic variables are typically represented as
letters: A,B,C,…,X,Y,Z or a,b,c,…,x,y,z.
 Three basic logic operations:
 AND, OR, NOT (complementation).
Basic Logic Operations
 AND operation is represented by operators “•” or “^” or by the absence of an
operator.
 Z = X•Y or Z = X^Y, or Z = XY is read “Z is equal to X AND Y” meaning that:
 Z = 1 if and only if X = 1 and Y = 1; otherwise Z = 0.
 AND resembles binary multiplication:
X

 OR operation is represented by operators “+” or “V”.


 Z = X+Y or Z = X V Y is read “Z is equal to X OR Y” meaning that:
 Z = 1 if X = 1 or Y = 1, or if both X = 1 and Y = 1.
Z = 0 if and only if X = 0 and Y = 0.
 OR resembles binary addition, except in one case:

 NOT operation is represented by operator “ ’ ” or by a bar over a variable.


 Z = X’ or Z = is read “Z is equal to NOT X” meaning that:
 X
Z = 1 if X = 0; but Z = 0 if X = 1
 NOT operation is also referred to as complement operation.
Basic Logic Operations
Basic Identities of Boolean
Algebra
Boolean Algebra Properties
The Duality Principle
 The dual of an expression is obtained by
exchanging (• and +), and (1 and 0) in it, provided
that the precedence of operations is not changed.
 Cannot exchange x with x’.
 Example:
 Find the dual of expression: x’yz’ + x’y’z
 Answer: (x’ + y + z ’) • (x ’ + y’ + z)
 Dual expression does not always equal the original
expression.
 If a Boolean equation/equality is valid, its dual is
also valid.
The Duality Principle (cont.)
Absorption Property (Covering)
 X + X•Y = X -- (absorption property)
 X•(X+Y) = X -- (dual absorption property)
 Proof:
X + X•Y = X•1 + X•Y
= X • (1 + Y)
=X•1
=X
 Can you prove the dual absorption property?
Consensus Theorem
Boolean Function
Boolean Function
Representations
 Truth Table (unique representation)

 Boolean Equation
 Canonical Sum-Of-Products (CSOP) form (unique)
 Canonical Product-Of-Sums (CPOS) form (unique)
 Standard Forms (NOT unique representations)
 Maps (unique representation)

 We can convert one representation of a Boolean


function into another in a systematic way.
 Why do we need all this representations?
Truth Table
 Definition: tabular form that uniquely
represents the relationship between
the input variables of a Boolean
function and its output.
 Enumerates all possible
combinations of 1’s and 0’s that can
be assigned to the binary variables
and shows the binary value of the
function for each possible binary
combination.
 Truth table for an arbitrary Boolean
function of three variables is shown
to the right.
Truth Table (cont.)
 Assume a Boolean function F(x1,x2,…,xN-1,xN) that
depends on N variables.
 Question1: How many columns are there in the
truth table of F(x1,x2,…,xN-1,xN) ?
 Question2: How many rows are there in the truth
table of F(x1,x2,…,xN-1,xN) ?
 Answer Q1: columns = N + 1, since a column is
needed for each variable and one column is needed
for the values of the function.
 Answer Q2: rows = 2N, since there are 2N possible
binary patterns/combinations for the N variables.
Truth Table (cont.)
Canonical and Standard Forms
 The Canonical and Standard forms of a Boolean
functions are Boolean equation representations. To
introduce them we need the following definitions:
 Literal: A variable or its complement.
 Product term: literals connected by “•”.
 Sum term: literals connected by “+”.
 Minterm: a product term in which all the variables
appear exactly once, either complemented or
uncomplemented.
 Maxterm: a sum term in which all the variables
appear exactly once, either complemented or
uncomplemented.
Minterm: Characteristic Property
 A minterm of N variables defines a Boolean function
that represents exactly one combination (bj) of the
binary variables in the truth table.
 The function has value 1 for that combination and
value 0 for all others.
 There are 2N distinct minterms for N variables.
 A minterm is denoted by mj, where j is the decimal
equivalent of the minterm’s corresponding binary
combination (bj).
 A variable in mj is complemented if its value in bj is
0, otherwise is uncomplemented.
Minterms for Three Variables
 For three variables X, Y, and Z there are 23 minterms (products of 3
literals):
Maxterm: Characteristic
Property
 A maxterm of N variables defines a Boolean function

that represents exactly one combination (bj) of the


binary variables in the truth table.
 The function has value 0 for that combination and
value 1 for all others.
 There are 2N distinct maxterms for N variables.
 A maxterm is denoted by Mj, where j is the decimal
equivalent of the maxterm’s corresponding binary
combination (bj).
 A variable in Mj is complemented if its value in bj is1,
otherwise is uncomplemented.
Maxterms for Three Variables
 For three variables X, Y, and Z there are 23 maxterms (sums of 3
literals):
Canonical Forms (Unique)
 Any Boolean function F( ) can be expressed as a
unique sum of minterms and a unique product of
maxterms (under a fixed variable ordering).
 In other words, every function F() has two canonical
forms:
 Canonical Sum-Of-Products (CSOP) (sum of minterms)
 Canonical Product-Of-Sums (CPOS) (product of maxterms)
 You must realize that the words product and sum do
not imply arithmetic operations in Boolean algebra;
instead they specify the logical operations AND and
OR, respectively.
Canonical Sum-Of-Products
 It is a sum of minterms.
 The minterms included are those
mj such that F( ) = 1 in row j of the
truth table for F( ).
 Example:
 Truth table for F(X,Y,Z) at right.
 The canonical sum-of-products form

for F is:
F(X,Y,Z) = m1 + m2 + m4 + m6
= X’Y’Z + X’YZ’ + XY’Z’ + XYZ’.
Canonical Product-Of-Sums
 It is a product of maxterms.
 The maxterms included are
those Mj such that F( ) = 0 in
row j of the truth table for F( ).
 Example:
 Truth table for F(X,Y,Z) at right .
 The canonical product-of-sums

form for F is:


F(X,Y,Z) = m0 + m3 + m5 + m7
= (X+Y+Z) • (X+Y’+Z’) • (X’+Y+Z’)
• (X’+Y’+Z’)
Canonical Product-Of-Sums

You might also like