chapter 1 : introduction lecturer : wan nur suryani firuz bt wan ariffin h/p : 012 – 4820815...

136
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Upload: jean-stafford

Post on 18-Jan-2016

224 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

EKT 121 / 4ELEKTRONIK DIGIT 1

CHAPTER 1 : INTRODUCTION

Lecturer : Wan Nur Suryani Firuz bt Wan AriffinH/P : 012 – 4820815Office : KKF 8C (04-9854089)PLV : Nazatul Shima Saad

Page 2: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

1.0 NUMBER & CODES

Digital vs. analog quantities Decimal numbering system (Base 10) Binary numbering system (Base 2) Hexadecimal numbering system (Base 16) Octal numbering system (Base 8) Number conversion Binary arithmetic 1’s and 2’s complements of binary

numbers

Page 3: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER & CODES

Signed numbers Arithmetic operations with signed

numbers Binary-Coded-Decimal (BCD) ASCII codes Gray codes Digital codes & parity

Page 4: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL VS. ANALOGUE Digital signals are represented by only two possible - 1 (binary 1) 0r 0 (binary 0)

Sometimes call these values “high” and “low” or “ true” and “false””

Example : light switch , it can be in just two position – “ on ” or “ off ”

More complicated signals can be constructed from 1s and 0s by stringing them end-to end. Example : 3 binary digits, have 8 possible combinations : 000,001,010,011,100,101,110 and 111.

The diagram : example a typical digital signal, represented as a series of voltage levels that change as time goes on.

Page 5: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL VS. ANALOGUE Analogue electronics can be any value within limits. Example : Voltage change simultaneously from one value to the next,

like gradually turning a light dimmer switch up or down.

The diagram below shows an analoq signal that changes with time.

Page 6: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL VS. ANALOGUE Why digital ? Problem with all signals – noise Noise isn't just something that you can hear - the fuzz that

appears on old video recordings also qualifies as noise. In general, noise is any unwanted change to a signal that tends to corrupt it.

Digital and analogue signals with added noise:

Analog : never get back a perfect copy of the original signal

Digital : easily be recognized even among all that noise : either 0 or 1

Page 7: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL AND ANALOG QUANTITIES

Two ways of representing the numerical values of quantities : i) Analog (continuous) ii) Digital (discrete)

Analog : a quantity represented by voltage, current or meter movement that is proportional to the value that quantity

Digital : the quantities are represented not by proportional quantities but by symbols called digits

Page 8: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL AND ANALOG SYSTEMS

Digital system: combination of devices designed to manipulate logical

information or physical quantities that are represented in digital forms

Example : digital computers and calculators, digital audio/video equipments, telephone system.

Analog system: contains devices manipulate physical quantities that

are represented in analog form Example : audio amplifiers, magnetic tape recording

and playback equipment, and simple light dimmer switch

Page 9: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

ANALOG QUANTITIES

• Continuous values

Page 10: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL WAVEFORM

Page 11: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

INTRODUCTION TO NUMBERING SYSTEMS

We are all familiar with decimal number systems - use everyday :calculator, calendar, phone or any common devices use this numbering system :

Decimal = Base 10 Some other number systems:

Binary = Base 2 Octal = Base 8 Hexadecimal = Base 16

Page 12: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBERING SYSTEMS

0 ~ 9

0 ~ 1

0 ~ 7

0 ~ F

Decimal

Binary

Octal

Hexadecimal

Page 13: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

00000000000000010000001000000011000001000000010100000110000001110000100000001001000010100000101100001100000011010000111000001111

000001002003004005006007010011012013014015016017

0123456789ABCDEF

0123456789

101112131415

BinaryOctalHexDecNUMBER SYSTEMS

Page 14: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIGNIFICANT DIGITS

Binary: 11101101

Most significant digit Least significant digit

Hexadecimal: 1D63A7A

Most significant digit Least significant digit

Page 15: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DECIMAL NUMBERING SYSTEM (BASE 10)

Base 10 - (0,1,2,3,4,5,6,7,8,9) Example : 39710

3 9 7

3 X 102 9 X 101 7 X 100 +

+

=

300 + 90 + 7 =

39710

Weights for whole numbers are

positive power of ten that increase from right to left , beginning with 100

Page 16: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY NUMBER SYSTEM

Base 2 system – (0 , 1) used to model the series of electrical signals

computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on

state Example : 1012

1 0 1

1 X 20 0 X 21 1X 22

Weights in a binary number are based on power of two, that increase from right to right to left,beginning with 20 +

+ =

4 + 0 + 1 =

510

Page 17: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

OCTAL NUMBER SYSTEMBase 8 system – (0,1,2,3,4,5,6,7) multiplication and division algorithms for conversion to and

from base 10 Example : 7568 convert to decimal:

7 5 6

6 X 80 5 X 81 7X 82

Weights in a binary number are based on power of eight that increase from right to right to left,beginning with 80 +

+ =

448 + 40 + 6

=

49410 Readily converts to binary Groups of three (binary) digits can be used to represent each octal numberExample : 7568 convert to binary :

7 5 68

1111011102

Page 18: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

HEXADECIMAL NUMBER SYSTEM

Base 16 system Uses digits 0 ~ 9 & letters A,B,C,D,E,F

Groups of four bitsrepresent eachbase 16 digit

HEXADECIMAL DECIMAL BINARY

0 0 0000

1 1 0001

2 2 0010

3 3 0011

4 4 0100

5 5 0101

6 6 0110

7 7 0111

8 8 1000

9 9 1001

A 10 1010

B 11 1011

C 12 1100

D 13 1101

E 14 1110

F 15 1111

Page 19: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

HEXADECIMAL NUMBER SYSTEMBase 16 system – multiplication and division algorithms for conversion to and

from base 10 Example : A9F16 convert to decimal:

A 9 F

15 X 160 9 X 161 10X 162

Weights in a hexadecimal number are based on power of sixteen that increase from right to right to left,beginning with 160 +

+ =

2560 + 144 + 15

=

271910 Readily converts to binary Groups of four (binary) digits can be used to represent each hexadecimal numberExample : A9F8 convert to binary :

A 9 F16

1010100111112

Page 20: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION

Any Radix (base) to Decimal Conversion

Page 21: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION (BASE 2 –BASE 10)

Binary to Decimal Conversion

Page 22: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY TO DECIMAL CONVERSION

Convert (10101101)2 to its decimal equivalent:

Binary 1 0 1 0 1 1 0 1

Positional Valuesxxxxxxxx2021222324252627

128 + 32 + 8 + 4 + 1Products

17310

Page 23: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

OCTAL TO DECIMAL CONVERSION

Convert 6538 to its decimal equivalent:

6 5 3xxx

82 81 80

384 + 40 + 3

42710

Positional Values

Products

Octal Digits

Page 24: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

HEXADECIMAL TO DECIMAL CONVERSION

Convert 3B4F16 to its decimal equivalent:

Hex Digits 3 B 4 Fxxx

163 162 161 160

12288 +2816 + 64 +15

15,18310

Positional Values

Products

x

Page 25: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION Decimal to Any Radix (Base)

Conversion1. INTEGER DIGIT:

Repeated division by the radix & record the remainder

2. FRACTIONAL DECIMAL:Multiply the number by the radix until the answer is in integer

Example:25.3125 to Binary

Page 26: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DECIMAL TO BINARY CONVERSION

2 5 = 12 + 1 2

1 2 = 6 + 0 2

6 = 3 + 0 2

3 = 1 + 1 2

1 = 0 + 1 2 MSB LSB 2510 = 1 1 0 0 1 2

Remainder

Page 27: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DECIMAL TO BINARY CONVERSION

Carry . 0 1 0 10.3125 x 2 = 0.625 0 0.625 x 2 = 1.25 1

0.25 x 2 = 0.50 0

0.5 x 2 = 1.00 1

The Answer: 1 1 0 0 1.0 1 0 1

MSB LSB

Page 28: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DECIMAL TO OCTAL CONVERSION

Convert 42710 to its octal equivalent:

427 / 8 = 53 R3 Divide by 8; R is LSD53 / 8 = 6 R5 Divide Q by 8; R is next digit6 / 8 = 0 R6 Repeat until Q = 0

6538

Page 29: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DECIMAL TO HEXADECIMAL CONVERSION

Convert 83010 to its hexadecimal equivalent:

830 / 16 = 51 R1451 / 16 = 3 R33 / 16 = 0 R3

33E16

= E in Hex

Page 30: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION

Binary to Octal Conversion (vice versa)

1. Grouping the binary position in groups of three starting at the least significant position.

Page 31: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

OCTAL TO BINARY CONVERSION

Each octal number converts to 3 binary digits

To convert 6538 to binary, just substitute code:

6 5 3

110 101 011

Page 32: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION

Example: Convert the following binary numbers to

their octal equivalent (vice versa).a) 1001.11112 b) 47.38

c) 1010011.110112

Answer:a) 11.748

b) 100111.0112

c) 123.668

Page 33: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION

Binary to Hexadecimal Conversion (vice versa)

1. Grouping the binary position in 4-bit groups, starting from the least significant position.

Page 34: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY TO HEXADECIMAL CONVERSION

The easiest method for converting binary to hexadecimal is to use a substitution code

Each hex number converts to 4 binary digits

Page 35: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NUMBER CONVERSION

Example: Convert the following binary numbers

to their hexadecimal equivalent (vice versa).a) 10000.12

b) 1F.C16

Answer:

a) 10.816

b) 00011111.11002

Page 36: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SUBSTITUTION CODE

Convert 0101011010101110011010102 to hex

using the 4-bit substitution code :

0101 0110 1010 1110 0110 1010

5 6 A E 6 A

56AE6A16

Page 37: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SUBSTITUTION CODE

Substitution code can also be used to convert binary to octal by using 3-bit groupings:

010 101 101 010 111 001 101 010

2 5 5 2 7 1 5 2

255271528

Page 38: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY ADDITION

0 + 0 = 0 Sum of 0 with a carry of 0

0 + 1 = 1 Sum of 1 with a carry of 0

1 + 0 = 1 Sum of 1 with a carry of 0

1 + 1 = 10 Sum of 0 with a carry of 1

Example:

11001 111

+ 1101 + 11

100110 ???

Page 39: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIMPLE ARITHMETIC

Addition Example:

100011002

+ 1011102

101110102

Substraction Example:

10001002

- 1011102

101102

Example:

5816

+ 2416

7C16

Page 40: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY SUBTRACTION

0 - 0 = 0

1 - 1 = 0

1 - 0 = 1

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

Example:

1011 101

- 111 - 11

100 ???

Page 41: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY MULTIPLICATION

0 X 0 = 0

0 X 1 = 0 Example:

1 X 0 = 0100110

1 X 1 = 1 X 101

100110

000000

+ 100110

10111110

Page 42: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BINARY DIVISION

Use the same procedure as decimal division

Page 43: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

1’S COMPLEMENTS OF BINARY NUMBERS

Changing all the 1s to 0s and all the 0s to 1s

Example: 1 1 0 1 0 0 1 0 1

Binary number

0 0 1 0 1 1 0 1 0 1’s complement

Page 44: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

2’S COMPLEMENTS OF BINARY NUMBERS

2’s complement Step 1: Find 1’s complement of the

numberBinary # 110001101’s complement

00111001 Step 2: Add 1 to the 1’s complement

00111001 + 00000001

00111010

Page 45: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIGNED MAGNITUDE NUMBERS

Sign bit

0 = positive

1 = negative

31 bits for magnitude

This is your basic

Integer format

110010.. …00101110010101

Page 46: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIGN NUMBERS Left most is the sign bit

0 is for positive, and 1 is for negative

Sign-magnitude 0 0 0 1 1 0 0 1 = +25sign bit magnitude bits

1’s complement The negative number is the 1’s

complement of the corresponding positive number

Example: +25 is 00011001 -25 is

11100110

Page 47: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIGN NUMBERS 2’s complement

The positive number – same as sign magnitude and 1’s complement

The negative number is the 2’s complement of the corresponding positive number.

Example Express +19 and -19 ini. sign magnitudeii. 1’s complementiii. 2’s complement

Page 48: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL CODES BCD (Binary Coded Decimal) Code

1. Represent each of the 10 decimal digits (0~9) as a 4-bit binary code.

Example: Convert 15 to BCD.

1 5

0001 0101BCD Convert 10 to binary and BCD.

Page 49: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL CODES ASCII (American Standard Code for

Information Interchange) Code1. Used to translate from the

keyboard characters to computer language

Can convert from ASCII code to binary / hexadecimal/ or any numbering systems and vice versa

How to convert ?????

Page 50: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DIGITAL CODES

The Gray Code Only 1 bit changes Can’t be used in

arithmetic circuits Can convert from

Binary to Gray Code and vice versa.

How to convert ?????

Decimal Binary Gray Code

0 0000 0000

1 0001 0001

2 0010 0011

3 0011 0010

4 0100 0110

5 0101 0111

6 0110 0101

Page 51: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

3.0 LOGIC GATES

• Inverter (Gate Not)• AND Gate• OR Gate• NAND Gate• NOR Gate• Exclusive-OR and Exclusive-NOR• Fixed-function logic: IC Gates

Page 52: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Introduction

Three basic logic gates AND Gate – expressed by “ . “ OR Gates – expressed by “ + “ sign

(not an ordinary addition) NOT Gate – expressed by “ ‘ “ or

“¯”

Page 53: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NOT Gate (Inverter)

a) Gate Symbol & Boolean Equation

b) Truth Table (Jadual Kebenaran) c) Timing Diagram (Rajah Pemasaan)

Page 54: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

OR Gate

a) Gate Symbol & Boolean Equation

b) Truth Table (Jadual Kebenaran) c) Timing Diagram (Rajah Pemasaan)

Page 55: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

AND Gate

a) Gate Symbol & Boolean Equation

b) Truth Table (Jadual Kebenaran) c) Timing Diagram (Rajah Pemasaan)

Page 56: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NAND Gate

a) Gate Symbol, Boolean Equation

& Truth Table

b) Timing Diagram

Page 57: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

NOR Gate

a) Gate Symbol, Boolean Equation

& Truth Table

b) Timing Diagram

Page 58: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Exclusive-OR Gate

BABABA

a) Gate Symbol, Boolean Equation

& Truth Table

b) Timing Diagram

Page 59: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Examples : Logic Gates IC

NOT gate AND gate

Note : x is referring to family/technology (eg : AS/ALS/HCT/AC etc.)

Page 60: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

4.0 BOOLEAN ALGEBRA

Boolean Operations & expression Laws & rules of Boolean algebra DeMorgan’s Theorems Boolean analysis of logic circuits Simplification using Boolean Algebra Standard forms of Boolean Expressions Boolean Expressions & truth tables The Karnaugh Map

Page 61: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Karnaugh Map SOP minimization Karnaugh Map POS minimization 5 Variable K-Map Programmable Logic

Page 62: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

• BOOLEAN OPERATIONS & EXPRESSION

Expression : Variable – a symbol used to represent logical

quantities (1 or 0) ex : A, B,..used as variable Complement – inverse of variable and is

indicated by bar over variable ex : Ā

Page 63: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Operation : Boolean Addition – equivalent to the OR

operation X = A + B

Boolean Multiplication – equivalent to the AND operation

X = A∙B

A

BX

A

BX

Page 64: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

LAWS & RULES OF BOOLEAN ALGEBRA

Page 65: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Commutative law of addition

Commutative law of addition,

A+B = B+A

the order of ORing does not matter.

Page 66: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

COMMUTATIVE LAW OF MULTIPLICATION

Commutative law of Multiplication

AB = BAthe order of ANDing does not

matter.

Page 67: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

ASSOCIATIVE LAW OF ADDITION

Associative law of additionA + (B + C) = (A + B) + C

The grouping of ORed variables does not matter

Page 68: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

ASSOCIATIVE LAW OF MULTIPLICATION

Associative law of multiplicationA(BC) = (AB)C

The grouping of ANDed variables does not matter

Page 69: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DISTRIBUTIVE LAW

A(B + C) = AB + AC

(A+B)(C+D) = AC + AD + BC + BD

Page 70: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

1) A + 0 = A

In math if you add 0 you have changed nothing

In Boolean Algebra ORing with 0 changes nothing

Page 71: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

2) A + 1 = 1

ORing with 1 must give a 1 since if any input is 1 an OR gate will give a 1

Page 72: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

3) A • 0 = 0

In math if 0 is multiplied with anything you get 0. If you AND anything with 0 you get 0

Page 73: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

4) A • 1 = A

ANDing anything with 1 will yield the anything

Page 74: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

5) A + A = A

ORing with itself will give the same result

Page 75: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

6) A + A = 1

Either A or A must be 1 so A + A =1

Page 76: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

7) A • A = A

ANDing with itself will give the same result

Page 77: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

8) A • A = 0

In digital Logic 1 =0 and 0 =1, so AA=0 since one of the inputs must be 0.

Page 78: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

9) A = A

If you not something twice you are back to the beginning

Page 79: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

10) A + AB = A

Proof:

A + AB = A(1 +B)DISTRIBUTIVE LAW

= A∙1 RULE 2: (1+B)=1

= A RULE 4: A∙1 = A

Page 80: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

11) A + AB = A + B

If A is 1 the output is 1 , If A is 0 the output is B

Proof:

A + AB = (A + AB) + AB RULE 10

= (AA +AB) + AB RULE 7

= AA + AB + AA +AB RULE 8

= (A + A)(A + B) FACTORING

= 1∙(A + B) RULE 6

= A + B RULE 4

Page 81: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

BOOLEAN RULES

12) (A + B)(A + C) = A + BC

PROOF

(A + B)(A +C) = AA + AC +AB +BC DISTRIBUTIVE LAW

= A + AC + AB + BC RULE 7

= A(1 + C) +AB + BC FACTORING

= A.1 + AB + BC RULE 2

= A(1 + B) + BC FACTORING

= A.1 + BC RULE 2

= A + BC RULE 4

Page 82: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DE MORGAN’S THEOREM

Page 83: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

THEOREMS OF BOOLEAN ALGEBRA

1) A + 0 = A2) A + 1 = 13) A • 0 = 04) A • 1 = A5) A + A = A6) A + A = 17) A • A = A8) A • A = 0

Page 84: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

THEOREMS OF BOOLEAN ALGEBRA

9) A = A10) A + AB = A

11) A + AB = A + B12) (A + B)(A + C) = A + BC

13) Commutative : A + B = B + A AB = BA

14) Associative : A+(B+C) =(A+B) + C A(BC) = (AB)C

15) Distributive : A(B+C) = AB +AC (A+B)(C+D)=AC + AD + BC + BD

Page 85: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DE MORGAN’S THEOREMS

16) (X+Y) = X . Y17) (X.Y) = X + Y

• Two most important theorems of Boolean Algebra were contributed by De Morgan.

• Extremely useful in simplifying expression in which product or sum of variables is inverted.

• The TWO theorems are :

Page 86: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

IMPLICATIONS OF DE MORGAN’S THEOREM

(a) Equivalent circuit implied by theorem (16) (b) Negative- AND (c) Truth table that illustrates DeMorgan’s Theorem

(a)

(b)

Input Output

X Y X+Y XY

0 0 1 1

0 1 0 0

1 0 0 0

1 1 0 0

(c)

Page 87: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Implications of De Morgan’s Theorem

(a) Equivalent circuit implied by theorem (17) (b) Negative-OR (c) Truth table that illustrates DeMorgan’s Theorem

(a)

(b)

Input Output

X Y XY X+Y

0 0 1 1

0 1 1 1

1 0 1 1

1 1 0 0

(c)

Page 88: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DE MORGAN’S THEOREM CONVERSION

Step 1: Change all ORs to ANDs and all ANDs to OrsStep 2: Complement each individual variable (short overbar)Step 3: Complement the entire function (long

overbars)Step 4: Eliminate all groups of double overbars

Example : A . B A .B. C= A + B = A + B + C= A + B = A + B + C= A + B = A + B + C= A + B

Page 89: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

DE MORGAN’S THEOREM CONVERSION

ABC + ABC (A + B +C)D

= (A+B+C).(A+B+C) = (A.B.C)+D= (A+B+C).(A+B+C) = (A.B.C)+D= (A+B+C).(A+B+C) = (A.B.C)+D= (A+B+C).(A+B+C) = (A.B.C)+D

Page 90: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

EXAMPLES: ANALYZE THE CIRCUIT BELOW

Y

1. Y=???2. Simplify the Boolean expression found in 1

Page 91: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Follow the steps list below (constructing truth table) List all the input variable combinations

of 1 and 0 in binary sequentially Place the output logic for each

combination of input Base on the result found write out the

boolean expression.

Page 92: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

EXERCISES:

Simplify the following Boolean expressions1. (AB(C + BD) + AB)C2. ABC + ABC + ABC + ABC + ABC

Write the Boolean expression of the following circuit.

Page 93: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS Sum of Products (SOP) Products of Sum (POS)

Notes: SOP and POS expression cannot have more than

one variable combined in a term with an inversion bar There’s no parentheses in the expression

Page 94: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS

Converting SOP to Truth Table Examine each of the products to determine where

the product is equal to a 1. Set the remaining row outputs to 0.

Page 95: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS

Converting POS to Truth Table Opposite process from the SOP expressions. Each sum term results in a 0. Set the remaining row outputs to 1.

Page 96: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS

BCACABCBACBAf ),,(

632),,( mmmCBAf

)6,3,2(),,( mCBAf

The standard SOP Expression All variables appear in each product term. Each of the product term in the expression is called

as minterm.

Example:

In compact form, f(A,B,C) may be written as

Page 97: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS

)()()(),,( CBACBACBACBAf

The standard POS Expression All variables appear in each product term. Each of the product term in the expression is called as

maxterm. Example:

541),,( MMMCBAf

In compact form, f(A,B,C) may be written as

)5,4,1(),,( MCBAf

Page 98: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

STANDARD FORMS OF BOOLEAN EXPRESSIONS

CBACBACABABCCBAf ),,(

)()()()(),,( CBACBACBACBACBAf

Example:

Convert the following SOP expression to an equivalent POS expression:

Example:

Develop a truth table for the expression:

Page 99: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

THE K-MAP

Page 100: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

KARNAUGH MAP (K-MAP)

Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.

This will replace Boolean reduction when the circuit is large.

Write the Boolean equation in a SOP form first and then place each term on a map.

Page 101: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

• The map is made up of a table of every possible SOP using the number of variables that are being used.

• If 2 variables are used then a 2X2 map is used

• If 3 variables are used then a 4X2 map is used

• If 4 variables are used then a 4X4 map is used

• If 5 Variables are used then a 8X4 map is used

Karnaugh Map (K-Map)

Page 102: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

K-MAP SOP MINIMIZATION

Page 103: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

A

A

B B

Notice that the map is going false to true, left to right and top to bottom

The upper right hand cell is A B if X= A B then put an X in that cell

A

A

B B

1

This show the expression true when A = 0 and B = 0

0 1

2 3

2 Variables Karnaugh Map

Page 104: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

If X=AB + AB then put an X in both of these cells

A

A

B B

1

1

From Boolean reduction we know that A B + A B = B

From the Karnaugh map we can circle adjacent cell and find that X = B

A

A

B B

1

1

2 Variables Karnaugh Map

Page 105: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

3 VARIABLES KARNAUGH MAP

Gray Code

00 A B

01 A B

11 A B

10 A B

0 1

C C

0 1

2 3

6 7

4 5

Page 106: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

X = A B C + A B C + A B C + A B C

Gray Code

00 A B

01 A B

11 A B

10 A B

0 1

C C

Each 3 variable term is one cell on a 4 X 2 Karnaugh map

1 1

1 1

3 Variables Karnaugh Map (cont’d)

Page 107: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

X = A B C + A B C + A B C + A B C

Gray Code

00 A B

01 A B

11 A B

10 A B

0 1

C COne simplification could be

X = A B + A B

1 1

1 1

3 Variables Karnaugh Map (cont’d)

Page 108: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

X = A B C + A B C + A B C + A B C

Gray Code

00 A B

01 A B

11 A B

10 A B

0 1

C CAnother simplification could be

X = B C + B C

A Karnaugh Map does wrap around

1 1

1 1

3 Variables Karnaugh Map (cont’d)

Page 109: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

X = A B C + A B C + A B C + A B C

Gray Code

00 A B

01 A B

11 A B

10 A B

0 1

C CThe Best simplification would be

X = B

1 1

1 1

3 Variables Karnaugh Map (cont’d)

Page 110: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

ON A 3 VARIABLES KARNAUGH MAP

• One cell requires 3 Variables

• Two adjacent cells require 2 variables

• Four adjacent cells require 1 variable

• Eight adjacent cells is a 1

Page 111: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

4 VARIABLES KARNAUGH MAP

Gray Code

00 A B

01 A B

11 A B

10 A B

0 0 0 1 1 1 1 0

C D C D C D C D

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

Page 112: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Gray Code

00 A B

01 A B

11 A B

10 A B

0 0 0 1 1 1 1 0

C D C D C D C D

1

1

1

1

1

1

X = ABD + ABC + CD

Now try it with Boolean reductions

SIMPLIFY : X = A B C D + A B C D + A B C D + A B C D + A B C D + A B C D

Page 113: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

ON A 4 VARIABLES KARNAUGH MAP

• One Cell requires 4 variables

• Two adjacent cells require 3 variables

• Four adjacent cells require 2 variables

• Eight adjacent cells require 1 variable

• Sixteen adjacent cells give a 1 or true

Page 114: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIMPLIFY :

Z = B C D + B C D + C D + B C D + A B C

Gray Code

00 A B

01 A B

11 A B

10 A B

00 01 11 10

C D C D C D C D

1 1 1 1

1 1

1 1

1 1

1

1

Z = C + A B + B D

Page 115: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SIMPLIFY USING KARNAUGH MAP

First, we need to change the circuit to an SOP expression

Page 116: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Y= A + B + B C + ( A + B ) ( C + D)

Y = A B + B C + A B ( C + D )

Y = A B + B C + A B C + A B D

Y = A B + B C + A B C A B D

Y = A B + B C + (A + B + C ) ( A + B + D)

Y = A B + B C + A + A B + A D + B + B D + AC + C D

Simplify using Karnaugh map (cont’d)

SOP expression

Page 117: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Gray Code

00 A B

01 A B

11 A B

10 A B

00 01 11 10

C D C D C D C D

1 1

1 1

1 1 1 1

Y = 1

1 1 1 1

1 1

1 1

Simplify using Karnaugh map (cont’d)

Page 118: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

K-MAP POS MINIMIZATION

Page 119: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

3 VARIABLES KARNAUGH MAP

Gray Code

0 0

0 1

1 1

1 0

0 1

ABC

0 1

2 3

6 7

4 5

Page 120: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

3 VARIABLES KARNAUGH MAP (CONT’D)

Page 121: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

4 VARIABLES KARNAUGH MAP

0 0

0 1

1 1

1 0

0 0 0 1 1 1 1 0 A B

C D

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

Page 122: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

4 VARIABLES KARNAUGH MAP (CONT’D)

Page 123: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

4 VARIABLES KARNAUGH MAP (CONT’D)

Page 124: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

Mapping a Standard SOP expression Example:

Answer:

Mapping a Standard POS expression Example:

Using K-Map, convert the following standard POS expression into a minimum SOP expression

Answer:

Y = AB + AC or standard SOP :

KARNAUGH MAP - EXAMPLE

DCBADCBABCDACDBADCBADCBAY

CDADBY

ABCCBACBAY )( CBAY

Page 125: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

K-MAP WITH “DON’T CARE” CONDITIONS

Input Output

Example :

3 variables with output “don’t care (X)”

Page 126: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

K-MAP WITH “DON’T CARE” CONDITIONS (CONT’D)

4 variables with output “don’t care (X)”

Page 127: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

“Don’t Care” Conditions Example:

Determine the minimal SOP using K-Map:

Answer:

DACBCDDCBAF ),,,(

14,15)D(5,12,13, 9,10)M(0,2,6,8, D)C,B,F(A,

K-Map with “Don’t Care” Conditions (cont’d)

Page 128: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

SOLUTION :

14,15)D(5,12,13, 9,10)M(0,2,6,8, D)C,B,F(A,

DACBCDDCBAF ),,,(

ABCD

00

01

11

10

00 01 11 10

0 1 1 0

1 X 1 0

X X X X

0 0 1 0

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

Minimum SOP expression is CD

ADBC

Page 129: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

EXTRA EXERCISE

Minimize this expression with a Karnaugh map

ABCD + ACD + BCD + ABCD

Page 130: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

5 VARIABLE K-MAP

5 variables -> 32 minterms, hence 32 squares required

Page 131: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

K-MAP PRODUCT OF SUMS SIMPLIFICATION

Example: Simplify the Boolean function F(ABCD)=(0,1,2,5,8,9,10) in

(a) S-of-p (b) P-of-s

Using the minterms (1’s)F(ABCD)= B’D’+B’C’+A’C’D

Using the maxterms (0’s) and complimenting F Grouping as if they were minterms, then using De Morgen’s theorem to get F.

F’(ABCD)= BD’+CD+AB

F(ABCD)= (B’+D)(C’+D’)(A’+B’)

Page 132: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

5 VARIABLE K-MAP

Adjacent squares. E.g. square 15 is adjacent to 7,14,13,31 and its mirror square 11.

The centre line must be considered as the centre of a book, each half of the K-map being a page

The centre line is like a mirror with each square being adjacent not only to its 4 immediate neighbouring squares, but also to its mirror image.

Page 133: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

5 VARIABLE K-MAP

Example: Simplify the Boolean function

F(ABCDE) = (0,2,4,6,11,13,15,17,21,25,27,29,31)

Soln: F(ABCDE) = BE+AD’E+A’B’E’

Page 134: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

6 VARIABLE K-MAP

6 variables -> 64 minterms, hence 64 squares required

Page 135: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

TUTORIAL 1.5

1. Simplify the Boolean function F(ABCDE) = (0,1,4,5,16,17,21,25,29)

Soln: F(ABCDE) = A’B’D’+AD’E+B’C’D’

2. Simplify the following Boolean expressions using K-maps.

(a) BDE+B’C’D+CDE+A’B’CE+A’B’C+B’C’D’E’

Soln: DE+A’B’C’+B’C’E’

(b) A’B’CE’+A’B’C’D’+B’D’E’+B’CD’+CDE’+BDE’

Soln: BDE’+B’CD’+B’D’E’+A’B’D’+CDE’

(c) F(ABCDEF) = (6,9,13,18,19,27,29,41,45,57,61)

Soln: F(ABCDEF) = A’B’C’DEF’+A’BC’DE+CE’F+A’BD’EF

ICS217-Digital Electronics - Part 1.5 Combinational Logic

Page 136: CHAPTER 1 : INTRODUCTION Lecturer : Wan Nur Suryani Firuz bt Wan Ariffin H/P : 012 – 4820815 Office : KKF 8C (04-9854089) PLV : Nazatul Shima Saad

END OF CHAPTER 1