Basics of Logic Design - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Basics of Logic Design

Description:

Verilog. 4'b0100 : 4-bit constant with value 4, 4'd4 same ... Structure of Verilog Program. Structured as a set of modules. Module specifies inputs and outputs ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 22
Provided by: csP4
Category:
Tags: basics | design | logic | verilog

less

Transcript and Presenter's Notes

Title: Basics of Logic Design


1
Basics of Logic Design
  • Panickos Neophytou
  • CS0447
  • 11/16 11/21

2
Overview
  • Boolean Algebra Review
  • Logic Gates
  • Multiplexors
  • Verilog
  • ALU design

3
Boolean Algebra Review
  • Operators
  • OR written as , e.g. AB
  • AND written as , e.g. AB
  • NOT written as A
  • Laws of Boolean Algebra
  • Identity A0A and A1A
  • Zero and One laws A11 and A00
  • Inverse laws AA1 and AA0
  • Commutative laws ABBA and ABBA
  • Associative laws A(BC)(AB)C and
    A(BC)(AB) C.
  • Distributive laws A(BC)(AB)(AC) and
    A(BC)(AB) (AC)

4
Logic Gates
  • Gate device that implements basic logic
    functions, such as AND or OR.

5
Multiplexors
  • E.g. Two-input multiplexor

6
A 32bit wide 2-to-1 multiplexor
7
Introduction to Verilog
  • Data types
  • wire In Verilog, specifies a combinational signal
  • reg In Verilog, a register
  • reg 310 X
  • wire 310 X
  • Refer to contigious set of bits of a register or
    wire by starting bit ending bit
  • reg 310 registerfile031 An array of
    registers
  • Possible values 0, 1 (true, false), z (unknown).

8
Verilog
  • 4b0100 4-bit constant with value 4, 4d4 same
  • -8h4 8-bit constant with value -4 (in twos
    complement)
  • 162b01 32-bit value 0101010101
  • A3116,B150

9
Verilog Operators
  • Arithmentic ,-,,/
  • Logical ,,
  • Comparison ,!,gt,lt,gt,lt
  • Shift ltlt,gtgt
  • Unary logical ops ,, (e.g. A results in one
    bit by ANDing all of As bit together)

10
Structure of Verilog Program
  • Structured as a set of modules
  • Module specifies inputs and outputs
  • Body of a module consists
  • Initial constructs
  • Assignments
  • always constructs
  • Instances of other modules

11
always construct
  • Defines an optional list of constructs for which
    the block is sensitive
  • Reevaluated if any of the specified signals
    changes value. If no list is specified the it is
    constantly reevevaluted.

12
Assignments
  • Blocking assignment
  • Completed before the next assignment is carried
  • Non-blocking assignment lt
  • All right-hand sides of the assignments in an
    always block are done simultaneously.

13
Example
14
Construction a basic ALU
  • A 1-bit ALU

15
ALU
  • Full adder

16
Full Adder
17
CarryOut calculator
18
Sum
  • The Sum bit is set when exactly one input is 1 or
    when all three inputs are 1.

19
32-bit ALU adder
20
ALU in verilog
21
ALU control unit
Write a Comment
User Comments (0)
About PowerShow.com