Boolean algebra lecture notes, Lecture notes of Computer science

A handbook which covers fundamental notions in logic circuits

Typology: Lecture notes

2020/2021

Uploaded on 04/17/2021

destinho-ekome
destinho-ekome 🇨🇲

1 document

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMPS375 Class Notes (Chap03) Page 1 / 28 Dr. Kuo-pao Yang
CHAPTER 3
Boolean Algebra and Digital Logic
3.1 Introduction 137
3.2 Boolean Algebra 138
3.2.1 Boolean Expressions 139
3.2.2 Boolean Identities 140
3.2.3 Simplification of Boolean Expressions 142
3.2.4 Complements 144
3.2.5 Representing Boolean Functions 145
3.3 Logic Gates 147
3.3.1 Symbols for Logic Gates 147
3.3.2 Universal Gates 148
3.3.3 Multiple Input Gates 149
3.4 Digital Components 150
3.4.1 Digital Circuits and Their Relationship to Boolean Algebra 150
3.4.2 Integrated Circuits 151
3.4.3 Putting It All Together: From Problem Description to Circuit 153
3.5 Combinational Circuits 155
3.5.1 Basic Concepts 155
3.5.2 Examples of Typical Combinational Circuits 155
3.6 Sequential Circuits 162
3.6.1 Basic Concepts 163
3.6.2 Clocks 163
3.6.3 Flip-Flops 163
3.6.4 Finite State Machines 167
3.6.5 Examples of Sequential Circuits 173
3.6.6 An Application of Sequential Logic: Convolutional Coding and Viterbi
Detection 178
3.7 Designing Circuits 184
Chapter Summary 185
Focus on Karnaugh Maps 199
3A.1 Introduction 199
3A.2 Description of Kmaps and Terminology 199
3A.3 Kmap Simplification for Two Variables 201
3A.4 Kmap Simplification for Three Variables 202
3A.5 Kmap Simplification for Four Variables 205
3A.6 Don’t Care Conditions 208
3A.7 Summary 209
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Boolean algebra lecture notes and more Lecture notes Computer science in PDF only on Docsity!

Boolean Algebra and Digital Logic

 - CHAPTER 
  • 3.1 Introduction
  • 3.2 Boolean Algebra
    • 3.2.1 Boolean Expressions
    • 3.2.2 Boolean Identities
    • 3.2.3 Simplification of Boolean Expressions
    • 3.2.4 Complements
    • 3.2.5 Representing Boolean Functions
  • 3.3 Logic Gates
    • 3.3.1 Symbols for Logic Gates
    • 3.3.2 Universal Gates
    • 3.3.3 Multiple Input Gates
  • 3.4 Digital Components
    • 3.4.1 Digital Circuits and Their Relationship to Boolean Algebra
    • 3.4.2 Integrated Circuits
    • 3.4.3 Putting It All Together: From Problem Description to Circuit
  • 3.5 Combinational Circuits
    • 3.5.1 Basic Concepts
    • 3.5.2 Examples of Typical Combinational Circuits
  • 3.6 Sequential Circuits
    • 3.6.1 Basic Concepts
    • 3.6.2 Clocks
    • 3.6.3 Flip-Flops
    • 3.6.4 Finite State Machines
    • 3.6.5 Examples of Sequential Circuits
    • Detection 3.6.6 An Application of Sequential Logic: Convolutional Coding and Viterbi
  • 3.7 Designing Circuits
  • Chapter Summary
  • Focus on Karnaugh Maps
    • 3A.1 Introduction
    • 3A.2 Description of Kmaps and Terminology
    • 3A.3 Kmap Simplification for Two Variables
    • 3A.4 Kmap Simplification for Three Variables
    • 3A.5 Kmap Simplification for Four Variables
    • 3A.6 Don’t Care Conditions
    • 3A.7 Summary

3.1 Introduction 137

 In 1854 George Boole introduced a systematic treatment of logic and developed for this purpose an algebraic system known as symbolic logic, or Boolean algebra.  Boolean algebra is a branch of mathematics and it can be used to describe the manipulation and processing of binary information. The two-valued Boolean algebra has important application in the design of modern computing systems.  This chapter contains a brief introduction the basics of logic design. It provides minimal coverage of Boolean algebra and this algebra’s relationship to logic gates and basic digital circuit.

3.2 Boolean Algebra 138

 Boolean algebra is algebra for the manipulation of objects that can take on only two values, typically true and false.  It is common to interpret the digital value 0 as false and the digital value 1 as true.

3.2.1 Boolean Expressions 139

 Boolean Expression: Combining the variables and operation yields Boolean expressions.  Boolean Function: A Boolean function typically has one or more input values and yields a result , based on these input value, in the range {0, 1}.  A Boolean operator can be completely described using a table that list inputs, all possible values for these inputs, and the resulting values of the operation.  A truth table shows the relationship , in tabular form, between the input values and the result of a specific Boolean operator or function on the input variables.  The AND operator is also known as a Boolean product. The Boolean expression xy is equivalent to the expression x * y and is read “x and y.” The behavior of this operator is characterized by the truth table shown in Table 3.

TABLE 3.1 The Truth Table for AND

3.2.2 Boolean Identities 140

 Boolean expression can be simplified, but we need new identities , or laws , that apply to Boolean algebra instead of regular algebra.

TABLE 3.5 Basic Identities of Boolean Algebra

DeMorgan’s law provides an easy way of finding the complement of a Boolean function.

TABLE 3.6 Truth Tables for the AND Form of DeMorgan’s Law

3.2.3 Simplification of Boolean Expressions 142

 The algebraic identities we studied in algebra class allow us to reduce algebraic expression to their simplest form.  EXAMPLE 3.  EXAMPLE 3.  How did we know to insert additional terms to simplify the function? Unfortunately, there no defined set of rules for using these identities to minimize a Boolean expression: it is simply something tat comes with experience.  To prove the equality of two Boolean expressions, you can also create the truth tables for each and compare. If the truth tables are identical , the expressions are equal.

Example using Identities

3.2.4 Complements 144

 F(x, y, z) = x’ + yz’ and its complement, F’(x, y, z) = x(y’ + z)

TABLE 3.7 Truth Table Representation for a Function and Its Complement

3.3 Logic Gates 147

 We see that Boolean functions are implemented in digital computer circuits called gates.  A gate is an electronic device that produces a result based on two or more input values. o In reality, gates consist of one to six transistors , but digital designers think of them as a single unit. o Integrated circuits contain collections of gates suited to a particular purpose.

3.3.1 Symbols for Logic Gates 147

 The three simplest gates are the AND, OR, and NOT gates.

FIGURE 3.1 The Three Basic Gates

 Another very useful gate is the exclusive OR (XOR) gate.  The output of the XOR operation is true only when the values of the inputs differ.

FIGURE 3.2 The exclusive OR (XOR) Gate

3.3.2 Universal Gates 148

 Two other common gates are NAND and NOR, which produce complementary output to AND and OR.

FIGURE 3.3 and 3.4 The Truth Table and Logic Symbols for NAND and NOR Gates

 NAND and NOR are known as universal gates because they are inexpensive to manufacture and any Boolean function can be constructed using only NAND or only NOR gates.

FIGURE 3.5 Three Circuits Constructed Using Only NAND Gates

3.3.3 Multiple Input Gates 149

 Gates can have multiple inputs and more than one output.

FIGURE 3.6, 3.7, and 3.

 Example: o The Boolean circuit: F(x, y, z) = x’y

o Can be rendered using only NAND gates as:

o So we can wire the pre-packaged circuit to implement our function: F(x, y, z) = x’y

3.4.3 Putting It All Together: From Problem Description to Circuit 153

 Boolean logic is used to solve practical problems.  Expressed in terms of Boolean logic practical problems can be expressed by truth tables.  Truth tables can be readily rendered into Boolean logic circuits.  Example 3. o Suppose we are to design a logic circuit to determine the best time to plant a garden. We consider three factors (inputs):  (1) Time, where 0 represents day and 1 represents evening;  (2) Moon phase, where 0 represents not full and 1 represents full; and  (3) Temperature, where 0 represents 45°F and below, and 1 represents over 45°F.  We determine that the best time to plant a garden is during the evening with a full moon. o This results in the following truth table:

o From the truth table, we derive the circuit:

FIGURE 3.13 The Logic Diagram for a Ripple-Carry Adder

 Decoder: Decoding binary information from a set of n inputs to a maximum of 2 n outputs.  A decoder uses the inputs and their respective values to select one specific output line.  One unique output line is set to 1 , while the other output lines are set to 0.  A decoder that has 3 inputs and 8 outputs is called a 3-to-8 decoder.

FIGURE 3.14 a) A Look Inside a Decoder; b) A Decoder Symbol

 EXAMPLE 3.13 A 3-to-8 decoder circuit o Imagine memory consisting of 8 chips , each containing 8K bytes. o We have a total of 8K * 8, or 64K (65,536) address available. o We need 16 bits to represent each address. o The leftmost 3 bits determine on which chip the address is actually located. All addresses on chip 0 have the format: 000 X XXXX XXXX XXXX: Because chip 0 contains the address 0-8191. Similarly, all addresses on the chip 1 have the format: 001 X XXXX XXXX XXXX. o The 3 high-order bits are actually used as the inputs to a decoder so the computer can determine which chip to activate for reading or writing. o The output of the decoder is used to activate one, and only on , chip as the addresses are decoded.

 The Multiplexer circuits binary information from one of many input lines and directs it to a single output line.  Only one input (the one selected) is routed through the circuit to output line. All other inputs are “ cut off .”  Can you think of some situations that require multiplexers? Time-sharing computers multiplex the input from user terminals. Modem pools multiplex the modem lines entering the computer.

FIGURE 3.15 a) A Look Inside a Multiplexer; b) A Multiplexer Symbol

 A parity generator is a circuit that creates the necessary parity bit to add to a word.  A parity checker checks to make sure proper parity (odd or even) is present in the word.  Typically, parity generators and parity checkers are constructed using XOR functions. Assuming we are using odd parity, the truth table for a parity generator for a 3-bit word is given in Table 3.11.  The parity checker outputs a 1 if an error is detected and 0 otherwise.

Table 3.10 Parity Generator Table 3.11 Parity Checker

 Figure 3.17 illustrates a very simple ALU with four basic operations – AND, OR, NOT , and addition – carried out on two machine words of 2 bits each.  The control lines, f 0 , and f 1 , determine which operation is to be performed by the CPU.  The signal 00 is used for addition (A + B); 01 for NOT A; 10 for A OR B, and 11 for A AND B.  The input lines A 0 and A 1 indicate 2 bits of one word, while B 0 and B 1 indicate the second word, C 0 and C 1 represent the output lines.

FIGURE 3.17 A Simple Two-Bit ALU

3.6 Sequential Circuits 162

 The major weakness of combinational circuits is that there is no concept of storage – they are memoryless. If we change an input value, this has a direct and immediate impact on the value of the output.

3.6.1 Basic Concepts 163

 A sequential circuit defines its output as a function of both its current inputs and its previous inputs. Therefore, the output depends on past inputs.  We typically refer to this storage element as a flip-flop.  Combinational circuits are generalizations of gates; sequential circuits are generalizations of flip-flops.

3.6.2 Clocks 163

 A sequential circuit uses past inputs to determine present outputs indicates we must have event ordering.  A clock is a circuit that emits a series of pulses with a precise pulse width and a precise interval between consecutive pulses.  This interval is called the clock cycle time. Clock speed is generally measured in megahertz (MHz), or millions of pulse per second.  A clock is used by a sequential circuit to decide when to update the state of the circuit.  Most sequential circuits are edge-triggered (as opposed to being level-triggered). It means they are allowed to change their state on either the rising or falling edge of the clock signal.

FIGURE 3.18 A clock Signal Indicating Discrete Instances of Time

 The SR flip-flop actually has three inputs: S, R, and its current output, Q.

TABLE 3.12 Truth Table for SR Flip-Flop

 A JK flip-flop simply modify the SR flip-flop to ensure that the illegal state (both S and R are 1) never arises.  The inputs to an SR flip-flop will never both be 1  We will never have an unstable circuit.

FIGURE 3.22 a) A JK Flip-Flop; b) The JK Characteristic Table c) A JK Flip-Flop as a Modified SR Flip-Flop

 A D flip-flop is a true representation of physical computer memory.  An output value of 1 means the circuit is currently “ storing ” a value of 1.

FIGURE 3.23 a) A D Flip-Flop; b) The D Characteristic Table c) A D Flip-Flop as a Modified SR Flip-Flop

3.6.5 Examples of Sequential Circuits 173

 The registers must all accept their new input values and change their storage elements at the same time.

FIGURE 3.30 a) A 4-Bit Register; b) A Block Diagram for a 4-Bit Register

 If we begin counting in binary: 0000, 0001, 0010, 0011, ..., 1111, we can see that as the numbers increase, the low-order bit is complemented each time.  When J and K are both equal to 1, the flip-flop complements the present state.  The circuit counts only when the clock pulses and this count enable line is set to 1.

FIGURE 3.31 A 4-Bit Synchronous Counter Using JK Flip-Flops