# Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits

Size: px
Start display at page:

Transcription

1 Software Engineering 2DA4 Slides 2: Introduction to Logic Circuits Dr. Ryan Leduc Department of Computing and Software McMaster University Material based on S. Brown and Z. Vranesic, Fundamentals of Digital Logic with Verilog Design, 3rd Ed. c R.J. Leduc, M. Lawford 1

2 Variables and Functions Basic unit of a circuit is a switch. Can be closed (conducts electricity) or open (doesn t conduct). Given switch is controlled by input variable x. c R.J. Leduc, M. Lawford 2

3 Light controlled by Switch We design circuits to implement logic functions. We combine basic circuits to create more complicated circuits to implement useful logic functions. We can represent the light as logic function L(x) = x, where light is on when L(x) = 1. Represeting the light s state as a function of input x allows us to determine if the light is on based on the current value of x. c R.J. Leduc, M. Lawford 3

4 Logical AND and OR Functions Here we see two basic building blocks of larger circuits. We write the logical AND function as L(x 1,x 2 ) = x 1 x 2 or L(x 1,x 2 ) = x 1 x 2 if meaning clear. We write the logical OR function as L(x 1,x 2 ) = x 1 +x 2 c R.J. Leduc, M. Lawford 4

5 Combined Circuit Here we combine an AND and OR structure to create a more complicated function. Curcuit implements logical function L(x 1,x 2,x 3 ) = (x 1 +x 2 )x 3 c R.J. Leduc, M. Lawford 5

6 Inverting Circuit Here we see the last basic logic function, NOT. For NOT, the output function is the logical negation or the complement of the input variable. Circuit implements logical function L(x) = x =!x c R.J. Leduc, M. Lawford 6

7 Truth Tables Truth Tables are common ways to represent logic functions. Any logic function can be completely specified by listing all possible input combinations (valuations) to the left of divider, and the desired value of the function for that input combination on the right. Not efficient representation as n variables will have 2 n possible valuations. i.e = 1024 rows! c R.J. Leduc, M. Lawford 7

8 The Basic Gates The AND, OR, and NOT logic functions can be implemented electronically using transistors. We refer to these circuit elements as logic gates, and use the symbols below to represent them. c R.J. Leduc, M. Lawford 8

9 Circuits and Networks A logic circuit or network is a collection of gates connected to implement a logic function. i.e. the actual items A schematic is a drawing of a logic circuit. c R.J. Leduc, M. Lawford 9

10 Precedence of Operations Operations in a logic expression must be performed in the order: NOT, AND, OR. eg. x 1 x 2 +x 1 x 2 = (x 1 x 2 )+((x 1 ) x 2 ) If you wish a different order, you must use parentheses. eg. x 1 (x 2 +(x 1 )) x 2 The two logical expressions above do not implement the same logic function (consider input valuation x 1 = 0 and x 2 = 1). c R.J. Leduc, M. Lawford 10

11 Information for Lab 1 For information about the DE2 alterra boards used in the lab, refer to DE2 User manual that accompanies the boards and is also available as a PDF from the URL: DE2 UserManual.pdf Pg. 4: Refer to board layout to find switches and LEDs etc. Pg : Board contains 18 toggle switches (SW[0] to SW[17]). When the switch is set to its DOWN position (closest to the board edge), you get a logic low (0). The UP position gives logic high (1). Table 4.1 shows how each switch maps to a pin on the Cyclone II FPGA chip. c R.J. Leduc, M. Lawford 11

12 Information for Lab 1 - II Pg : Board contains 18 red LED lights. Each is connected to a pin on the FPGA (see Table 4.3). Driving the associated pin to a high logic level turns the LED on, and a low logic level turns it off. For step 4 of part 3 of lab, assign inputs of circuit to the pins matching the switches. ie. for x 1 assigned to SW[0], you would map signal x 1 to pin N25 of the FPGA. Assign outputs to the red LEDs. ie. for f assigned to LEDR[0], you would map f to pin AE23. NOTE: Will not always be able to cover information for lab beforehand. You will sometimes have to read ahead on own. Only so many lab periods. Lectures can t always keep up. c R.J. Leduc, M. Lawford 12

13 CAD Introduction Computer Aided Design (CAD) systems have tools for the following tasks: Design entry Synthesis and optimization Simulation Physical design c R.J. Leduc, M. Lawford 13

14 Design Entry Methods Truth table as text file or waveforms. Schematic Capture. Hardware Description Language (HDL). Two IEEE standards: Very high speed integrated Circuit HDL (VHDL) Verilog HDL c R.J. Leduc, M. Lawford 14

15 Truth Table as Waveform Example uses waveform editor to specify truth table. Input signals are x 1 and x 2, and ouput is f. To specify circuit, designer must specify all possible input combinations and desired value of ouput for each. c R.J. Leduc, M. Lawford 15

16 Schematic Editor In a schematic editor, gates are shown as symbols, and lines show connections. Input and output signals to circuit are shown as arrows. Schematic editors used to be most common way to design circuits, but now largely replaced by HDL. c R.J. Leduc, M. Lawford 16

17 HDL Replaces schematic capture as standard entry method. More portable, and easier to script and scale. Similar to a sequential programming language, but describes layout and logic functions of hardware. Unless specified otherwise, everything occurs in parallel. Signals in circuits are represented as variables. Logic functions expressed by assigning values to variables. Will focus on Verilog. c R.J. Leduc, M. Lawford 17

18 Synthesis and Optimization Action of generating set of logic equations to represent circuit from truth tables or HDL code. Equations are automatically optimized to produce a better yet still equivalent circuit. Maps equations to actual technology used (in our case, the altera chips) for implementation. Process called technology mapping and physical design. c R.J. Leduc, M. Lawford 18

19 Functional Simulation Purpose to verify circuit implements specfication correctly. Accepts specified sequence of input values created using the waveform editor. Evaluates outputs of circuits using logic equations from synthesis and input sequences and displays result as a waveform. Does not use timing information. Using timing information requires selecting an implementation technology. Called a timing simulation. c R.J. Leduc, M. Lawford 19

20 First Stages of CAD System c R.J. Leduc, M. Lawford 20

21 Verilog Introduction For reference, see Section 2.10 and Appendix A (A.1-A.10,A.15). Verilog can be used to describe a circuit, and then CAD tools can synthesize the code into a hardware implementation. Important to not write Verilog code that resembles a computer program (i.e. containing many variables and loops). You want to write Verilog code so that it is obvious what circuit the code represents. Verilog syntax is similar to that of the C programming language. Single line comments begin with // and multi-line comments begin with /* and end with */. c R.J. Leduc, M. Lawford 21

22 Identifiers Identifiers are names of variables and other items. Identifiers can contain letters, digits, and the and \$ characters. Identifiers can not begin with a digit and can not be Verilog Keywords. Verilog is case sensitive so BYTE and Byte are not the same name. c R.J. Leduc, M. Lawford 22

23 Signals Signals in a circuit are represented in Verilog as either a net or variable. A net represents a node (a point where two or more elements interconnect) in the circuit and lets one describe a circuit s interconnection, but not its behavior. A variable allows us to describe a circuit s behavior, and can be of type reg or integer. A net can be of type wire or tri. Type wire is a normal wire connection, and type tri is a special tri-state connection that we will discuss in Chapter 3. c R.J. Leduc, M. Lawford 23

24 Signals - II Signal x and y below are a scalar net definition. wire x,y; S and P are vector definitions, where range [R a : R b ] defines the value of the most-significant (leftmost) bit (R a ) of the vector, and R b defines the least-significant (rightmost) bit. wire [3:0] S; wire [1:2] P; For example, if S was assigned the binary constant 0011, then S[3] = 0, S[2] = 0, S[1] = 1, and S[0] = 1. c R.J. Leduc, M. Lawford 24

25 Signal Values and Constants A signal can take on four possible values: 0 = logical value 0 1 = logical value 1 z = tri-state (high impedance) x = unknown value A constant (ie. b10, 10, 4 b110) is defined in the form below, where square brackets represent optional parameters. [size][ radix]constant Here, size is number of bits in constant and zeros are usually added (unless x or z is leftmost bit) to left if needed. Radix is the number base such as (d = decimal - the default), (b = binary), (h = hexadecimal), and (o = octal). c R.J. Leduc, M. Lawford 25

26 Verilog Circuit Representation Verilog allows one to define a circuit using either a structural representation or a behavioral representation. A structural representation is when one describes a circuit using constructs that describe individual logic gates and transistors and how they are connected. A behavioral representation uses logic expressions and programming constructs to describe how the circuit should operate, but not necessarily its structure in terms of gates and how they are connected. c R.J. Leduc, M. Lawford 26

27 Structural Representation Verilog contains a set of gate level primitives for common logic gates (see Table A.2 in Appendix A.9 for details). A gate is defined by giving its functional name, output, and its inputs. For example, a two-input AND gate with inputs x 1 and x 2, and output f would be: and(f,x 1,x 2 ) A circuit is specified in Verilog as a module that provides the statements that define the circuit. A module is given a name, and it may have input and outputs called ports. c R.J. Leduc, M. Lawford 27

28 Structural Representation e.g. 1 c R.J. Leduc, M. Lawford 28

29 Structural Representation e.g. 2 c R.J. Leduc, M. Lawford 29

30 Behavioral Representation Using gate primitives would be tedious for large circuits. Instead we can use abstract expressions and programming constructs to describe how the circuit should behave. For example we can use logical expressions to define the circuit (see Verilog operators in Table A.1 in Appendix A.7). The AND operator is & and the OR operator is. The assign keyword gives a continuous assignment for f. c R.J. Leduc, M. Lawford 30

31 Behavioral Representation e.g. 2 c R.J. Leduc, M. Lawford 31

32 Analysis and Synthesis Analysis: Take a logic network and determine its output function(s). Synthesis: Design a network to implement a desired logic function. c R.J. Leduc, M. Lawford 32

33 Analysis Using intermediate variables and Truth Tables is one way to analyze a circuit. Another way is to draw timing diagrams: plots of values of logic variables & functions vs. time. Timing diagrams occur in 2 places: using Computer Aided Design (CAD) software to simulate circuit. using a logic analyzer in a lab This type of analysis allows us to verify that two logic circuits are functionally equivalent. This means both realize the same logical function. ie. for all input combinations, they will produce the same output value. As we will see there are many ways to implement a circuit. c R.J. Leduc, M. Lawford 33

34 Intro to Boolean Algebra From example on board, we can see that the two functions f(x 1,x 2 ) = x 1 +x 1 x 2 and g(x 1,x 2 ) = x 1 +x 2 are functionally equivalent. Want to be able to start with function f and be able to simplify to g as it is smaller and thus less costly to implement. We want to be able to show equivalence without using truth tables. One solution is to use Boolean algebra. Provides basis of modern design techniques. c R.J. Leduc, M. Lawford 34

35 Boolean Algebra Axioms Axioms 1-4 define truth tables for operators. (a) (b) = = = = = 1 0 = = 0+1 = 1 4. If x = 0, then x = 1 If x = 1, then x = 0 Properties: (a) (b) 5. x 0 = 0 x+1 = 1 6. x 1 = x x+0 = x 7. x x = x x+x = x 8. x x = 0 x+x = 1 9. x = x c R.J. Leduc, M. Lawford 35

36 Boolean Algebra Theorems Properties: 10.(a) x y = y x (Commutative) (b) x+y = y +x 11.(a) x (y z) = (x y) z (Associative) (b) x+(y +z) = (x+y)+z 12.(a) x (y +z) = (x y)+(x z) (Distributive) (b) x+(y z) = (x+y) (x+z) 13.(a) x+(x y) = x (Absorption) (b) x (x+y) = x 14.(a) x y +x y = x (Combining) (b) (x+y) (x+y) = x 15.(a) x y = x+y (DeMorgan) (b) x+y = x y 16.(a) x+x y = x+y (b) x (x+y) = x y c R.J. Leduc, M. Lawford 36

37 Logic Principles Principle of Duality: The dual of any true statement (axiom or theorem) in Boolean algebra is is also true. It is obtained by: Swap all + operators by operators and vice-versa. Swap all 0s by 1s and vice-versa. For example the dual of x 1 = x is x+0 = x DeMorgan s Theorem: x y = x+y c R.J. Leduc, M. Lawford 37

38 Proving Properties/Theorems May be asked to prove properties or theorems. One approach is to use truth tables. This is called proof by perfect induction. For example, prove that Property 15.a (x y = x+y) is true. c R.J. Leduc, M. Lawford 38

39 Venn Diagrams Another approach is to use Venn diagrams. Venn diagrams are a visual aid used to illustrate operations and relations in set algebra. In a Venn diagram, the elements of a set are represented by the area enclosed by a contour (i.e. a square or circle). Coloured area is portion of region where function is true. c R.J. Leduc, M. Lawford 39

40 Venn Diagrams - II c R.J. Leduc, M. Lawford 40

41 Venn Diagram Example Verify distributive property, x (y +z) = (x y)+(x z). c R.J. Leduc, M. Lawford 41

42 Algebraic Manipulation A more effective way to prove that a theorem is true, or to simplify an expression, is to use algebraic manipulation. This entails using the axioms, theorems, and properties to transform an expression, step by step, into another, equivalent expression. At each step you MUST cite which axioms etc. you use or you will lose a lot of marks on assignments/tests. Example: prove property 13a: x+xy = x LHS = x+xy = x(1+y) 12a = x 1 5b = x 6a = RHS c R.J. Leduc, M. Lawford 42

43 Algebraic Manipulation Example Use algebraic manipulation to minimize the function below: f = xyz +xyz +xyz +xyz +xyz +xyz = xy(z +z)+xy(z +z)+xy(z +z) 12a = xy +xy +xy 8b, 6a = x(y +y)+xy 12a = x+xy 8b, 6a = x+y 16a This approach not practical for complex expressions. Method is the basis for automating synthesis of logic functions in CAD tools. c R.J. Leduc, M. Lawford 43

44 Algebraic Manipulation Example 2 Use algebraic manipulation to minimize the function below: f = (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) = (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) (x 1 +x 2 +x 3 ) 10a = ((x 1 +x 2 )+x 3 ) ((x 1 +x 2 )+x 3 ) (x 1 +(x 2 +x 3 )) (x 1 +(x 2 +x 3 )) 11b = ((x 1 +x 2 )+x 3 ) ((x 1 +x 2 )+x 3 ) ((x 2 +x 3 )+x 1 ) ((x 2 +x 3 )+x 1 ) 10b c R.J. Leduc, M. Lawford 44

45 Algebraic Manipulation Example 2 - II = ((x 1 +x 2 )+x 3 ) ((x 1 +x 2 )+x 3 ) ((x 2 +x 3 )+x 1 ) ((x 2 +x 3 )+x 1 ) 10b Want to use property 12b: x+y z = (x+y)(x+z) Important to realize that terms in a theorem can mean a variable, or an expression. Can apply to: ((x 1 +x 2 )+x 3 ) ((x 1 +x 2 )+x 3 ) by taking x = (x 1 +x 2 ), y = x 3, and z = x 3 = ((x 1 +x 2 )+x 3 x 3 ) ((x 2 +x 3 )+x 1 x 1 ) 12b = (x 1 +x 2 ) (x 2 +x 3 ) 8a, 6b c R.J. Leduc, M. Lawford 45

46 Synthesis We can generate or synthesize a circuit from truth table: x 1 x 2 x 3 f For the above truth table, an equivalent logic function is: f = x 1 x 2 +x 3. How was it derived? That s our next topic.. c R.J. Leduc, M. Lawford 46

47 Synthesis Intro Have function that monitors inputs x 1 and x 2 such that f = 1 when (x 1,x 2 ) = (0,0),(0,1),or(1,1), otherwise f = 0. This gives us: x 1 x 2 f How can we represent this as a function? We know f is true for all input combos but 1. For each input valuation that f = 1, we can find a term that is true only for that input combo. ie. (x 1,x 2 ) = (0,1) can be represented as x 1 x 2. We can then OR these three terms together. f = x 1 x 2 +x 1 x 2 +x 1 x 2 c R.J. Leduc, M. Lawford 47

48 Synthesis Intro - II Below is f = x 1 x 2 +x 1 x 2 +x 1 x 2 implemented as a circuit. Can show that g = x 1 +x2, implemented below, is functionally equivalent to f. Which is better? Not always obvious so we use a cost metric. c R.J. Leduc, M. Lawford 48

49 Circuit Cost Defn: The cost of the circuit is the sum of the logic gates added to the sum of their inputs. Cost = # gates+# inputs Unless told otherwise, ignore the cost of inverters. Why? see Appendix B. f: cost = 4+9 = 13 g: cost = 1+2 = 3 c R.J. Leduc, M. Lawford 49

50 Synthesis: Sum-of-Products Literal: A variable in its uncomplemented or complemented form (ie. A, A, B). Product term: One literal, or 2 or more literals ANDed together (ie. A, x 1 x 2 x 3 ). Minterm: For a function of n variables, a minterm is a product term containing each of the n variables only once. Sum-of-products expression: Expression formed by combining product terms with the + operator (ie. A+x 1 x 2 x 3 ) c R.J. Leduc, M. Lawford 50

51 Canonical sum-of-products Canonical sum-of-products: A sum-of-products expression for a function consisting only of minterms. Unique to a truth table. Procedure: Identify rows of truth table where f = 1 Form minterms for these rows. If variable is zero in valuation, then use complement in minterm, else variable. ie, if x = 0 in valuation, then use x, else x. Create sum-of-products of these minterms c R.J. Leduc, M. Lawford 51

52 Sum-of-Products Example Derive canonical sum-of-products from truth table. # x 1 x 2 x 3 h minterm label x 1 x 2 x 3 m x 1 x 2 x 3 m x 1 x 2 x 3 m x 1 x 2 x 3 m x 1 x 2 x 3 m 7 h = x 1 x 2 x 3 +x 1 x 2 x 3 +x 1 x 2 x 3 +x 1 x 2 x 3 +x 1 x 2 x 3 = m 1 +m 3 +m 5 +m 6 +m 7 = Σ(m 1,m 3,m 5,m 6,m 7 ) = Σm(1,3,5,6,7) cost = 6+20 = 26 c R.J. Leduc, M. Lawford 52

53 Product-of-sums Intro Earlier, we found the canonical sum-of-products for the truth table below: f = x 1 x 2 +x 1 x 2 +x 1 x 2 x 1 x 2 f If we took h = f, it would be true when f = 0. The sum of products for h is: h = x 1 x 2 We can derive an expression for f as follows: f = h = (x 1 x 2 ) = x 1 +x 2 Called product-of-sums form. Want to be able to derive from truth table c R.J. Leduc, M. Lawford 53

54 Synthesis: Product-of-sums Sum term: One literal, or 2 or more literals ORed together (ie. A, (x 1 +x 2 +x 3 )). Maxterm: For a function of n variables, a maxterm is a sum term containing each of the n variables only once. Product-of-sums expression: Expression formed by combining sum terms with the operator (ie. A (x 1 +x 2 +x 3 )) c R.J. Leduc, M. Lawford 54

55 Canonical product-of-sums Canonical product-of-sums: A product-of-sums expression for a function consisting only of maxterms. Unique to a truth table. Procedure: Identify rows of truth table where f = 0 Form maxterms for these rows. If variable is one in valuation, then use complement in maxterm, else variable. ie, if x = 1 in valuation, then use x, else x. Create product-of-sums of these maxterms. c R.J. Leduc, M. Lawford 55

56 Product-of-Sums e.g. Earlier, we evaluated the sum-of-products for truth table. Now we find the canonical product-of-sums. # x 1 x 2 x 3 f maxterm x 1 +x 2 +x x 1 +x 2 +x x 1 +x 2 +x f = (x 1 +x 2 +x 3 )(x 1 +x 2 +x 3 )(x 1 +x 2 +x 3 ) = M 0 M 2 M 4 = Π(M 0,M 2,M 4 ) = ΠM(0,2,4) cost = 4+12 = 16 c R.J. Leduc, M. Lawford 56

57 Design Steps 1. Specify desired behavior of circuit. 2. Synthesize circuit and optimize. 3. Implement circuit. 4. Verify circuit - if incorrect, go back to step 2. c R.J. Leduc, M. Lawford 57

58 Design Example: Multiplexor Word Description: You have two data sources, x 1 and x 2, and one output, f. We want to use a third input, s, to select which input is transmitted to the output. If s = 0, then f has the same value as x 1. If s = 1, then f has the same value as x 2. This type of circuit is called a multiplexor. c R.J. Leduc, M. Lawford 58

59 Design Example: Multiplexor - II Step 1: create truth table from word problem. # s x 1 x 2 f minterm sx 1 x sx 1 x sx 1 x sx 1 x 2 Step 2: Synthesize. Determine minterms and form s-of-p. We then optimize to reduce cost of circuit. f = sx 1 x 2 +sx 1 x 2 +sx 1 x 2 +sx 1 x 2 = sx 1 (x 2 +x 2 )+sx 2 (x 1 +x 1 ) 12a = sx 1 +sx 2 6a,8b c R.J. Leduc, M. Lawford 59

60 Design Example: Multiplexor - III Step 3: implement the circuit. c R.J. Leduc, M. Lawford 60

61 Design Example: Multiplexor - IV Step 4: verify circuit by analyzing implementation. Take point A to be s, point B to be sx 1 and point C to be sx 2 and fill in the truth table below: # s x 1 x 2 A B C f Must have column for each unique signal in circuit. f column identical to original f column, thus our circuit is functionally equivalent. c R.J. Leduc, M. Lawford 61

62 Verilog Subcircuit Example: 2-bit adder Start with a circuit called a full adder. Adds two 1 bit numbers with a carry in from previous position (will discuss later in Section 3.2 of text). c R.J. Leduc, M. Lawford 62

64 Full Adder Definition First, we define a module for our subcircuit. See Appendix A, Section 12 for more information on using subcircuits. To use a subcircuit, the subcircuit s module definition must be in the same file as the main circuit s module definition. c R.J. Leduc, M. Lawford 64

65 Four Bit Adder Definition To create a module instantiation, we need to specify the module name, give a unique identifier, and give the port connections. Port connections can be give in either ordered form (listed in same order as in subcircuit) or in named form (explicit mapping). c R.J. Leduc, M. Lawford 65

### Boolean Algebra. BME208 Logic Circuits Yalçın İŞLER

Boolean Algebra BME28 Logic Circuits Yalçın İŞLER islerya@yahoo.com http://me.islerya.com 5 Boolean Algebra /2 A set of elements B There exist at least two elements x, y B s. t. x y Binary operators: +

### Boolean Algebra and Logic Gates

Boolean Algebra and Logic Gates Binary logic is used in all of today's digital computers and devices Cost of the circuits is an important factor Finding simpler and cheaper but equivalent circuits can

### Menu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification

Menu Minterms & Maxterms SOP & POS MSOP & MPOS Simplification using the theorems/laws/axioms Look into my... 1 Definitions (Review) Algebraic Simplification - Boolean Algebra Minterms (written as m i ):

### Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

Review EECS 150 - Components and Design Techniques for Digital Systems Lec 05 Boolean Logic 94-04 David Culler Electrical Engineering and Computer Sciences University of California, Berkeley Design flow

### Lecture (05) Boolean Algebra and Logic Gates

Lecture (05) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee ١ Minterms and Maxterms consider two binary variables x and y combined with an AND operation. Since eachv ariable may appear in either

### Boolean algebra. June 17, Howard Huang 1

Boolean algebra Yesterday we talked about how analog voltages can represent the logical values true and false. We introduced the basic Boolean operations AND, OR and NOT, which can be implemented in hardware

### Chapter 2 Boolean algebra and Logic Gates

Chapter 2 Boolean algebra and Logic Gates 2. Introduction In working with logic relations in digital form, we need a set of rules for symbolic manipulation which will enable us to simplify complex expressions

### Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Logic Design First Stage Lecture No.6 Boolean Algebra Bawar Abid Abdalla Assistant Lecturer Software Engineering Department Koya University Outlines Boolean Operations Laws of Boolean Algebra Rules of

### FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language Reference: [] FIELD PROGRAMMABLE GATE ARRAY FPGA is a hardware logic device that is programmable Logic functions may be programmed

### IT 201 Digital System Design Module II Notes

IT 201 Digital System Design Module II Notes BOOLEAN OPERATIONS AND EXPRESSIONS Variable, complement, and literal are terms used in Boolean algebra. A variable is a symbol used to represent a logical quantity.

### ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 2 Intro to Electrical and Computer Engineering Lecture 5 Boolean Algebra Overview Logic functions with s and s Building digital circuitry Truth tables Logic symbols and waveforms Boolean algebra

### Combinational Logic & Circuits

Week-I Combinational Logic & Circuits Spring' 232 - Logic Design Page Overview Binary logic operations and gates Switching algebra Algebraic Minimization Standard forms Karnaugh Map Minimization Other

### Experiment 4 Boolean Functions Implementation

Experiment 4 Boolean Functions Implementation Introduction: Generally you will find that the basic logic functions AND, OR, NAND, NOR, and NOT are not sufficient to implement complex digital logic functions.

### Chapter 2. Boolean Algebra and Logic Gates

Chapter 2. Boolean Algebra and Logic Gates Tong In Oh 1 Basic Definitions 2 3 2.3 Axiomatic Definition of Boolean Algebra Boolean algebra: Algebraic structure defined by a set of elements, B, together

### 2.6 BOOLEAN FUNCTIONS

2.6 BOOLEAN FUNCTIONS Binary variables have two values, either 0 or 1. A Boolean function is an expression formed with binary variables, the two binary operators AND and OR, one unary operator NOT, parentheses

### 1. Mark the correct statement(s)

1. Mark the correct statement(s) 1.1 A theorem in Boolean algebra: a) Can easily be proved by e.g. logic induction b) Is a logical statement that is assumed to be true, c) Can be contradicted by another

### Chapter 2. Boolean Expressions:

Chapter 2 Boolean Expressions: A Boolean expression or a function is an expression which consists of binary variables joined by the Boolean connectives AND and OR along with NOT operation. Any Boolean

### Introduction to Computer Architecture

Boolean Operators The Boolean operators AND and OR are binary infix operators (that is, they take two arguments, and the operator appears between them.) A AND B D OR E We will form Boolean Functions of

### Boolean Logic CS.352.F12

Boolean Logic CS.352.F12 Boolean Algebra Boolean Algebra Mathematical system used to manipulate logic equations. Boolean: deals with binary values (True/False, yes/no, on/off, 1/0) Algebra: set of operations

### structure syntax different levels of abstraction

This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about digital

### Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about digital

### Standard Forms of Expression. Minterms and Maxterms

Standard Forms of Expression Minterms and Maxterms Standard forms of expressions We can write expressions in many ways, but some ways are more useful than others A sum of products (SOP) expression contains:

### Combinational Logic Circuits

Chapter 2 Combinational Logic Circuits J.J. Shann (Slightly trimmed by C.P. Chung) Chapter Overview 2-1 Binary Logic and Gates 2-2 Boolean Algebra 2-3 Standard Forms 2-4 Two-Level Circuit Optimization

### Spring 2010 CPE231 Digital Logic Section 1 Quiz 1-A. Convert the following numbers from the given base to the other three bases listed in the table:

Section 1 Quiz 1-A Convert the following numbers from the given base to the other three bases listed in the table: Decimal Binary Hexadecimal 1377.140625 10101100001.001001 561.24 454.3125 111000110.0101

### 2.1 Binary Logic and Gates

1 EED2003 Digital Design Presentation 2: Boolean Algebra Asst. Prof.Dr. Ahmet ÖZKURT Asst. Prof.Dr Hakkı T. YALAZAN Based on the Lecture Notes by Jaeyoung Choi choi@comp.ssu.ac.kr Fall 2000 2.1 Binary

### Variable, Complement, and Literal are terms used in Boolean Algebra.

We have met gate logic and combination of gates. Another way of representing gate logic is through Boolean algebra, a way of algebraically representing logic gates. You should have already covered the

Get Free notes at Module-I One s Complement: Complement all the bits.i.e. makes all 1s as 0s and all 0s as 1s Two s Complement: One s complement+1 SIGNED BINARY NUMBERS Positive integers (including zero)

### Experiment 3: Logic Simplification

Module: Logic Design Name:... University no:.. Group no:. Lab Partner Name: Mr. Mohamed El-Saied Experiment : Logic Simplification Objective: How to implement and verify the operation of the logical functions

### Computer Science. Unit-4: Introduction to Boolean Algebra

Unit-4: Introduction to Boolean Algebra Learning Objective At the end of the chapter students will: Learn Fundamental concepts and basic laws of Boolean algebra. Learn about Boolean expression and will

Summary Boolean Addition In Boolean algebra, a variable is a symbol used to represent an action, a condition, or data. A single variable can only have a value of or 0. The complement represents the inverse

### CS8803: Advanced Digital Design for Embedded Hardware

CS883: Advanced Digital Design for Embedded Hardware Lecture 2: Boolean Algebra, Gate Network, and Combinational Blocks Instructor: Sung Kyu Lim (limsk@ece.gatech.edu) Website: http://users.ece.gatech.edu/limsk/course/cs883

### SFWR ENG 2DA4 Lab 1. Announcements: Marking Scheme: Lab Safety Manual:

SFWR ENG 2DA4 Lab 1 First lab Week of: Sept. 17, 2018 Prep Due week of: (8:40/14:40), Sept. 24, 2018 Demo Due Week of: (11:20/17:20), Sept. 24, 2018 Assignment due in class: 13:40, Sept. 28, 2018 Announcements:

### Lecture (04) Boolean Algebra and Logic Gates

Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 26, Logic Design Boolean algebra properties basic assumptions and properties: Closure law A set S is

### Lecture (04) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee

Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee Boolean algebra properties basic assumptions and properties: Closure law A set S is closed with respect to a binary operator, for every

### Code No: R Set No. 1

Code No: R059210504 Set No. 1 II B.Tech I Semester Supplementary Examinations, February 2007 DIGITAL LOGIC DESIGN ( Common to Computer Science & Engineering, Information Technology and Computer Science

### Introduction to Boolean Algebra

Introduction to Boolean Algebra Boolean algebra which deals with two-valued (true / false or and ) variables and functions find its use in modern digital computers since they too use two-level systems

### Tutorial on Quartus II Introduction Using Verilog Code

Tutorial on Quartus II Introduction Using Verilog Code (Version 15) 1 Introduction This tutorial presents an introduction to the Quartus II CAD system. It gives a general overview of a typical CAD flow

### CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey

CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey 2. Introduction Logic gates are connected together to produce a specified output for certain specified combinations of input

### R.M.D. ENGINEERING COLLEGE R.S.M. Nagar, Kavaraipettai

L T P C R.M.D. ENGINEERING COLLEGE R.S.M. Nagar, Kavaraipettai- 601206 DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC8392 UNIT - I 3 0 0 3 OBJECTIVES: To present the Digital fundamentals, Boolean

### Optimized Implementation of Logic Functions

June 25, 22 9:7 vra235_ch4 Sheet number Page number 49 black chapter 4 Optimized Implementation of Logic Functions 4. Nc3xe4, Nb8 d7 49 June 25, 22 9:7 vra235_ch4 Sheet number 2 Page number 5 black 5 CHAPTER

### Chapter 3. Boolean Algebra and Digital Logic

Chapter 3 Boolean Algebra and Digital Logic Chapter 3 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple logic circuits. Understand how

### 14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

14:332:231 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 2013 Lecture #22: Introduction to Verilog Hardware Description Languages Basic idea: Language constructs

### SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

UNIT - I PART A (2 Marks) 1. Using Demorgan s theorem convert the following Boolean expression to an equivalent expression that has only OR and complement operations. Show the function can be implemented

### UNIT 2 BOOLEAN ALGEBRA

UNIT 2 BOOLEN LGEBR Spring 2 2 Contents Introduction Basic operations Boolean expressions and truth tables Theorems and laws Basic theorems Commutative, associative, and distributive laws Simplification

### Gate-Level Minimization. BME208 Logic Circuits Yalçın İŞLER

Gate-Level Minimization BME28 Logic Circuits Yalçın İŞLER islerya@yahoo.com http://me.islerya.com Complexity of Digital Circuits Directly related to the complexity of the algebraic expression we use to

### Lecture 5. Chapter 2: Sections 4-7

Lecture 5 Chapter 2: Sections 4-7 Outline Boolean Functions What are Canonical Forms? Minterms and Maxterms Index Representation of Minterms and Maxterms Sum-of-Minterm (SOM) Representations Product-of-Maxterm

### Objectives: 1- Bolean Algebra. Eng. Ayman Metwali

Objectives: Chapter 3 : 1- Boolean Algebra Boolean Expressions Boolean Identities Simplification of Boolean Expressions Complements Representing Boolean Functions 2- Logic gates 3- Digital Components 4-

### Verilog Design Principles

16 h7fex // 16-bit value, low order 4 bits unknown 8 bxx001100 // 8-bit value, most significant 2 bits unknown. 8 hzz // 8-bit value, all bits high impedance. Verilog Design Principles ECGR2181 Extra Notes

### Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two major languages Verilog (IEEE 1364), latest version is

### Boolean Algebra & Digital Logic

Boolean Algebra & Digital Logic Boolean algebra was developed by the Englishman George Boole, who published the basic principles in the 1854 treatise An Investigation of the Laws of Thought on Which to

### X Y Z F=X+Y+Z

This circuit is used to obtain the compliment of a value. If X = 0, then X = 1. The truth table for NOT gate is : X X 0 1 1 0 2. OR gate : The OR gate has two or more input signals but only one output

### Binary logic. Dr.Abu-Arqoub

Binary logic Binary logic deals with variables like (a, b, c,, x, y) that take on two discrete values (, ) and with operations that assume logic meaning ( AND, OR, NOT) Truth table is a table of all possible

### R10. II B. Tech I Semester, Supplementary Examinations, May

SET - 1 1. a) Convert the following decimal numbers into an equivalent binary numbers. i) 53.625 ii) 4097.188 iii) 167 iv) 0.4475 b) Add the following numbers using 2 s complement method. i) -48 and +31

### Announcements. Chapter 2 - Part 1 1

Announcements If you haven t shown the grader your proof of prerequisite, please do so by 11:59 pm on 09/05/2018 (Wednesday). I will drop students that do not show us the prerequisite proof after this

### Introduction to Boolean Algebra

Introduction to Boolean Algebra Boolean algebra which deals with two-valued (true / false or and ) variables and functions find its use in modern digital computers since they too use two-level systems

### Circuit analysis summary

Boolean Algebra Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table to describe what the circuit does. You can easily convert

### Topics. FPGA Design EECE 277. Interconnect and Logic Elements Part 2. Laboratory Assignment #1 Save Everything!!! Guest Lecture

FPGA Design EECE 277 Interconnect and Logic Elements Part 2 Dr. William H. Robinson February 4, 2005 http://eecs.vanderbilt.edu/courses/eece277/ Topics The sky is falling. I must go and tell the King.

### Chapter 2: Combinational Systems

Uchechukwu Ofoegbu Chapter 2: Combinational Systems Temple University Adapted from Alan Marcovitz s Introduction to Logic and Computer Design Riddle Four switches can be turned on or off. One is the switch

### Digital Logic Design. Outline

Digital Logic Design Gate-Level Minimization CSE32 Fall 2 Outline The Map Method 2,3,4 variable maps 5 and 6 variable maps (very briefly) Product of sums simplification Don t Care conditions NAND and NOR

### Unit-IV Boolean Algebra

Unit-IV Boolean Algebra Boolean Algebra Chapter: 08 Truth table: Truth table is a table, which represents all the possible values of logical variables/statements along with all the possible results of

### Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

1-4.1 1-4.2 Spiral 1 / Unit 4 Verilog HDL Mark Redekopp OVERVIEW 1-4.3 1-4.4 Digital Circuit Design Steps Digital Circuit Design Description Design and computer-entry of circuit Verification Input Stimulus

### Introduction to Verilog HDL

Introduction to Verilog HDL Ben Abdallah Abderazek National University of Electro-communications, Tokyo, Graduate School of information Systems May 2004 04/09/08 1 What you will understand after having

### Synthesizable Verilog

Synthesizable Verilog Courtesy of Dr. Edwards@Columbia, and Dr. Franzon@NCSU http://csce.uark.edu +1 (479) 575-6043 yrpeng@uark.edu Design Methodology Structure and Function (Behavior) of a Design HDL

### Gate-Level Minimization

Gate-Level Minimization ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2017 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Outlines The Map Method

### BOOLEAN ALGEBRA. 1. State & Verify Laws by using :

BOOLEAN ALGEBRA. State & Verify Laws by using :. State and algebraically verify Absorption Laws. (2) Absorption law states that (i) X + XY = X and (ii) X(X + Y) = X (i) X + XY = X LHS = X + XY = X( + Y)

### Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Combinational Logic Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National University Prof. Wangrok Oh(CNU) / 93 Overview Introduction 2 Combinational Circuits 3 Analysis Procedure

### Digital Logic Design (CEN-120) (3+1)

Digital Logic Design (CEN-120) (3+1) ASSISTANT PROFESSOR Engr. Syed Rizwan Ali, MS(CAAD)UK, PDG(CS)UK, PGD(PM)IR, BS(CE)PK HEC Certified Master Trainer (MT-FPDP) PEC Certified Professional Engineer (COM/2531)

### Philadelphia University Faculty of Information Technology Department of Computer Science. Computer Logic Design. By Dareen Hamoudeh.

Philadelphia University Faculty of Information Technology Department of Computer Science Computer Logic Design By Dareen Hamoudeh Dareen Hamoudeh 1 Canonical Forms (Standard Forms of Expression) Minterms

### Combinational Logic II

Combinational Logic II Ranga Rodrigo July 26, 2009 1 Binary Adder-Subtractor Digital computers perform variety of information processing tasks. Among the functions encountered are the various arithmetic

### Chap-2 Boolean Algebra

Chap-2 Boolean Algebra Contents: My name Outline: My position, contact Basic information theorem and postulate of Boolean Algebra. or project description Boolean Algebra. Canonical and Standard form. Digital

### SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202)

Lecture No:5 Boolean Expressions and Definitions Boolean Algebra Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the binary numbers i.e. 0 and 1. It is also called

### LECTURE 4. Logic Design

LECTURE 4 Logic Design LOGIC DESIGN The language of the machine is binary that is, sequences of 1 s and 0 s. But why? At the hardware level, computers are streams of signals. These signals only have two

### Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 3 Additional Gates and Circuits

Logic and Computer Design Fundamentals Chapter 2 Combinational Logic Circuits Part 3 Additional Gates and Circuits Charles Kime & Thomas Kaminski 28 Pearson Education, Inc. (Hyperlinks are active in View

### University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering Final Examination ECE 241F - Digital Systems Examiners: S. Brown,

### Digital Techniques. Lecture 1. 1 st Class

Digital Techniques Lecture 1 1 st Class Digital Techniques Digital Computer and Digital System: Digital computer is a part of digital system, it based on binary system. A block diagram of digital computer

### Hardware description languages

Specifying digital circuits Schematics (what we ve done so far) Structural description Describe circuit as interconnected elements Build complex circuits using hierarchy Large circuits are unreadable Hardware

### EECS150 Homework 2 Solutions Fall ) CLD2 problem 2.2. Page 1 of 15

1.) CLD2 problem 2.2 We are allowed to use AND gates, OR gates, and inverters. Note that all of the Boolean expression are already conveniently expressed in terms of AND's, OR's, and inversions. Thus,

### A Brief Introduction to Verilog Hardware Definition Language (HDL)

www.realdigital.org A Brief Introduction to Verilog Hardware Definition Language (HDL) Forward Verilog is a Hardware Description language (HDL) that is used to define the structure and/or behavior of digital

### UNIT-4 BOOLEAN LOGIC. NOT Operator Operates on single variable. It gives the complement value of variable.

UNIT-4 BOOLEAN LOGIC Boolean algebra is an algebra that deals with Boolean values((true and FALSE). Everyday we have to make logic decisions: Should I carry the book or not?, Should I watch TV or not?

### CS February 17

Discrete Mathematics CS 26 February 7 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x n,..x n ) B, F (x,..x n ) = G (x,..x n ) Example: F(x,y,z) = x(y+z), G(x,y,z)

### QUESTION BANK FOR TEST

CSCI 2121 Computer Organization and Assembly Language PRACTICE QUESTION BANK FOR TEST 1 Note: This represents a sample set. Please study all the topics from the lecture notes. Question 1. Multiple Choice

### Lecture 4: Implementation AND, OR, NOT Gates and Complement

EE210: Switching Systems Lecture 4: Implementation AND, OR, NOT Gates and Complement Prof. YingLi Tian Feb. 13, 2018 Department of Electrical Engineering The City College of New York The City University

### KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT COE 202: Digital Logic Design Term 162 (Spring 2017) Instructor: Dr. Abdulaziz Barnawi Class time: U.T.R.: 11:00-11:50AM Class

### Starting Boolean Algebra

Boolean Algebra March 2, 27 Diagram for FunChip2 Here is a picture of FunChip2 that we created more or less randomly in class on /25 (used in various Activities): Starting Boolean Algebra Boolean algebra

### Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Logic Design First Stage Lecture No.5 Boolean Algebra Bawar Abid Abdalla Assistant Lecturer Software Engineering Department Koya University Boolean Operations Laws of Boolean Algebra Rules of Boolean Algebra

### Lecture 3 Introduction to VHDL

CPE 487: Digital System Design Spring 2018 Lecture 3 Introduction to VHDL Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 Managing Design

### Designing Computer Systems Boolean Algebra

Designing Computer Systems Boolean Algebra 08:34:45 PM 4 June 2013 BA-1 Scott & Linda Wills Designing Computer Systems Boolean Algebra Programmable computers can exhibit amazing complexity and generality.

### Midterm Exam Review. CS 2420 :: Fall 2016 Molly O'Neil

Midterm Exam Review CS 2420 :: Fall 2016 Molly O'Neil Midterm Exam Thursday, October 20 In class, pencil & paper exam Closed book, closed notes, no cell phones or calculators, clean desk 20% of your final

### ENGIN 241 Digital Systems with Lab

ENGIN 241 Digital Systems with Lab (4) Dr. Honggang Zhang Engineering Department University of Massachusetts Boston 1 Introduction Hardware description language (HDL): Specifies logic function only Computer-aided

### Hardware description language (HDL)

Hardware description language (HDL) A hardware description language (HDL) is a computer-based language that describes the hardware of digital systems in a textual form. It resembles an ordinary computer

### Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Hardware Description Languages: Verilog Quick History of HDLs Verilog Structural Models (Combinational) Behavioral Models Syntax Examples CS 150 - Fall 2005 - Lecture #4: Verilog - 1 ISP (circa 1977) -

28 The McGraw-Hill Companies, Inc. All rights reserved. 28 The McGraw-Hill Companies, Inc. All rights reserved. All or Nothing Gate Boolean Expression: A B = Y Truth Table (ee next slide) or AB = Y 28

### SWITCHING THEORY AND LOGIC CIRCUITS

SWITCHING THEORY AND LOGIC CIRCUITS COURSE OBJECTIVES. To understand the concepts and techniques associated with the number systems and codes 2. To understand the simplification methods (Boolean algebra

### Hardware Description Languages: Verilog

Hardware Description Languages: Verilog Verilog Structural Models (Combinational) Behavioral Models Syntax Examples CS 150 - Fall 2005 - Lecture #4: Verilog - 1 Quick History of HDLs ISP (circa 1977) -

### Tutorial on Quartus II Introduction Using Schematic Designs

Tutorial on Quartus II Introduction Using Schematic Designs (Version 15) 1 Introduction This tutorial presents an introduction to the Quartus II CAD system. It gives a general overview of a typical CAD

### Definitions. 03 Logic networks Boolean algebra. Boolean set: B 0,

3. Boolean algebra 3 Logic networks 3. Boolean algebra Definitions Boolean functions Properties Canonical forms Synthesis and minimization alessandro bogliolo isti information science and technology institute

### Hardware Description Languages (HDLs) Verilog

Hardware Description Languages (HDLs) Verilog Material from Mano & Ciletti book By Kurtulus KULLU Ankara University What are HDLs? A Hardware Description Language resembles a programming language specifically

### Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

Verilog Radek Pelánek and Šimon Řeřucha Contents 1 Computer Aided Design 2 Basic Syntax 3 Gate Level Modeling 4 Behavioral Modeling Computer Aided Design Hardware Description Languages (HDL) Verilog C