Digital electronics form a class of circuitry where the ability of the electronics to process data is the primary focus.

Similar documents
ECE380 Digital Logic. Axioms of Boolean algebra

Combinational Logic Design Principles

Binary Logic and Gates. Our objective is to learn how to design digital circuits.

CS 226: Digital Logic Design

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Logic Design. Chapter 2: Introduction to Logic Circuits

Chapter 2: Switching Algebra and Logic Circuits

Boolean Algebra and Logic Gates

Boolean Algebra & Logic Gates. By : Ali Mustafa

Binary Logic and Gates

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Chapter 2: Boolean Algebra and Logic Gates

Contents. Chapter 2 Digital Circuits Page 1 of 30

Digital Circuit And Logic Design I. Lecture 3

Chapter 2 Combinational Logic Circuits

Chapter 2 Boolean Algebra and Logic Gates

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

Chapter 2. Boolean Algebra and Logic Gates

EC-121 Digital Logic Design

Chapter 2 Boolean Algebra and Logic Gates

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

control in out in out Figure 1. Binary switch: (a) opened or off; (b) closed or on.

Chapter 2 Boolean Algebra and Logic Gates

Synchronous Sequential Logic

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Chapter 2 Combinational Logic Circuits

WEEK 2.1 BOOLEAN ALGEBRA

Synchronous Sequential Circuit

CS61c: Representations of Combinational Logic Circuits

Chapter-2 BOOLEAN ALGEBRA

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Lecture 21: Boolean Logic. To Wrap up AVR

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

MC9211 Computer Organization

Combinational Logic Fundamentals

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

2. Associative Law: A binary operator * on a set S is said to be associated whenever (A*B)*C = A*(B*C) for all A,B,C S.

Lecture 3: Boolean Algebra

Boolean Algebra and Digital Logic

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Chapter 7 Logic Circuits

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Chapter 2 Combinational Logic Circuits

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Boolean Algebra. Boolean Variables, Functions. NOT operation. AND operation. AND operation (cont). OR operation

Sequential Logic Circuits

Week-I. Combinational Logic & Circuits

Boolean Algebra & Digital Logic

CHAPTER1: Digital Logic Circuits Combination Circuits

CHAPTER 2 BOOLEAN ALGEBRA

Unit 2 Boolean Algebra

ELCT201: DIGITAL LOGIC DESIGN

CHAPTER 12 Boolean Algebra

EEE130 Digital Electronics I Lecture #4

Module - 19 Gated Latches

Unit 2 Boolean Algebra

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Switches: basic element of physical implementations

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Logic and Boolean algebra

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Binary addition example worked out

Chapter 4. Sequential Logic Circuits

Chapter 2 Combinational Logic Circuits

Chapter 2 Boolean Algebra and Logic Gates

1 Boolean Algebra Simplification

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

INTRODUCTION TO INFORMATION & COMMUNICATION TECHNOLOGY LECTURE 8 : WEEK 8 CSC-110-T

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Digital Logic Design. Malik Najmus Siraj

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

CprE 281: Digital Logic

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

CHAPTER III BOOLEAN ALGEBRA

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

Lecture A: Logic Design and Gates

Number System conversions

CHAPTER III BOOLEAN ALGEBRA

Why digital? Overview. Number Systems. Binary to Decimal conversion

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

Digital Systems and Information Part II

. T SHREE MAHAPRABHU PUBLIC SCHOOL & COLLEGE NOTES FOR BOARD EXAMINATION SUBJECT COMPUTER SCIENCE (Code: 083) Boolean Algebra

Lecture 2 Review on Digital Logic (Part 1)

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Fundamentals of Boolean Algebra

Chapter 2 : Boolean Algebra and Logic Gates

EEA051 - Digital Logic 數位邏輯 吳俊興高雄大學資訊工程學系. September 2004

Using the NOT realization from the NAND, we can NOT the output of the NAND gate making it a NOT NOT AND or simply an AND gate.

Boolean Algebra CHAPTER 15

Learning Objectives. Boolean Algebra. In this chapter you will learn about:

Transcription:

Chapter 2 Digital Electronics Objectives 1. Understand the operation of basic digital electronic devices. 2. Understand how to describe circuits which can process digital data. 3. Understand how to design circuits which can process digital data. 4. Understand how simple components can be combined to construct complex systems. Background Digital electronics form a class of circuitry where the ability of the electronics to process data is the primary focus. It differs from what is normally taught as electric circuits, where the focus is on voltages and currents, to a focus upon information. When dealing with digital devices we are more concerned with broad characterizations such as whether a voltage is zero, or not zero. B. YOSHIDA, P.ENG 2017 V1.0.04 2-1

It is a simplification where we will limit any values to a small set of possibilities. Basics of Digital Electronics To start off, we can limit the number of possible discrete values to two. This will allow us to simplify our designs to the point where we can consider the idea of having two voltages, say a nonzero voltage and a ground (zero voltage). With only two discrete values, we can design systems which can use a binary logic representation, i.e. quantities can be described by two symbols: 1 or 0; YES or NO; TRUE or FALSE; etc. The term binary logic stems from the fact that these concepts were originally developed in the nineteenth century to describe the logical thought processes a person uses when reasoning true/ false type problems. B. YOSHIDA, P.ENG 2017 V1.0.04 2-2

Note that it is extremely important to realize that when we use the symbols 1 and 0 to represent the two values, we are not using the 1 and 0 as numbers or numerical values. The simplest binary circuit element is a switch that has two states. State 0 (x=0) State 1 (x=1) This switch can be used in simple circuits which we can describe in terms of binary logic functions. x=0 x=1 + + Describing a switch in terms of a binary description we can say: when the switch is open it is in state 0, and when it is closed is in state 1. The output of the circuit is the state of the light which we can call L, if the light is B. YOSHIDA, P.ENG 2017 V1.0.04 2-3

on we will say that L=1, if the light is off, we will say that L= 0. As a result we can describe the state of the light L as a function of the input variable x. L=f(x) = x By using this type of logic expression we have a concise method of describing the function we are trying to have the circuit perform. To make these logic expressions more useful, we can define some functional operators. Like the mathematical operators available in standard arithmetic (addition, subtraction, division, and multiplication), these logic function operators describe operations we can perform on our binary data. Consider using two switches to control the state of the light using a series connection for the two switches. The light will turn on only if both switches are closed. B. YOSHIDA, P.ENG 2017 V1.0.04 2-4

x=0 y=0 x=1 y=1 + + where L = 1 if x = 1 AND y = 1; L = 0 otherwise. We can introduce a logical operator which represents this concept of AND. The symbol can be used to represent the logical AND operation. L=f(x,y) = x y = x AND y If two switches are connected in parallel the light will be on if one, or both, of the switches are closed. B. YOSHIDA, P.ENG 2017 V1.0.04 2-5

x=0 x=0 y=0 y=1 + + where L = 1 if x = 1, OR y = 1, OR if x = y = 1; L = 0 if x = y = 0 The + symbol can be used to represent this logical OR operation: L=f(x,y) = x+y = x OR y Note that it is important to keep in mind that even though the and + are the same symbols used to represent multiplication and addition in normal arithmetic we are using them to represent the concepts of logical AND and logical OR. In the context of describing logical functions is important not to refer to them as x times y, or x plus y. This is because within a digital system it is also possible to perform multiplication and addition on data represented a digital form. Therefore saying x times y has a completely different B. YOSHIDA, P.ENG 2017 V1.0.04 2-6

meaning to saying x AND y when describing a logic function. To emphasize the idea that one symbol can have multiple meanings depending on context consider the following. 4x4 You might think I am referring to a fence post; You might think I am referring to a four wheel drive vehicle. You might think I am referring to the number 16; All valid possibilities, unless you went to the lumberyard or a car dealership and asked to buy a 16 where it would be meaningless. For a final operator, consider a circuit which will generate an output when a switch is opened. + x=1 + x=0 where L = 1 if x = 0; L = 0 if x = 1 B. YOSHIDA, P.ENG 2017 V1.0.04 2-7

In this circuit we say that L is the inverse, or complement, of x. This operation is frequently referred to as the NOT operation. There are several commonly used notations for indicating the complement operation: x = x' =!x = NOT(x) The AND, OR, and NOT functions are the three most important logic functions we will use. They can be used as building blocks for the implementation of all logic circuits. The AND and OR functions themselves are not limited to two inputs but can be extended to n variables. Digital Devices Each logic operation is available as a circuit element called a logic gate. The circuit symbols for the gates: x y f=x y x y f=x+y x f=x B. YOSHIDA, P.ENG 2017 V1.0.04 2-8

The term gate is derived from the fact that the devices are used to control the flow of information. Logic gates, like any other electrical component, are governed by standard circuit analysis laws and have parameters involving voltage and current. Internally the AND gate behaves like the following circuit: 5V x f=x y y The key points to note: The gate is an active device, and therefore it needs to be connected to an external power source the 5 V at the top and ground at the bottom. The connections at x and y are not electrically connected to the output f. Therefore, the current and B. YOSHIDA, P.ENG 2017 V1.0.04 2-9

voltage at the output are sourced only from the external power supply which is supplying power to the gate. The inputs x and y are controlling the state of the two internal switches. There should be no current flowing into either x or y. However, current can flow out from the output and be used to drive an external device such as an LED. There needs to be a definite 0 or 1 applied to both of the inputs. Not connecting anything, neither 0 nor 1, will result in the internal circuitry not be able to determine if the switch should be open or closed and it may assume one of the two states. In other words, applying nothing at the inputs may result in the output being 0 or 1 it is not being controlled by the inputs. The internal structure of the other gates is similar to the above AND gate and the same considerations apply. B. YOSHIDA, P.ENG 2017 V1.0.04 2-10

Truth tables An alternative method to describe the operations of a logic circuit is to use a truth table which lists all the possible combinations of the input variables and shows the relationship between the input variables and the resulting output. Example: describe the AND and OR functions using a truth table. Inputs Output x y f1=x y f2=x+y Note that truth tables are only suitable to describe circuits with a small number of inputs since they grow exponentially in size with the number of input variables. B. YOSHIDA, P.ENG 2017 V1.0.04 2-11

Additional useful basic digital devices An additional device to consider is a device known as a buffer which is a logic gate with one input x, and one output, f, which implements the function f=x. The simplest implementation of a buffer uses two inverters in series. How this is different from a piece of wire? x f=x? = x f=x The buffer has the characteristics of any other logic device. No current flowing into the input x, and any current flowing out of the output will be sourced by the power supply providing power to the buffer and are used in applications requiring large amounts of power. A variation on the standard buffer is what is known as a tri-state buffer. B. YOSHIDA, P.ENG 2017 V1.0.04 2-12

e e=0 e=1 x f(e,x) x f=z = OR x f=x e x f 0 0 Z 0 1 Z 1 0 0 1 1 1 Question: So how does this third state help us? Consider the following circuit. x1 s f x2 In this circuit, the outputs of the two tri-state buffers are wired together. Without the tri-state buffers this could be disastrous to allow both buffers to be active. This could create a short circuit between power supply powering B. YOSHIDA, P.ENG 2017 V1.0.04 2-13

the tri-state buffers and ground. If this were to occur, the circuit could burn out. Example: describe this circuit using a truth table. s x1 x2 f Question: Why not connect the e inputs to 1 and the output of the tri-states to the inputs of an OR gate? Analysis and synthesis of logic circuits We now have the basic building blocks, and we can start working with some actual circuits. B. YOSHIDA, P.ENG 2017 V1.0.04 2-14

Example: analyze the following circuit to determine its functional behaviour. x A f(x,y) y B Example: synthesize a circuit that has two input switches, x and y where the required functional behaviour of the circuit is that the output must be equal to 0 if the switch x is closed and y is open; otherwise the output must be 1. x y f(x,y)=x y + x y + x y B. YOSHIDA, P.ENG 2017 V1.0.04 2-15

In general, any logic function can be implemented by using an AND term for each row of the truth table for which the function is equal to 1. The ORing together of these AND terms realizes the function. Compare the truth tables for previous two examples. Notice that each circuit generates the same output for a given input, in each case the only time the output is zero is if x=1 AND y=0. However, both the circuits and the functional expressions describing their operations, are completely different. Since the truth table provides a complete description for each example, and the two truth tables are identical, the two circuits must be equivalent. Therefore, there must be a method to manipulate the functional expressions to prove that they are equal. Boolean Algebra In 1849, G. Boole published a scheme for the algebraic description of the processes involved in logical thought B. YOSHIDA, P.ENG 2017 V1.0.04 2-16

and reasoning which became known as Boolean algebra. In 1938, C. Shannon showed that Boolean algebra provides an effective means of describing logic circuits. Boolean algebra is based upon a small number of assumptions, referred to as axioms, from which the theorems which govern Boolean operations are constructed. The axioms of Boolean algebra assume that Boolean algebra involves elements that can take on only one of two values, 0 or 1. Axioms of Boolean algebra 1a 0 0=0 1b 1+1=1 2a 1 1=1 2b 0+0=0 3a 0 1=1 0=0 3b 1+0=0+1=1 4a if x=0, then x =1 4b if x=1, then x =0 From these axioms we can develop the single-variable theorems of Boolean algebra which define some rules for dealing with single variables equations: Single variable theorems of Boolean algebra 5a x 0=0 5b x+1=1 6a x 1=x 6b x+0=x 7a x x=x 7b x+x=x B. YOSHIDA, P.ENG 2017 V1.0.04 2-17

Single variable theorems of Boolean algebra 8a x x =0 8b x+x =1 9 (x ) =x Notice that the axioms and theorems are provided in related pairs. Each expression is related to its pair via the principal of duality which allows the dual of an expression to be obtained by replacing all + operators with operators, and vice versa, and by replacing all 0s with 1s, and vice versa. The single variable theorems can be further expanded into two and three variable properties (identities). Identities of Boolean algebra 10a x y=y x 10b x+y=y+x Commutative 11a x (y z)=(x y) z 11b x+(y+z)=(x+y)+z Associative 12a x (y+z)=x y+x z 12b x+(y z)=(x+y) (x+z) Distributive 13a x+x y=x 13b x (x+y)=x Absorption 14a x y+x y =x 14b (x+y) (x+y )=x Combining 15a (x y) =x +y 15b (x+y) =x y DeMorgan s 16a x+(x y)=x+y 16b x (x +y)=x y B. YOSHIDA, P.ENG 2017 V1.0.04 2-18

Example: verify DeMorgan's law (15b) by induction. DeMorgan's theorem is a useful tool to use when simplifying Boolean expressions and can also be extended to three or more variables: x 1 + x 2 + + x n = x 1 x 2 x n x 1 x 2 x n = x 1 + x 2 + + x n The OR and AND operations are often referred to as the logical sum and logical product operations. We can say that the following expression is a logical sum of three product terms. f = x 1 x 2 +(x 2 x 3 )+ x 4 Note than when applying the theorems of Boolean algebra that, like traditional mathematic operators, there is order of operator precedence in Boolean algebra: parentheses; NOT; AND; OR. B. YOSHIDA, P.ENG 2017 V1.0.04 2-19

Example: using Boolean algebra show that the functional expressions from the previous examples are equal. There are multiple different networks that can realize a given function. A designer of logic circuits is always confronted with the same basic issues: Specifying the desired behaviour of the circuit; simplifying, synthesizing and implementing the circuit; and testing the circuit to verify that it meets the specifications at the lowest cost. Example: In computer systems it is often necessary to choose data from exactly one of a number of possible sources. Suppose that there are two sources of data, provided as input signals x and y. The values of these sources change at regular intervals. Thus there will be a stream of 0s and 1s applied on each of the inputs x and y. We want to design a circuit that produces an output that has the same value as either x or y, depending on the value of a selection control signal s. Therefore the circuit has three inputs x, y, and s. Assume that the B. YOSHIDA, P.ENG 2017 V1.0.04 2-20

output of the circuit will be the same as the value of input x if s=0 and it will be the same as y if s=1. A method is required by which we can evaluate a resulting circuit. If we assume that the primary inputs are available in both uncomplemented and complemented forms, we can define the term cost = number of gates + the number of inputs to those gates + the number of different types of gates. Example: calculate and compare the cost for the circuits in the first two examples. Flip-flops Up to this point we have only considered what are known as combinational circuits. Combinational circuits are those circuits whose output, at any instant of time, is only dependent upon the inputs to the circuit at that specific time. B. YOSHIDA, P.ENG 2017 V1.0.04 2-21

We can expand the capabilities of a digital circuit by introducing the concept of sequential circuits. Sequential circuits extend the capabilities of our systems by including the past behaviour of the circuit with its present behaviour. Sequential circuits consist of a combinational circuit (present behaviour) to which memory elements (past behaviour) are connected via a feedback path. Input Cominational Logic Memory Cominational Logic Output The information stored in the memory elements at any given time is defined as the state of the circuit. An example of how this type of circuit functions can be illustrated by considering the operation of a very simple digital combination lock. B. YOSHIDA, P.ENG 2017 V1.0.04 2-22

To implement a sequential circuit we need to use some type of memory element. A simple memory element can be constructed from two inverters. Input / Output This circuit uses a single point which acts as both the input and the output. For the circuit to store a value, for example a 1, while the switch is open you apply a 1 to the input. The top inverter will generate a 0 at its output which will be inverted by the bottom inverter which will output a 1. At this point the switch can be closed and the bottom inverter can provide the input to the top inverter, and the original input signal which we were trying to store can be removed. The problem with this circuit is that there is no way for the information to be changed without manual intervention. B. YOSHIDA, P.ENG 2017 V1.0.04 2-23

A solution to this problem is to use standard logic gates to construct a circuit called a latch. Operation of a Basic Latch as a Function of Time R S Q Time x y x+y (x+y) 0 0 0 Q 0 1 1 1 1 1 1 1 0 0 0 1 (Start up) Q 0 0 0 0 0 0 0 0 1 1 0 unstable stable 1 0 1 0 1 0 1 Q 1 0 0 0 0 0 0 1 1 1 0 Reset Q Q 0 1 1 1 1 1 1 unstable stable R 0 1 0 Q 0 1 1 1 1 1 1 Q Set Q Q 1 0 0 0 0 0 0 unstable stable 1 1 1 Q 1 0 0 0 0 0 0 0 Q 0 0 0 0 0 0 0 S Q unstable not a valid output 1 1 0 Q 0 0 0 0 0 0 0 Q 1 0 0 0 0 0 0 0 unstable not a valid output Some additional gates can be added to simplify the operation of the circuit, so rather than requiring two B. YOSHIDA, P.ENG 2017 V1.0.04 2-24

inputs (R and S), a single input D is used to provide the data value: Q D (Data) Q Clk If we examine the circuit we can see that the progress of the value presented at the D input will be controlled by the Clock (Clk) input. If a 1 is applied to the Clk input any value presented at the D input will proceed to the two interconnected OR gates. Due to the feedback nature of the OR gate connections, one of the outputs, Q or Q, will always be a 1. Exactly which output will be a 1 is under the control of the D input. If we consider Q to be the output and Q to be the output inverted, the circuit has the following behaviour: B. YOSHIDA, P.ENG 2017 V1.0.04 2-25

Inputs Outputs Clk D Q Q 0 0 No change No change 0 1 No change No change 1 0 0 1 1 1 1 0 If the Q output equals 1, the circuit in the set state. If output Q equals 0 the circuit is in the clear state. Also note that the output follows the D input as long as the Clk pulse remains a 1. When the Clk pulse goes to 0, the last value present at the data input is retained at the Q output. This can present a problem if the data is noisy or unstable since we cannot be sure of the final value at the input before the Clk signal is removed. An important variation to the basic latch involves some additional logic gates which modify the circuit such that the latch will only store data on the transition of the clock signal. This is known as edge triggering, which is indicated by the triangle symbol. An edge triggered latch is referred to as a flip-flop B. YOSHIDA, P.ENG 2017 V1.0.04 2-26

D Q Clk Q The operation is analogous to a camera shutter capturing an image of a quickly moving object at a single instant in time which may be missed by your eye which is capturing continuously but may miss the object. We will take advantage of flip-flops in circuits as we develop more complex digital systems in subsequent chapters. Conclusion This chapter provided an introduction to basic digital circuit concepts and how they can be applied. Upon completing this chapter you should have mastered the following learning objectives: 1. Understand the basic circuit elements, used in digital circuits. B. YOSHIDA, P.ENG 2017 V1.0.04 2-27

2. Be able to describe the function of a given combinational circuit. 3. Be able to design simplified combinational circuits. B. YOSHIDA, P.ENG 2017 V1.0.04 2-28