COMP541 Combinational Logic - 2 - PowerPoint PPT Presentation

About This Presentation
Title:

COMP541 Combinational Logic - 2

Description:

No lab tomorrow start Jan 26. Fairly fast PCs in lab. To use ... Others: Abel, SystemC, Handel. Origins as testing languages. To generate sets of input values ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 42
Provided by: Montek5
Learn more at: http://www.cs.unc.edu
Category:

less

Transcript and Presenter's Notes

Title: COMP541 Combinational Logic - 2


1
COMP541Combinational Logic - 2
  • Montek Singh
  • Jan 18, 2007

2
Friday Labs
  • No lab tomorrow start Jan 26
  • Fairly fast PCs in lab
  • To use your laptop, go to
  • http//www.xilinx.com/ise/logic_design_prod/webpac
    k.htm
  • Windows or Linux
  • Dont install Modelsim see me

3
Homework
  • HW1 will be assigned Jan 23, due Jan 30
  • Send via email or paper

4
Topics
  • More gates
  • Simple Verilog
  • Minterms and maxterms (again!)

5
Exclusive OR
  • Exclusive OR
  • What lay people mean by or
  • Symbol is ?
  • Plus in a circle

6
Parity Function
  • Recall how parity works
  • Ask class
  • Write truth table for two input even parity
  • What needs to be generated for parity bit?
  • What function of two inputs gives you this?

7
XOR Gives Odd Function
  • As many inputs as necessary
  • How do you get odd parity?
  • Design even parity generator for 3-bit signal
  • Perhaps make truth table and K-Map
  • Draw with XOR, then sum-of-products w/ NAND gates
  • How do you design a detector?
  • How about a 7-bit ASCII character?

8
Buffer
  • No inversion
  • No change, except in power or voltage
  • Used to enable driving more inputs

9
Others
10
Tri-State
  • Output w/ 3 states H, L, and Hi-Z
  • High impedance
  • Behaves like no output connection if in Hi-Z
    state
  • Allows connecting multiple outputs

11
Multiplexed with Hi-Z
Smoke
  • Normal operation is blue area

12
CMOS Transmission Gates
  • Act like electronic switches

13
XOR w/ Transmission Gate
14
Schematic Diagrams
  • Can you design a Pentium or a graphics chip that
    way?
  • Well, yes, but diagrams are overly complex
  • These days people represent the same thing with
    text (code)

15
Hardware Description Languages
  • Main ones are Verilog and VHDL
  • Others Abel, SystemC, Handel
  • Origins as testing languages
  • To generate sets of input values
  • Levels of use from very detailed to more abstract
    descriptions of hdw
  • Think about C from assembly level description
    to very abstract HLL
  • Today very basic use of Verilog

16
Levels of Verilog
  • Structural
  • Dataflow
  • Conditional
  • Behavioral
  • Look at first two today

17
Example 1
  • Output is 1 when input lt 011

18
Structural Verilog
  • Explicit description of gates and connections
  • Textual form of schematic
  • Specify netlist

19
Example 1 in Structural Verilog
  • module example_1(X,Y,Z,F)
  • input X
  • input Y
  • input Z
  • output F
  • //wire X_n, Y_n, Z_n, f1, f2
  • not
  • g0(X_n, X),
  • g1(Y_n, Y),
  • g2(Z_n, Z)
  • nand
  • g3(f1, X_n, Y_n),
  • g4(f2, X_n, Z_n),
  • g5(F, f1, f2)
  • endmodule

Can also be input X, Y, Z
20
Slight Variation Gates not named
  • module example_1_c(X,Y,Z,F)
  • input X
  • input Y
  • input Z
  • output F
  • not(X_n, X)
  • not(Y_n, Y)
  • not(Z_n, Z)
  • nand(f1, X_n, Y_n)
  • nand(f2, X_n, Z_n)
  • nand(F, f1, f2)
  • endmodule

21
Explanation
  • Each of these gates is an instance
  • Like object vs class
  • In first example, they had names
  • not
  • g0(X_n, X),
  • In second example, no name
  • not(X_n, X)
  • Later see why naming can be useful

22
Gates
  • Standard set of gates available
  • and, or, not
  • nand, nor
  • xor, xnor
  • buf

23
Dataflow Description
module example_1_b(X,Y,Z,F) input X
input Y input Z output F assign F
(X Y) (X Z) endmodule
  • Basically a logical expression
  • No explicit gates

24
Design from Specification
  • So, now that we know how to implement, lets talk
    about how to specify
  • Usually we can make up a truth table from specs
  • Is there a mechanical way to come up with a
    function?
  • Are there standard ways to structure the gates in
    the design?

25
From Truth Table to Func
  • Consider a truth table
  • Can implement F by taking OR of all terms that
    are 1

26
Lets Look at Standard Forms
  • Not necessarily simplest F
  • But its mechanical way to go from truth table to
    function
  • Definitions
  • Product terms AND ? ABZ
  • Sum terms OR ? X A

27
Definition Minterm
  • Product term in which all variables appear once
    (complemented or not)

28
Number of Minterms
  • For n variables, there will be 2n minterms
  • Like binary numbers from 0 to 2n-1
  • In book, numbered same way (with decimal
    conversion)

29
Maxterms
  • Sum term in which all variables appear once
    (complemented or not)

30
Minterm related to Maxterm
  • Minterm and maxterm with same subscripts are
    complements
  • Example

31
Sum of Minterms
  • OR all of the minterms of truth table for rows
    with a 1 output

32
Sum of Products
  • Simplifying sum-of-minterms can yield a sum of
    products
  • Difference is each term need not have all
    variables
  • ANDs and one OR

33
Two-Level Implementation
  • Sum of products has 2 levels of gates

34
More Levels of Gates?
  • Whats best?
  • Hard to answer
  • More gate delays (more on this later)
  • But maybe we only have 2-input gates

35
Complement of a Function
  • Definition 1s 0s swapped in truth table
  • Mechanical way to derive algebraic form
  • Take the dual
  • Recall Interchange AND and OR, and 1s 0s
  • Complement each literal

36
Complement of F
  • Not surprisingly, just sum of the other minterms
  • In this case
  • m1 m3 m4 m6

37
Product of Maxterms
  • Recall that maxterm is true except for its own
    case
  • So M1 is only false for 001

38
Product of Maxterms
  • Can express F as AND of all rows that should
    evaluate to 0
  • or

39
Product of Sums
  • Result another standard form
  • ORs followed by AND

40
Read Do
  • Chapter 3, Sections 1 3

41
Next Week
  • Software demo, and first lab
  • Hierarchical Design
  • How do we express something more complex in
    Verilog
  • Implementation
  • Brief look at logic families
  • Packages
  • Timing characteristics, delay
  • Then look at storing data
Write a Comment
User Comments (0)
About PowerShow.com