1 (c) 2005-2012, W. J. Dally Digital Design: A Systems Approach Lecture 1: The Digital Abstraction Combinational Logic Verilog.

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Types of Logic Circuits
Table 7.1 Verilog Operators.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
Chapter 2 Logic Circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
1 Digital Logic
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
Digital Fundamentals Floyd Chapter 4 Tenth Edition
ELEN 468 Advanced Logic Design
1 COMP541 Combinational Logic - II Montek Singh Aug 27, 2014.
Digital Fundamentals with PLD Programming Floyd Chapter 4
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 2: Boolean Algebra and Logic Functions
Overview Logistics Last lecture Today HW5 due today
COMP541 Combinational Logic - I
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
ECE 2372 Modern Digital System Design
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
1 COMP541 Combinational Logic - I Montek Singh Jan 11, 2012.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Module 1.2 Introduction to Verilog
Chapter 5 Boolean Algebra and Reduction Techniques 1.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
CS/COE0447 Computer Organization & Assembly Language
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
1 COMP541 Combinational Logic - 3 Montek Singh Jan 21, 2015.
ECE 171 Digital Circuits Chapter 8 Hardware Description Language Herbert G. Mayer, PSU Status 11/23/2015 Copied with Permission from prof. Mark
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
ECE 2110: Introduction to Digital Systems
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Circuit Synthesis A logic function can be represented in several different forms:  Truth table representation  Boolean equation  Circuit schematic 
Introduction to FPGAs Getting Started with Xilinx.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Hardware Description Languages: Verilog
CS2100 Computer Organisation
Morgan Kaufmann Publishers
Chapter 2: Boolean Algebra and Logic Functions
ECE 2110: Introduction to Digital Systems
Reg and Wire:.
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
ECE 3110: Introduction to Digital Systems
Lecture 2 Boolean Algebra Basic
Hardware Description Languages: Verilog
SYNTHESIS OF SEQUENTIAL LOGIC
Chapter 2 Introduction to Logic Circuits
From now on: Combinatorial Circuits:
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Logic Circuits I Lecture 3.
COMP541 Combinational Logic - 3
Chapter 2 Digital Design and Computer Architecture, 2nd Edition
Presentation transcript:

1 (c) , W. J. Dally Digital Design: A Systems Approach Lecture 1: The Digital Abstraction Combinational Logic Verilog

2 (c) , W. J. Dally Readings Lecture 1: Chapters 1, 3, 7.1, Appendix A L2: Chapters 6, 7 for L2

3 (c) , W. J. Dally Today The Digital Abstraction –Representation –Noise Combinational Logic –Output function of current input –Acyclic composition –Representations - description, truth table, equation –Boolean algebra Verilog

4 (c) , W. J. Dally Moore’s Law

5 (c) , W. J. Dally The Digital Abstraction

6 (c) , W. J. Dally Voltages Ranges of Binary Signals 01 ? Voltage Damage V min V0V0 V IL V IH V1V1 V max -0.3V0.0V0.7V1.7V 2.5V2.8V 2.5V LVCMOS Logic

7 (c) , W. J. Dally Representing Information with Digital Signals Binary InformationLight On/Off: 1/0 Element of a set 000White 001Red 010Blue 011Yellow 100Purple 101Orange 110Green 111Black Continuous Quantities

8 (c) , W. J. Dally How would you represent A Date ? –Days since Jan (20 bits) –Month, day, year( bits) –Month, day, year, day of week( bits) This representation is _________ A playing card ? –Number in deck (6 bits) –Suit, Number(2 + 4 bits) –Decoded suit, decoded number( bits) A 5-card hand ? Pick a representation based on operations required

9 (c) , W. J. Dally Example Pick representation of colors to support the operation of subtractive color mixing (e.g., red + blue = purple) –No colors - white –Primary colors – red, blue, yellow –Derived colors – orange, purple, green, black How would you represent this?

10 (c) , W. J. Dally Effect of Noise on Analog & Digital Signals V Input+  Noise V+  f f(V+  Output Noise added to Input Error at Output Analog Signals Digital Signals V 1 Input+  Noise V 1 +  f f(V 1 ) Output Noise added to Input < Noise MarginCorrect Value at Output

11 (c) , W. J. Dally Input & Output Voltage Ranges

12 (c) , W. J. Dally Restoration of Digital Signals Noise +   Noise Accumulation V a +   Noise +   V a +     V a Noise +   +   V a +   +   V a +   V a V a +   V a +   V a V a Signal Restoration V a +     

13 (c) , W. J. Dally DC Transfer Curve for a Logic Module

14 (c) , W. J. Dally Combinational Logic

15 (c) , W. J. Dally Combinational Logic Circuit Output is a function of current input Example – digital thermostat

16 (c) , W. J. Dally Sequential logic circuit Includes state (memory, storage) Makes output a function of history as well as current inputs Synchronous sequential logic uses a clock Example, calendar circuit

17 (c) , W. J. Dally o = f(i) Combinational logic is memoryless

18 (c) , W. J. Dally Can compose digital circuits

19 (c) , W. J. Dally Closure Combinational logic circuits are closed under acyclic composition. CL1 CL2 CL12

20 (c) , W. J. Dally

21 (c) , W. J. Dally Combinational NOT Combinatorial

22 (c) , W. J. Dally Combinational not Combinatorial CombinationalCombinatorial mathematics of counting combinational logic circuit combines inputs to generate an output

23 (c) , W. J. Dally Several ways to describe a combinational logic function Example – Majority Circuit 1.English Language Description Outputs 1 if more inputs are 1 than are 0 2.Logic equation q = (a  b)  (a  c)  (b  c) 3.Truth table abcq

24 (c) , W. J. Dally Boolean Algebra Boolean Algebra: –algebra over 2 elements: {0,1} –3 operators: AND (  ), OR (  ), NOT (  ) AND Operation: –a  b = 1 iff a=1 and b=1 OR Operation: –a  b = 1 if a=1 or b=1 NOT Operation: –  a = 1 iff a=0 aba&ba|b a~a 01

25 (c) , W. J. Dally Note on Notation For AND logic function: –use  or & –don’t use x nor. For OR logic function: –use  or | –don’t use +

26 (c) , W. J. Dally Axioms of Boolean Algebra Axioms: a set of mathematical statements that we assert to be true. Identity: –0  x = 0 –1  x = 1 Idempotence: –1  x = x –0  x = x Negation: –  0 = 1 –  1 = 0

27 (c) , W. J. Dally Useful Boolean Properties (all can be derived from the axioms) Communicative x  y = y  xx  y = y  x Associative x  (y  z) = (x  y)  zx  (y  z) = (x  y)  z Distributive x  (y  z) = (x  y)  (x  z)x  (y  z) = (x  y)  (x  z) Idempotence x  x = xx  x = x Absorption x  (x  y) = xx  (x  y) = x Combining (x  y)  (x   y) = x(x  y)  (x   y) = x DeMorgan’s  (x  y) =  x   y  (x  y) =  x   y

28 (c) , W. J. Dally DeMorgan’s Law  (x  y) =  x   y  (x  y) =  x   y Proof by perfect induction xy  (x  y)  x   y

29 (c) , W. J. Dally DeMorgan Graphically

30 (c) , W. J. Dally Applying Boolean Properties f(a,b,c) = (a  c)  (a  b  c)  (  a  b  c)  (a  b   c) f(a,b,c) = (a  c)  (a  b  c)  (  a  b  c)  (a  b  c)  (a  b   c)  (a  b  c) f(a,b,c) = (a  c)  (  a  b  c)  (a  b  c)  (a  b   c)  (a  b  c) f(a,b,c) = (a  c)  (b  c)  (a  b) Apply Absorption Property Apply Combining Property

31 (c) , W. J. Dally Verilog

32 (c) , W. J. Dally Verilog A hardware description language (HDL) Used as an input to: –Synthesis – implement hardware with gates, cells, or FPGAs –Simulation – see what your hardware will do before you build it Basic unit is a module Modules have –Module declaration –Input and output declarations –Internal signal declarations –Logic definition Assign statements Case statements Module instantiations

33 (c) , W. J. Dally Example, Verilog for Thermostat module Thermostat(presetTemp, currentTemp, fanOn) ; input [2:0] presetTemp, currentTemp ;// temperature inputs, 3 bits each output fanOn ; // true when current > preset wire fanOn ; assign fanOn = (currentTemp > presetTemp) ; endmodule

34 (c) , W. J. Dally Example, Verilog for Thermostat module Thermostat(presetTemp, currentTemp, fanOn) ; input [2:0] presetTemp, currentTemp ;// temperature inputs, 3 bits each output fanOn ;// true when current > preset wire fanOn ; assign fanOn = (currentTemp > presetTemp) ; endmodule Module declaration I/O list Declare I/Os A wire is a signal set with an assign statement or connected to a module 3-bit wide signals An assign statement defines a signal with an equation

35 (c) , W. J. Dally Example, Days in Month Function module DaysInMonth(month, days) ; input [3:0] month ; // month of the year 1 = Jan, 12 = Dec output [4:0] days ; // number of days in month reg [4:0] days ; begin // evaluate whenever month changes case(month) 2: days = 5’d28 ; // February has 28 4,6,9,11: days = 5’d30 ; // 30 days have September... default: days = 5’d31 ; // all the rest have endcase end endmodule

36 (c) , W. J. Dally Example, Days in Month Function module DaysInMonth(month, days) ; input [3:0] month ; // month of the year 1 = Jan, 12 = Dec output [4:0] days ; // number of days in month reg [4:0] days ; begin // evaluate whenever month changes case(month) 2: days = 5’d28 ; // February has 28 4,6,9,11: days = 5’d30 ; // 30 days have September... default: days = 5’d31 ; // all the rest have endcase end endmodule Reg defines a signal set in an always block. It does NOT define a register. Always block evaluates each time activity list changes. In this case each time month changes Case statement selects statement depending on value of argument. Like a truth table. Default covers values not listed. Can have multiple values per statement

37 (c) , W. J. Dally Verilog design style – for synthesizable modules 1.Combinational modules use only 1.Assign statements 2.Case or Casex statements (with default) 3.If statements – only if all signals have a default assignment 4.Instantiations of other combinational modules 2.Sequential modules use only 1.Combinational logic 2.Explicitly declared registers (flip-flops) 3.Do not use 1.Loops 2.Always blocks except for case, casex, or if 4.Do use 1.Signal concatenation, e.g., {a, b} = {c, d} 2.Signal subranges, e.g., a[7:1] = b[6:0] ; 5.Logic is organized into small modules 1.Leaf modules not more than 40 lines 2.If it could be made two modules, it should be

38 (c) , W. J. Dally Verilog design style – for synthesizable modules (page 2) 6.Use lots of comments 1.Comments themselves 2.Meaningful signal names – tempHigh, not th 3.Meaningful module names – DaysInMonth, not Mod3 7.Activation lists for case statements include ALL inputs (or use *) 8.Constants 1.All constants are `defined if used more than once 2.Width of all constants is specified 5’d31, not 31 9.Signals 1.Buses (multi-bit signals) are numbered high to low e.g., wire [31:0] bus 2.All signals should be high-true (except primary inputs and outputs) 10.Visualize the logic your Verilog will generate. If you can’t visualize it, the result will not be pretty

39 (c) , W. J. Dally Summary The world is digital –Systems are digital at their core, only analog on the edges Representing information –Binary signals, sets, continuous values Digital signals reject noise –Voltage range divided into discrete states –Noise margins Combinational logic –Output depends only on input (no state) Boolean algebra –Rules to manipulate logic equations Verilog –Describe hardware for simulation and synthesis

40 Next Time Fun with Karnaugh maps –Manual design of combinational circuits In real life you will synthesize these, but everyone needs to manually design a combinational circuit – just once. (c) , W. J. Dally