D-6 LEARNING GUIDE D-6 ANALYZE ELECTRONIC CIRCUITS

Similar documents
QUICK GUIDE COMPUTER LOGICAL ORGANIZATION - OVERVIEW

Introduction to Digital Electronics

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

MODULE 3. Combinational & Sequential logic

1. Convert the decimal number to binary, octal, and hexadecimal.

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Digital Logic Design: An Overview & Number Systems

Transducers and Sensors

Chapter 3. Boolean Algebra and Digital Logic

UNIT 1: DIGITAL LOGICAL CIRCUITS What is Digital Computer? OR Explain the block diagram of digital computers.

TYPICAL QUESTIONS & ANSWERS

Decade Counters Mod-5 counter: Decade Counter:

Chapter 9 MSI Logic Circuits

EE292: Fundamentals of ECE

CS302 - Digital Logic & Design

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Analogue Versus Digital [5 M]

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

SEMESTER ONE EXAMINATIONS 2002

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Computer Architecture and Organization

CS6201 UNIT I PART-A. Develop or build the following Boolean function with NAND gate F(x,y,z)=(1,2,3,5,7).

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Contents Circuits... 1

Chapter 3: Sequential Logic Systems

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

Digital Circuits. Electrical & Computer Engineering Department (ECED) Course Notes ECED2200. ECED2200 Digital Circuits Notes 2012 Dalhousie University

TIME SCHEDULE. MODULE TOPICS PERIODS 1 Number system & Boolean algebra 17 Test I 1 2 Logic families &Combinational logic

Notes on Digital Circuits

[2 credit course- 3 hours per week]

NORTHWESTERN UNIVERSITY TECHNOLOGICAL INSTITUTE

Principles of Computer Architecture. Appendix A: Digital Logic

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 2 Logistics

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

Semester 6 DIGITAL ELECTRONICS- core subject -10 Credit-4

Notes on Digital Circuits

REPEAT EXAMINATIONS 2002

1 Hour Sample Test Papers: Sample Test Paper 1. Roll No.

Lesson No Lesson No

WINTER 15 EXAMINATION Model Answer

THE KENYA POLYTECHNIC

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

FUNCTIONS OF COMBINATIONAL LOGIC

North Shore Community College

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Logic. Andrew Mark Allen March 4, 2012

Department of Computer Science and Engineering Question Bank- Even Semester:

AC103/AT103 ANALOG & DIGITAL ELECTRONICS JUN 2015

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Minnesota State College Southeast

4.S-[F] SU-02 June All Syllabus Science Faculty B.Sc. II Yr. Instrumentation Practice [Sem.III & IV] S.Lot

AE/AC/AT54 LINEAR ICs & DIGITAL ELECTRONICS DEC 2014

EC6302-DIGITAL ELECTRONICS II YEAR /III SEMESTER ECE ACADEMIC YEAR

Tribhuvan University Institute of Science and Technology Bachelor of Science in Computer Science and Information Technology

Chapter Contents. Appendix A: Digital Logic. Some Definitions

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

CS 61C: Great Ideas in Computer Architecture

A Review of logic design

B. Sc. III Semester (Electronics) - ( ) Digital Electronics-II) BE-301 MODEL ANSWER (AS-2791)

I B.SC (INFORMATION TECHNOLOGY) [ ] Semester II CORE : DIGITAL COMPUTER FUNDAMENTALS - 212B Multiple Choice Questions.

DIGITAL LOGIC DESIGN. Press No: 42. Second Edition

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

Condensed Notes On Digital Logics (According to BScCSIT syllabus TU) By Bishnu Rawal. csitnepal. Binary Systems Page 1.

Chapter 5: Synchronous Sequential Logic

Computer Systems Architecture

WINTER 14 EXAMINATION

PURBANCHAL UNIVERSITY

Course Plan. Course Articulation Matrix: Mapping of Course Outcomes (COs) with Program Outcomes (POs) PSO-1 PSO-2

MUHAMMAD NAEEM LATIF MCS 3 RD SEMESTER KHANEWAL

ME 515 Mechatronics. Introduction to Digital Electronics

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

For Teacher's Use Only Q Total No. Marks. Q No Q No Q No

Note 5. Digital Electronic Devices

TEST-3 (DIGITAL ELECTRONICS)-(EECTRONIC)

Section 001. Read this before starting!

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

FLIP-FLOPS AND RELATED DEVICES

UNIT V 8051 Microcontroller based Systems Design

ระบบคอมพ วเตอร และการเช อมโยง Computer Systems and Interfacing บทท 1 พ นฐานด จ ตอล

Engineering College. Electrical Engineering Department. Digital Electronics Lab

DIGITAL CIRCUIT COMBINATORIAL LOGIC

Chapter 4. Logic Design

CPS311 Lecture: Sequential Circuits

CS302 Glossary. address : The location of a given storage cell or group of cells in a memory; a unique memory location containing one byte.

Chapter 5 Sequential Circuits

Microcontrollers and Interfacing week 7 exercises

OFC & VLSI SIMULATION LAB MANUAL

Semester III. Subject Name: Digital Electronics. Subject Code: 09CT0301. Diploma Branches in which this subject is offered: Computer Engineering

Encoders and Decoders: Details and Design Issues

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER 2018 EXAMINATION MODEL ANSWER

CHAPTER 4: Logic Circuits

HS Digital Electronics Pre-Engineering

CSE221- Logic Design, Spring 2003

Helping Material of CS302

Laboratory Objectives and outcomes for Digital Design Lab

CHAPTER 4: Logic Circuits

Transcription:

CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM Level 4 Line D: Apply Circuit Concepts D-6 LEARNING GUIDE D-6 ANALYZE ELECTRONIC CIRCUITS

Foreword The Industry Training Authority (ITA) is pleased to release this major update of learning resources to support the delivery of the BC Electrician Apprenticeship Program. It was made possible by the dedicated efforts of the Electrical Articulation Committee of BC (EAC). The EAC is a working group of electrical instructors from institutions across the province and is one of the key stakeholder groups that supports and strengthens industry training in BC. It was the driving force behind the update of the Electrician Apprenticeship Program Learning Guides, supplying the specialized expertise required to incorporate technological, procedural and industry-driven changes. The EAC plays an important role in the province s post-secondary public institutions. As discipline specialists the committee s members share information and engage in discussions of curriculum matters, particularly those affecting student mobility. ITA would also like to acknowledge the Construction Industry Training Organization (CITO) which provides direction for improving industry training in the construction sector. CITO is responsible for organizing industry and instructor representatives within BC to consult and provide changes related to the BC Construction Electrician Training Program. We are grateful to EAC for their contributions to the ongoing development of BC Construction Electrician Training Program Learning Guides (materials whose ownership and copyright are maintained by the Province of British Columbia through ITA). Industry Training Authority January 2011 Disclaimer The materials in these Learning Guides are for use by students and instructional staff and have been compiled from sources believed to be reliable and to represent best current opinions on these subjects. These manuals are intended to serve as a starting point for good practices and may not specify all minimum legal standards. No warranty, guarantee or representation is made by the British Columbia Electrical Articulation Committee, the British Columbia Industry Training Authority or the Queen s Printer of British Columbia as to the accuracy or sufficiency of the information contained in these publications. These manuals are intended to provide basic guidelines for electrical trade practices. Do not assume, therefore, that all necessary warnings and safety precautionary measures are contained in this module and that other or additional measures may not be required.

Acknowledgements and Copyright Copyright 2011, 2014 Industry Training Authority All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or digital, without written permission from Industry Training Authority (ITA). Reproducing passages from this publication by photographic, electrostatic, mechanical, or digital means without permission is an infringement of copyright law. The issuing/publishing body is: Crown Publications, Queen s Printer, Ministry of Citizens Services The Industry Training Authority of British Columbia would like to acknowledge the Electrical Articulation Committee and Open School BC, the Ministry of Education, as well as the following individuals and organizations for their contributions in updating the Electrician Apprenticeship Program Learning Guides: Electrical Articulation Committee (EAC) Curriculum Subcommittee Peter Poeschek (Thompson Rivers University) Ken Holland (Camosun College) Alain Lavoie (College of New Caledonia) Don Gillingham (North Island University) Jim Gamble (Okanagan College) John Todrick (University of the Fraser Valley) Ted Simmons (British Columbia Institute of Technology) Members of the Curriculum Subcommittee have assumed roles as writers, reviewers, and subject matter experts throughout the development and revision of materials for the Electrician Apprenticeship Program. Open School BC Open School BC provided project management and design expertise in updating the Electrician Apprenticeship Program print materials: Adrian Hill, Project Manager Eleanor Liddy, Director/Supervisor Beverly Carstensen, Dennis Evans, Laurie Lozoway, Production Technician (print layout, graphics) Christine Ramkeesoon, Graphics Media Coordinator Keith Learmonth, Editor Margaret Kernaghan, Graphic Artist Publishing Services, Queen s Printer Sherry Brown, Director of QP Publishing Services Intellectual Property Program Ilona Ugro, Copyright Officer, Ministry of Citizens Services, Province of British Columbia To order copies of any of the Electrician Apprenticeship Program Learning Guide, please contact us: Crown Publications, Queen s Printer PO Box 9452 Stn Prov Govt 563 Superior Street 2nd Flr Victoria, BC V8W 9V7 Phone: 250-387-6409 Toll Free: 1-800-663-6105 Fax: 250-387-1120 Email: crownpub@gov.bc.ca Website: www.crownpub.bc.ca Version 1 Corrected, January 2017 Corrected, October 2015 Revised, December 2014 Revised, April 2014 New, October 2012

LEVEL 4, LEARNING GUIDE D-6: ANALYZE ELECTRONIC CIRCUITS Learning Objectives............................................... 7 Learning Task 1: Describe common number systems used in digital electronics.......... 9 Self-Test 1......................................... 24 Learning Task 2: Describe the operation of common logic gates.................. 27 Self-Test 2......................................... 36 Learning Task 3: Describe Boolean algebra............................... 39 Self-Test 3......................................... 50 Learning Task 4: Describe the operation of special combination logic circuits.......... 53 Self-Test 4......................................... 80 Learning Task 5: Describe the features of integrated circuits (IC).................. 85 Self-Test 5......................................... 94 Learning Task 6: Connect and test digital logic circuits........................ 97 Self-Test 6........................................ 100 Learning Task 7: Describe the features of operational amplifiers..................101 Self-Test 7........................................ 107 Learning Task 8: Describe common circuit applications for the operational amplifier.....109 Self-Test 8........................................ 118 Answer Key................................................. 121 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 5

6 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Objectives D-6 Learning Objectives The learner will be able to analyze electronic circuits that utilize logic gates. The learner will be able to describe the operating principles of op-amps. The learner will be able to analyze electronic circuits that utilize op-amps. The learner will be able to describe the operating principles of logic gates. The learner will be able to convert between numbering systems. The learner will be able to describe coding and decoding information. Activities Read and study the topics of Learning Guide D-6: Analyze Electronic Circuits. Complete Self-Tests 1 through 8. Check your answers with the Answer Key provided at the end of this Learning Guide. Resources All resources are provided in this Learning Guide. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 7

BC Trades Modules www.bctradesmodules.ca We want your feedback! Please go the BC Trades Modules website to enter comments about specific section(s) that require correction or modification. All submissions will be reviewed and considered for inclusion in the next revision. SAFETY ADVISORY Be advised that references to the Workers Compensation Board of British Columbia safety regulations contained within these materials do not/may not reflect the most recent Occupational Health and Safety Regulation. The current Standards and Regulation in BC can be obtained at the following website: http://www.worksafebc.com. Please note that it is always the responsibility of any person using these materials to inform him/herself about the Occupational Health and Safety Regulation pertaining to his/her area of work. Industry Training Authority January 2011 8 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1: Describe common number systems used in digital electronics To most people, a number system means the standard decimal, or base 10, number system. Since digital electronics is based on two stable states, binary number systems, which use only digits 1 and 0, are essential. In this Learning Task you will examine, contrast and compare the decimal system with binary and other systems: decimal (in everyday usage) octal (PLCs) binary (computers) hexadecimal (PLCs) These numbering systems have several things in common: 1. They all have a base (also called a radix). Decimal system uses base 10. Octal system uses base 8. Binary system uses base 2. Hexadecimal system uses base 16. 2. The number of digits in a number system is the same as the base of that system. Decimal has 10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Octal has 8 (0, 1, 2, 3, 4, 5, 6, 7). Binary has 2 (0, 1). Hexadecimal has 16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). 3. The largest digit used in a number system is one less than the base. Largest digit in base 10 is 9. Largest digit in base 8 is 7. Largest digit in base 2 is 1. 4. Digits on the extreme left and right are identified as MSD and LSD, respectively. These relate to the location of the digit in the number. The digit on the extreme left is the Most Significant Digit MSD. The digit on the extreme right is the Least Significant Digit LSD. The digits between are identified according to their position in relation to the MSD. So 2SD, 3SD, etc., stand for second most significant digit, third most significant digit, etc. For example, if an item costs $7777, the 7 on the far right is insignificant when considering the cost. But the 7 on the far left is obviously highly significant. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 9

Learning Task 1 D-6 5. Numbers within a particular system are often identified by means of a subscript. For example: octal 1255 8 hexadecimal 1255 16 Decimal system The most common numbering system, is the decimal system which uses base 10. (The decimal system and the base 10 system are one and the same.) The decimal system has 10 digits, of which the highest digit is 9. If a number is written without showing a subscript base, base 10 is implied. Thus, the number 256 = 256 10. Example 1: The following equation explains what 256 10 or 256 means: 2 1 0 256 = ( 2 10 ) + ( 5 10 ) + ( 6 10 ) 10 = ( 2 100) + ( 5 10) + ( 6 1) = 200 + 50 + 6 In other words, there are two 100s, five 10s and six 1s in the number 256. A number raised to the power of zero equals 1. Therefore: 10 0 = 1, 8 0 = 1, 16 0 = 1, and so on. Example 2: What does 6479 10 or 6479 mean? 3 2 1 0 6479 = ( 6 10 ) + ( 4 10 ) + ( 7 10 ) + ( 9 10 ) 10 = ( 6 1000)+ ( 4 100) + ( 7 10) + ( 9 1) = 6000 + 400 + 70 + 9 = 6479 This shows that there are six 1000s, four 100s, seven 10s, and nine 1s in the number 6479. All you are doing with a base 10 number is multiplying the LSD by 10 0, the next digit by 10 1, the next digit by 10 2, and so on, up to and including the MSD. Octal system The octal system uses base 8. This means that it has 8 digits, the highest of which is 7. Notice in the following examples that the octal number is treated in the same way as the decimal, except here you are using 8 instead of 10. The LSD is multiplied by 8 0, the next digit by 8 1, the next by 8 2, and so on to the left, until you reach the last digit. 10 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Example 1: What does the number 256 8 equal in the base 10, or decimal, system? 2 1 0 256 = ( 2 8 ) + ( 5 8 ) + ( 6 8 ) 8 = ( 2 64) + ( 5 8) + ( 6 1) = 128+ 40+ 6 Thus 256 8 = 174 10 (or simply 174). This would be stated: Two-five-six octal equals one-hundred-seventy-four. Example 2: What is 64 8 in decimal? 1 0 64 = ( 6 8 ) + ( 4 8 ) 8 = ( 6 8) + ( 4 1) = 48 + 4 = 52 Example 3: What is 432 8 in decimal? 2 1 0 432 = ( 4 8 ) + ( 3 8 ) + ( 2 8 ) 8 = ( 4 64) + ( 3 8) + ( 2 1) = 256+ 24+ 2 = 282 Example 4: What is 1234 8 in decimal? 3 2 1 0 1234 = ( 1 8 ) + ( 2 8 ) + ( 3 8 ) + ( 4 8 ) 8 = ( 1 512) + ( 2 64) + ( 3 8) + ( 4 1) = 512 + 128 + 24 + 4 = 668 Binary system The binary system uses base 2. This means it has 2 digits, the highest of which is 1. You will find only 0s and 1s in a binary number. Notice in the following examples the symmetry to the decimal and octal system. Binary uses base 2, so here we are using 2 instead of the 8 and 10 previously used in octal and base 10, respectively. The LSD is multiplied by 2 0, the next digit by 2 1, the next by 2 2, and so on to the left, until you reach the MSD. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 11

Learning Task 1 D-6 Example 1: What does the binary number 1011 2 equal in decimal? 3 2 1 0 1011 = ( 1 2 ) + ( 0 2 ) + ( 1 2 ) + ( 1 2 ) 2 = ( 1 8) + ( 0 4) + (1 2) + ( 1 1) = 8+ 0+ 2+ 1 = 11 Therefore 1011 2 = 11 10, or 11, or eleven. Example 2: What is 11 100 2 in decimal? 4 3 2 1 0 11100 = ( 1 2 ) + ( 1 2 ) + ( 1 2 ) + ( 0 2 ) + ( 0 2 ) 2 = ( 1 16) + ( 1 8) + ( 1 4) + ( 0 2) + ( 0 1) = 16 + 8 + 4+ 0+ 0 = 28 Example 3: What is 10 101 2 in decimal? 4 3 2 1 0 10 101 = ( 1 2 ) + ( 0 2 ) + ( 1 2 ) + ( 0 2 ) + ( 1 2 ) 2 = ( 1 16) + ( 0 8) + ( 1 4) + ( 0 2) + ( 1 1) = 16 + 0+ 4+ 0+ 1 = 21 Another method of converting binary to decimal If we consider a binary number, 111 11 2, the LSD represents 1(2 0 ), the next represents 2 (2 1 ), the next is 4 (2 2 ), the next is 8 (2 3 ), and the last, the MSD, is 16 (2 4 ). Starting with the LSD = 1, (or LSB for lowest significant bit, as it is more commonly called), the numbers represented by the 1s in binary keep doubling: 2, 4, 8, 16, 32, 64, 128, 256 and so on, as you move towards the MSB. These decimal digits are then added up to give the decimal equivalent of the binary. If there is a 0 in the binary number it merely means the absence of one of these numbers. Therefore if you want to find the decimal equivalent of a binary number you can find it by the method shown in the following example. Example 1: Change 1100111 2 to decimal. Note that you stroke out the numbers represented by the 0s and add the others. 1 1 0 0 1 1 1 64 + 32 + 16 + 8 + 4 + 2 + 1 = 103 Therefore: 1100101 2 = 103 12 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Example 2: Change 1011100 2 to decimal 1 0 1 1 1 0 0 64 + 32 + 16 + 8 + 4 + 2 + 1 = 92 Therefore: 1011100 2 = 92 Hexadecimal system The hexadecimal system uses base 16. It has 16 digits, the highest of which is decimal 15. Because decimal numbers 10 to 15 require two digits each, you will see letters as well as numbers in a hexadecimal number. Letters A, B, C, D, E and F replace numbers 10, 11, 12, 13, 14 and 15, respectively. The hexadecimal number is treated exactly like numbers with other bases. In the following examples you use 16 instead of the 2, 8 and 10 for binary, octal and decimal, respectively. The LSD is multiplied by 16 0, the next digit by 16 1, the next by 16 2, and so on to the left, until you reach the last digit. Example 1: What does 256 16 equal in decimal? 2 1 0 256 = ( 2 16 ) + ( 5 16 ) + ( 6 16 ) 16 = ( 2 256) + ( 5 16) + ( 6 1) = 512 + 80 + 6 = 598 Therefore: 256 16 = 598 10, or simply, 598. Example 2: What does 3C2 16 equal in decimal? (Note: C = 12) 2 1 0 3C 2 = ( 3 16 ) + ( 12 16 ) + ( 2 16 ) 16 = ( 3 256) + ( 12 16) + ( 2 1) = 768 + 192 + 2 = 962 Therefore: 3C2 16 = 962 10, or simply, 962. Example 3: What does 12AB 16 equal in decimal? (Note: A = 10, B = 11) 3 2 1 0 12AB = ( 1 16 ) + ( 2 16 ) + ( 10 16 ) + ( 11 16 ) 16 = ( 1 4096) + ( 2 256) + ( 10 16) + ( 11 1) = 4096 + 512 + 160 + 11 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 13

Learning Task 1 D-6 If you need to convert a decimal (base 10) number to any base, proceed as follows: 1. Divide the decimal number by the base repeatedly, until no further division is possible. 2. Every time you divide you will get an answer and a remainder. If the number divides evenly, the remainder is 0. 3. The remainder in each division is one of the digits that make up the answer. 4. The last remainder is the MSD, the second-last remainder is the 2MD, and so on to the first remainder, which is the LSD. These remainders make up the answers in the examples below. Example 1: Change 259 to octal (base 8). 259 8 = 32 + 3 32 8 = 4 + 0 4 8 = 0 + 4 259 = 403 8 Example 2: Change 187 to octal. 187 8 = 23 + 3 23 8 = 2 + 7 2 8 = 0 + 2 187 = 273 8 14 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Example 3: Change 752 to octal. 752 8 = 94 + 0 94 8 = 11+ 6 11 8 = 1+ 3 1 8 = 0 + 1 752 = 1360 8 Example 4: Change 23 to binary. 23 2 = 11+ 1 11 2 5 2 2 2 1 2 = 5+ 1 = 2 + 1 = 1+ 0 = 0 + 1 23 = 10111 8 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 15

Learning Task 1 D-6 Example 5: Change 74 to binary. 74 2 = 37 + 0 37 2 18 2 9 2 4 2 2 2 1 2 = 18 + 1 = 9 + 0 = 4 + 1 = 2 + 0 = 1+ 0 = 0 + 1 74 = 1001010 2 Example 6: Change 1325 to hexadecimal. 1325 16 = 82 + 13 82 16 = 5+ 2 5 16 = 0 + 5 1325 = 52D 16 16 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Example 7: Change 1767 to hexadecimal. 1767 16 = 110 + 7 110 16 = 6 + 14 6 16 = 0 + 6 1767 = 6E7 16 Example 8: Change 656 to hexadecimal. 656 16 41 16 = 41+ 0 = 2 + 9 2 16 = 0 + 2 656 = 290 16 Binary-to-Octal conversions Converting Binary to Octal The largest digit in the octal system is 7 8, which converted to binary is equal to 111 2. From this we can see that it takes three binary bits to equal the largest digit in the octal system. To convert from binary to octal, starting at the LSD, separate the binary digits into groups of three. Example 1: Change 0011101110011101 2 to its equivalent in octal. 011 101 110 011 101 3 5 6 3 5 0011101110011101 2 = 35635 8 Example 2: Change 11010010110001 2 from binary to octal. Zeros are added to the MSD to complete the final group if it is less than three digits 011 010 010 110 001 3 2 2 6 1 11010010110001 2 = 32261 8 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 17

Learning Task 1 D-6 Converting Octal to Binary The above procedure may be reversed if you need to convert octal to binary. Substitute the three bit binary equivalent, for each of the octal digits. Example 1: Change 4567 8 to binary. 4 5 6 7 100 101 110 111 4567 8 = 100101110111 2 Example 2: Change 7654 8 to binary. 7 6 5 4 111 110 101 100 7654 8 = 111110101100 2 Binary-to-hexadecimal conversion The procedure used to convert from binary to hexadecimal and vice-versa is very similar to that used in the binary-octal conversion, except that here groups of four bits must be used, because hexadecimal numbers go as high as F (or 15), which is 1111 2 in binary. Example 1: Change 0011101110011101 2 to its equivalent in hexadecimal. 0011 1011 1001 1101 3 B 9 D 0011101110011101 2 = 3B9D 16 As in the binary to octal conversion, zeros may have to be added to the MSD to complement the final grouping. Example 2: Change 11010010110001 2 to hexadecimal. 11 0100 1011 0001 0011 0100 1011 0001 3 4 B 1 11010010110001 2 = 34B1 16 Converting hexadecimal to binary The above procedure may be reversed if you need to convert hexadecimal to binary. Substitute four bits for each of the hexadecimal digits. Example: Change B069 16 to binary. B 0 6 9 1011 0000 0110 1001 B069 16 = 1011000001101001 2 18 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Binary-coded-decimal (BCD) You saw how a decimal number can be represented as a binary number. Consider the string of 1s and 0s as a code representing decimal numbers. When the binary equivalent of a decimal digit is substituted for that digit it is called encoding. Conversions between decimal and binary can become unwieldy for large numbers. The BCD was designed as another method of representing decimal numbers in binary digits. BCD is used wherever decimal information is transferred in or out of a digital system. Such applications include calculators, digital electric meters and digital clocks. The chief advantage of BCD is the relative ease of conversion to and from decimal. All digital systems must use some form of binary in their internal operation. A decimal like 12, or 1100 2, is seen by the computer as a sequence of highs and lows that correspond to the binary numbers, thus: high, high, low, low. BCD is not used in contemporary computers because any given number requires more BCD bits than straight bits and this would reduce the speed of computer operation. Converting decimal to BCD In BCD, a four-bit code is used to represent each digit of a decimal number. Therefore, to change a decimal number into BCD you replace each of the decimal digits with four binary bits. It is necessary to use four because, whereas digits 0 to 7 need only three bits, 8 and 9 require four bits, which are 1000 and 1001, respectively. Example 1: Convert 568 to BCD. 5 = 0101 2 6 = 0110 2 8 = 1000 2 568 = 0101 0110 1000 BCD Decimal converted to BCD is not a binary number. Do not forget to use the subscript BCD to distinguish this from a binary number. The binary equivalent of 568 equals 1000111000 2, obviously not the same as the BCD group. Example 2: Change 1769 to BCD. 1 7 6 9 0001 0111 0110 1001 Therefore: 1769 = 0001 0111 0110 1001 BCD Since the spacing between the groups is not necessary, it is written: 0001011101101001 BCD CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 19

Learning Task 1 D-6 Example 3: Change 2946 to BCD. 2 9 4 6 0010 1001 0100 0110 Therefore: 2946 = 0010100101000110 BCD Converting BCD to decimal To reverse the process is straightforward. Example: Change 010101110010 BCD to decimal. 0101 0111 0010BCD 5 7 2 Therefore: 010101110010 BCD = 572 ASCII The American Standard Code for Information Interchange (ASCII) represents symbols used in computer codes. Computers use the capital and lower-case letters, punctuation marks and various other symbols (like +, $, & and so on) seen on a standard computer or typewriter keyboard. A computer recognizes all these symbols by codes, called alphanumeric codes. At one time different manufacturers used different codes, but ASCII (pronounced ask ee) has now become the standard code for alphanumeric symbols. ASCII is a seven-bit code with 128 characters: 0 through 127 decimal, or 0 through 177 octal For example, the letter B is coded 100 0010. The space between the group of three and group of four is inserted for easier reading, but it is not mandatory. The code for lower-case B, b, is 110 0010, or 1100010. Table 1 shows the ASCII code. The table is read like a graph. The rows here are identified X 3 X 2 X 1 X 0, and the columns X 6 X 5 X 4. The rows represent the group of four bits on the right and the columns the three bits on the left. The ASCII code for a symbol is then read: X 6 X 5 X 4 X 3 X 2 X 1 X 0 20 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 Table 1: ASCII code X 3 X 2 X 1 X 0 X 6 X 5 X 4 010 011 100 101 110 111 0000 SP 0 @ P p 0001! 1 A Q a q 0010 2 B R b r 0011 # 3 C S c s 0100 $ 4 D T d t 0101 % 5 E U e u 0110 & 6 F V f v 0111 7 G W g w 1000 ( 8 H X h x 1001 ) 9 I Y i y 1010 * : J Z j z 1011 + ; K k 1100, < L l 1101 - = M m 1110. > N n 1111 /? O o Example 1: Take the letter B. This shows its column location as 100 and its row location as 0010. The letter B is therefore 100 0010. Example 2: If we consider the word STOP typed on a computer keyboard, it would be encoded in ASCII as: 1010011101010010011111010000 S = 101 0011 T = 101 0100 O = 100 1111 P = 101 0000 Example 3: What does the encoded ASCII message: 010 0100 011 0010 011 0101 say? 010 0100 = $ 011 0010 = 2 011 0101 = 5 Therefore, it says $25. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 21

Learning Task 1 D-6 Gray code The gray code is one of a series of cyclic or reflected codes and is primarily used for positioning transducers. It is a four-bit code, but the bit positions do not have any weight attached to them, so the gray code is not used for arithmetic applications. The gray code for decimal numbers is shown in Table 2. A characteristic of the gray code is that in going from one number to the consecutive number there is only a one-bit change. Example: In Table 2 you will note that 7 = 0100 and 8 = 1100. Only one bit, the first one, has changed. Compare this to straight binary where 7 = 0111 and 8 = 1000. Here all four bits change. Simplicity is the main reason for the gray code. Unit-distance measurement The gray code is also called a unit-distance code. It is used in instrumentation where linear or angular displacement is measured. In such systems, transducers are used to monitor displacements and to produce bit values proportional to the linear or angular position. Table 2: Gray code Decimal Gray code 0 0000 1 0001 2 0011 3 0010 4 0110 5 0111 6 0101 7 0100 8 1100 9 1101 10 1111 11 1110 12 1010 13 1011 14 1001 15 1000 Figure 1 shows a 16-segment shaft encoder of the gray code variety used to measure angular displacement as a disk rotates. The disk has 16 pieshaped segments and shaded and unshaded windows in each segment. Shaded windows block light and unshaded windows let the light through. Optical sensors behind the disk produce a 1 for presence of light and a 0 for absence of light. The pattern of shaded and unshaded windows in the disk produces the string of four bits that make up the gray code. The optical sensor will be in a fixed position to detect positional changes. For example, if the shaft is rotated with position 7 in line with the sensor, the optical sensor will register 0100 (no light, light, no light, no light). There is only a one-bit change in going from one number to the next in the gray code. If, for example, the code on the shaft encoder were straight binary and the shaft at position 7, it would indicate 0111. If it then were to move to position 8, all four bits would have to change to 1000. But what if the disk were to stop between 7 and 8? Now the bit on the extreme left Figure 1 Shaft encoder would change from 0 to 1 before the remaining three bits would change from 1s to 0s. The binary code would then appear as 1111, which is 15. This 22 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 would be a great position error. The optical position detector, using the unit-distance gray code, prevents a position error from happening, because only one change will occur in moving from 7 to 8 (Figure 2). The position detected by the transducer would never differ by more than one position from its true position. Light sensors Light sources Figure 2 Optical position detectors Now do Self-Test 1 and check your answers. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 23

Learning Task 1 D-6 Self-Test 1 Calculators are not to be used. 1. Identify the bases for the decimal, binary, octal and hexadecimal number systems. 2. Convert the following numbers to decimal: a. 33 8 b. 424 8 c. 1750 8 d. 11136 8 e. 23432 8 3. Convert the following numbers to decimal: a. 1111 2 b. 101 2 c. 10011 2 d. 11100 2 e. 10101 2 24 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 1 D-6 4. Convert the following hexadecimal numbers to decimal. a. 21 16 b. 114 16 c. 3E7 16 d. 125D 16 e. 17BB 16 5. Convert the following decimal numbers to binary: a. 46 b. 77 c. 27 6. Convert the following decimal numbers to hexadecimal: a. 423 b. 214 c. 114 7. Convert the following binary number to hexadecimal: 1001011000001011 2 8. Convert the following octal number to binary: 1376 8 9. A BCD number and a straight binary number are one and the same. a. true b. false 10. Convert 1984 to BCD. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 25

Learning Task 1 D-6 11. What is 0010 0100 1000 BCD in decimal? 12. Because it represents both numbers and letters, ASCII is classified as an code. 13. What do the letters ASCII stand for? 14. Using Table 1 in the Learning Task, what ASCII code represents the letter M? 15. What is the unique feature of the gray code with respect to consecutive number representation? Go to the Answer Key at the end of the Learning Guide to check your answers. 26 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2: Describe the operation of common logic gates A logic gate is a device with high-speed switching capability. Gates are made from integrated circuits, commonly called ICs. Logic gates are the electronic equivalent of mechanical switches connected in series or parallel. They are decision-making circuits. By combining logic gates, memory circuits can also be formed. The transistors, resistors and diodes that make up the typical logic gate are etched out of silicon. Although you need not be too concerned about the internal circuitry of a gate, you must know what to expect at an output for given inputs. Typical logic gates are provided with two or more inputs and one output. They are designed to either block or pass digital signals. There are five basic logic gates: AND OR NOT (also called the inverter gate) NAND NOR To fully understand digital electronics you must be conversant with these five basic gates. AND gate The AND gate has two or more inputs and one output. Figure 1 shows the AND gate symbol and its electrical circuit analogy. The switches A and B correspond to the gate inputs A and B, and the lamp corresponds to the output Y. 0 1 Switch A 0 1 Switch B Lamp Y A B Symbol Y Equivalent circuit Figure 1 AND gate symbol and electrical circuit analogy As with mechanical switches, each input has two states, 1 and 0, called high and low, respectively. 1 is equivalent to a closed switch, and 0 is equivalent to an open switch. Table 1 summarizes the lamp status (output) based on all the possible combinations of the two switches (inputs). This is the equivalent of the AND gate operation. Table 2 summarizes the operation of the AND gate. This logic gate table sums up the action of the gate and is called a truth table. All logic gates have truth tables associated with them. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 27

Learning Task 2 D-6 Table 1: Lamp status Table 2: AND truth table Switch A Switch B Lamp Y Input A Input B Output Y off off Off 0 0 0 off on Off 0 1 0 on off Off 1 0 0 on on On 1 1 1 The lines in the truth table sum up the operation of the AND gate. Only when all the inputs to an AND gate are high (1) will you get a high (1) output. The gate is appropriately named AND since input A and input B must be 1 in order to get an output 1. Although AND gates are available with several inputs, the rule remains the same: all inputs must be high in order to obtain an output high. This is the same as with the equivalent switching circuit: all switches must be closed for the lamp to light. Inputs and outputs 1 and 0 represent voltage levels. Typical nominal voltage levels would be +5 V and 0 V, respectively. It would be totally incorrect to assume 0 means the absence of a signal: 0, or low, is a very definite signal. Boolean expression A Boolean expression is a way of expressing the operation of a logic gate. For the AND gate, with inputs A and B and output Y, it is expressed: A B = Y. The dot is taken to mean and. It may sometimes be omitted, and the expression, meaning the same thing, may be written as: AB = Y Boolean expressions (named after George Boole, an Irish mathematician) convey the gate operation: when A and B are high, C (Y) is high. If an AND gate had three inputs A, B and C, its Boolean expression would be: A B C = Y. Again, this may written ABC = Y to convey, mathematically, the gate operation. An AND gate with any number of inputs is written similarly. The behaviour of any AND gate may be expressed by the statement Any low gives a low. This means that if any one of the inputs is 0, the output will be low. 28 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2 D-6 OR gate The OR gate has two or more inputs and one output. Figure 2 shows the symbol for the OR gate along with its electrical circuit analogy. 0 1 Switch A 0 1 Switch B A B Y Lamp Y Symbol Equivalent circuit Figure 2 OR gate symbol and electrical circuit analogy The operation of the OR gate is analogous to an electrical circuit with the switches in parallel. The lamp will light when either switch is closed or if both switches are closed. It is the same with the OR gate. There will be a high output if either input is high or if both inputs are high. As with the AND gate, a 1 is equivalent to a closed switch, and a 0 is equivalent to an open switch. Truth table 3 sums up the operation of the OR gate. Table 3: OR truth table Input A Input B Output Y 0 0 0 1 0 1 0 1 1 1 1 1 Boolean expression The Boolean equation that expresses the OR gate operation is: A + B = Y. The + sign here stands for or. If the inputs were A, B and C, it would be written: A + B + C = Y The behaviour of any OR gate may be expressed by the statement: Any high gives a high. This means that if there is any input 1, the output will be 1. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 29

Learning Task 2 D-6 NOT gate A NOT gate has a single input and a single output. It is also called an inverter gate. The NOT symbol and its electrical circuit analogy are shown in Figure 3. Current-limiting resistor Switch A 1 0 Lamp Y A A Symbol Equivalent circuit Figure 3 NOT gate symbol and electrical circuit analogy The NOT gate is the simplest of all the gates from the point of view of operation. When the input is 0, the output is 1, and when the input is 1, the output is 0. In the electrical circuit, if the switch is on (1) the lamp is off (0), and if the switch is off (0) the lamp is on (1). Truth table 4 sums up the operation of the NOT gate. Table 4: NOT (Inverter) truth table Input A Output 0 1 1 0 Boolean expression The Boolean equation that expresses the NOT gate operation is: A = A The line or bar signifies the inversion function. It means the input and output are opposites, or complementary. NAND gate The NAND gate has two or more inputs and one output. Figure 4 shows the NAND gate symbol, along with its electrical circuit and logic-gate analogies. 30 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2 D-6 Current-limiting resistor 0 1 Switch A A B Y 0 1 Switch B Lamp Y A B A B Y = A B Symbol Electrical equivalent Gate equivalent Figure 4 NAND gate symbol with electrical circuit and logic-gate analogies The NAND gate symbol is an AND gate symbol with a bubble, or inversion, on the output. The bubble is equivalent to putting an inverter at the output of an AND gate. For the same inputs, the outputs of the AND and NAND gates are opposites, or complementary. The operation of the NAND gate is analogous to an electrical circuit with the switches and lamp connected as shown. The NAND gate operation is said to be an inversion of the AND gate operation; and the NAND and AND gates are described as complementary. The lamp will not light when switch A and switch B are closed. If either one is open, or if both are open, the lamp will light. Truth table 5 sums up the operation of the NAND gate. Table 5: NAND truth table Input A Input B Output Y 0 0 1 1 0 1 0 1 1 1 1 0 Boolean expression The Boolean equation that expresses the NAND gate operation is: A B = C or AB = C The sign here stands for AND, as before. The solid line over both inputs is crucial. It says that only when the inputs A and B are high, the output will be low. The behaviour of any NAND gate may be expressed by the statement Any low gives a high. This means that if there is any input 0, the output will be 1. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 31

Learning Task 2 D-6 NOR gate The NOR gate has two or more inputs and one output. Figure 5 shows the symbol for the NOR gate, along with its electrical circuit and logic gate equivalents. Current-limiting resistor 0 1 0 1 Switch A Switch B Lamp Y A B Symbol Y Equivalent circuit A B A + B Gate equivalent Y = A + B Figure 5 NOR gate symbol with electrical circuit and logic-gate analogies The NOR gate symbol is an OR gate symbol with a bubble, or inversion, on the output. The bubble is equivalent to putting an inverter at the output of an OR gate. For the same inputs, the outputs of the OR and NOR gates are opposites. This is similar to the contrast between AND and NAND gates. The operation of the NOR gate is analogous to an electrical circuit with the switches and lamp connected as shown in Figure 5. The NOR gate operation is an inversion of the OR gate operation. The lamp will not light if switch A or switch B is closed, or if both are closed. The lamp will light only when A and B are both open. The NOR gate operation is similar. Any 1 input will make an output 0. It follows that if both inputs are 1 the output is 0 also. Only when there is no 1 input (both inputs are 0) will the output be 1. Truth table 6 sums up the operation of the NOR gate. Table 6: NOR truth table Input A Input B Output Y 0 0 1 1 0 0 0 1 0 1 1 0 The NOR and OR gates are said to be complementary. Notice that for the same sets of inputs the outputs of OR and NOR gates are opposite or complementary. Boolean expression The Boolean equation that expresses the NOR gate operation is: A + B = Y The + sign here stands for OR, as in the previous example. The solid line over both inputs is crucial. It means when inputs A or B are high, the output is low. 32 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2 D-6 The behaviour of any NOR gate may be expressed by the statement: Any high gives a low. This means that if there is any input 1, the output will be 0. XOR gate XOR is short for exclusive-or. It is not one of the five basic gates but is a special gate designed for binary addition. The XOR gate has two inputs and one output. Its symbol is shown in Figure 6. A B Y Figure 6 Exclusive-OR (XOR) gate symbol The operation of the XOR gate is slightly different from that of the OR gate, sometimes called inclusive-or gate. You can see this by comparing truth tables 7 and 8. Table 7: XOR gate truth table Table 8: OR gate truth table Input A Input B Output Y Input A Input B Output Y 0 0 0 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 The difference in their operation is in Output Y of the tables. Whereas two input 1s will give an output 1 in the OR gate, they will give an output 0 in the XOR gate. A common way of expressing the operation is to say that the output will be high only when the inputs are opposite (or complementary ). Boolean expression The Boolean expression that sums up the XOR gate operation is: AB + AB = Y, which may also be written as A B = Y Both formulas mean the same thing, that the output will be 1: if you have 0 on A and 1 on B, or if you have 1 on A and 0 on B. In other words, the output will be high only if the two inputs are complementary. New logic symbols The logic symbols we have been using are the standard gate symbols that have been used for many years, and they are still the most widely recognized in North America. However, the rectangular equivalent symbols are gradually appearing in more and more of the literature, so they are included here (Figure 7). CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 33

Learning Task 2 D-6 Rectangular symbols use an angle where the traditional symbols used a bubble. The triangle, like the bubble, stands for an inversion of the logic level. The symbol inside the rectangle identifies the type of logic gate. A Y A 1 Y A B Y A B & Y A B Y A B 1 Y A B Y A B & Y A B Y A B 1 Y Standard Rectangular Figure 7 Traditional and rectangular logic gate symbols Timing diagrams Timing diagrams show how digital signal levels vary with time. The timing diagram may be for an input or output only, but most timing diagrams show the relationship between input signals and output signals in digital logic gates and digital logic circuits. The signal magnitudes, both input and output, are shown on the Y-axis. These are either high (1) or low (0), and typically represent +5 V nominal and 0 V nominal, respectively. They apply to inputs and outputs. The signal times, both input and output, are shown on the X-axis. This represents the time duration of the signals. Since the output signals are a function of the input signals, they are normally shown one above the other, as in the two-input AND gate in Figure 8. A B 1 0 1 0 A B Y Y 1 0 Figure 8 Timing diagram for an AND gate 34 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2 D-6 The output of an AND gate is high only when all inputs are high. In other words, if any input is low, the output will be low. Thus, for the set of input signals A and B in Figure 8, the output will be as shown. Figure 9 is another example of a simple timing diagram, this time for a NOR gate. Recall the truth table for a NOR gate: any input high will cause an output low; alternatively, all input lows will cause an output high. Figure 9 Timing diagram for a NOR gate Now do Self-Test 2 and check your answers. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 35

Learning Task 2 D-6 Self-Test 2 1. Draw the standard symbols for the five basic logic gates. 2. Another name for a NOT gate is a(n) gate. 3. In a two-input AND gate, a 1 and a 0 applied to the inputs will produce a output. 4. What input signals must you have in order that the output of a NAND gate is low? 5. In a NOR gate any input gives an output low. 6. Write the Boolean equation for a three-input (A, B, C) OR gate. Let the output be Y. 7. A NAND gate acts like a combination of what two other gates? 8. Signals 1 and 0 applied to inputs A and B respectively of a NOR gate will result in a output. 9. An AND gate behaves like a conventional electric circuit that has switches in: a. series b. parallel 36 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 2 D-6 10. An OR gate behaves like a conventional electric circuit that has switches in: a. series b. parallel 11. In an XOR gate the output will be 1 only when the two inputs are: a. 1 b. 0 c. same d. complementary 12. Write the Boolean expression for an XOR gate having inputs A and B and output Y. 13. Draw the rectangular symbols for: a. a two-input AND logic gate b. a two-input OR logic gate CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 37

Learning Task 2 D-6 14. Draw the output waveform for the AND gate having the inputs shown in Figure 1. 1 0 1 0 A B Y Figure 1 15. Draw the output waveform for the NOR gate having the inputs shown in Figure 2. 1 0 A 1 Y 0 B Figure 2 Go to the Answer Key at the end of the Learning Guide to check your answers. 38 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 3: Describe Boolean algebra Boolean algebra is named after George Boole, a 19th-century mathematician and logician. His work was related to the thought processes and the representation of logical argument by logical algebra. It was not until about 100 years later, however, that his algebra was applied to mechanical and electrical devices. Boolean algebra is a tool to mathematically design, simplify and implement logic circuits. For example, to get a drink from a dispensing machine you can usually pay with a variety of coins. Your drink selection may also include choices of cream and sugar, and so on. To design the circuit board of the dispensing machine, designers can use Boolean expressions to represent the logic-gate circuits. A logic gate is also a two-state variable: inputs and outputs are either high (1) or low (0). In 1938, a professor at the Massachusetts Institute of Technology (MIT) described how Boolean algebra could be used to represent switching circuits that have two distinct states. For example, YES or NO, OFF or ON, NIGHT or DAY, and so on. Boolean algebra and logic-gate circuits If we recall the 2-input AND gate, and use A and B to represent the digital inputs and Y the digital output, the Boolean expression or statement that describes it is A B = Y. Likewise, a 3-input OR gate having inputs A, B and C, and output Y would have the Boolean expression A + B + C = Y. These expressions are written and spoken as follows: Written as: A B = Y spoken as: A and B equals Y Written as: A + B = Y spoken as: A or B equals Y Keep in mind that the logical expressions we use in digital logic make sense only within the concept of Boolean algebra. For example, in Boolean algebra, you may see a statement that says 1 + 1 = 1. Although in conventional mathematics this is wrong, when applied in the context of an OR logic gate, it is perfectly correct (Figure 1). Figure 3 OR gate The 1s represent input highs and the + sign represents an OR gate, and since any input high to this gate will result in an output high, the statement 1 + 1 = 1 is correct in terms of a logic OR gate. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 39

Learning Task 3 D-6 Likewise, another Boolean expression says A + (A B) = A. Although at first it appears to contradict itself, this expression makes sense in terms of the logic gate in Figure 2. Figure 4 Logic-gate circuit The output Y in Figure 2 depends on A only. If A =1, the output at Y will be 1 regardless of whether B is 1 or 0. Likewise, if A = 0, the output at Y will be 0, again regardless of whether B is 0 or 1. Developing the Boolean expression for a logic-gate circuit Consider the logic-gate circuit in Figure 3, where there are two 2-input OR gates supplying a 2-input AND gate. Figure 5 Logic-gate circuit To translate this into a Boolean expression, start at the gate on the far right and work toward the left. In this instance, the gate on the far right is a 2-input AND gate. Let W 1 and W 2 represent the AND gate inputs (Figure 4). Since the AND gate inputs are the same as the OR gate outputs, W 1 = A + B and W 2 = C + D. A B C D W 1 = A + B W 2 = C + D Y = W 1 W 2 Figure 6 Translating into Boolean expression Since A + B = W 1 and C + D = W 2, it follows that Y = (A + B) (C + D). This then is the Boolean expression for the logic-gate circuit illustrated in Figure 12. In words, this Boolean statement is saying You will get an output 1 if either A or B is 1 and either C or D is 1. The ladder diagram equivalent of this logic-gate circuit is shown in Figure 5. 40 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 3 D-6 Figure 7 Ladder diagram equivalent Developing a logic-gate circuit from a Boolean expression To build a logic-gate circuit from a Boolean expression, the process is reversed. For the Boolean expression Y = (A B) + (C D) + (E F), this process is as follows: Step 1: Start by letting A B = W 1, C D = W 2, and E F = W 3. Therefore, Y = W 1 + W 2 + W 3. This represents a 3-input OR gate, as shown in Figure 6. Figure 8 3-input OR logic gate Step 2: Since W 1 = A B, W 1 is the output of an AND gate having inputs A and B. Similarly, W 2 is the output of an AND gate having inputs C and D, and W 3 is the output of an AND gate having inputs E and F. The logic circuit diagram of this expression is shown in Figure 7. Figure 9 Logic-gate circuit of Boolean expression The ladder diagram equivalent of this circuit is shown in Figure 10. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 41

Learning Task 3 D-6 Figure 10 Ladder diagram equivalent Laws of Boolean algebra Boolean algebra has many laws and theorems. Occasionally you may need to refer to the standard table of laws, as listed in Table 9. Table 1: Boolean algebraic laws Rule Boolean expression Comments 1. Idempotent rule A A = A This rule is also called the A + A = A redundancy rule. Constants A 1 = A A 0 = 0 A + 1= 1 A + 0 = A 2. Laws of complementation A A = 0 3. DeMorgan s laws A + A = 1 A = A A B = A + B A + B = A B 4. Commutative law A B = B A A and not A equals 0 A or not A equals 1 Not not A equals A (double complement) A and B not equals not A or not B A or B not equals not A and not B A + B = B+ A 42 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4

Learning Task 3 D-6 5. Distributive laws A ( B+ C) = ( A B) + ( A C) A + ( B C) = ( A + B) ( A + C) 6. Associative laws A ( B C) = C ( A B) A + ( B+ C) = C + ( A + B) 7. Laws of absorption A ( A + B) = A A + ( A B) = A DeMorgan s laws DeMorgan s laws (Table 1, Rule 3) show that logic-gate circuits can be constructed in different ways to achieve the same end result. In other words, this is equivalent to us saying a glass is half empty or a glass is half full. DeMorgan s laws show us the duality of logic expressions and logic-gate circuits. DeMorgan s two laws state: A B = A + B spoken as: Aand Bnot equals not A or not B A + B = A B spoken as: Aor Bnot equalsnot Aand not B DeMorgan s first law Consider the first law, A B = A + B. Since DeMorgan is saying that Y = A B, and also that Y = A + B, then the truth table for each of these expressions must be the same (Figure 9). Examine the variable inputs (1) and (0) in the truth table. Notice that the outputs are the same for each gate, for any pair of inputs. Figure 11 DeMorgan equivalents and truth table The two ladder diagrams in Figure 12 are the equivalent of the two logic circuits in Figure 11. CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4 43

Learning Task 3 D-6 In either of the above ladder diagrams: Figure 12 Ladder diagram equivalents If the inputs to A and B are both low (both push-buttons not activated), the output is energized, or Y = 1. If either A or B is low (only one push-button activated), the output is energized, or Y = 1. If A and B are both high (both push-buttons activated), the output is de-energized, or Y = 0. Thus, both circuits do the same job but in a different way. It is correct to say that one is the DeMorgan equivalent of the other. DeMorgan s second law DeMorgan s second law states that A + B = A B. If we draw each logic gate as in Figure 11, notice that they are the DeMorgan equivalent to one another. Figure 13 Equivalent gates How to DeMorganize To apply DeMorgan s laws (or to DeMorganize ), you must do two things: 16. Change the operator (the gate symbol). For example, change an OR gate to an AND gate. 17. Negate all the gate s inputs and outputs. Note: If any input or output is already negated ( negated means it has a circle), then remove the circle a double negation is equivalent to no negation. If an input or output does not have a circle, you must put a circle on it. 44 CONSTRUCTION ELECTRICIAN APPRENTICESHIP PROGRAM: LEVEL 4