1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.

Slides:



Advertisements
Similar presentations
Basics Combinational Circuits Sequential Circuits
Advertisements

컴퓨터구조론 교수 채수환. 교재 Computer Systems Organization & Architecture John D. Carpinelli, 2001, Addison Wesley.
Modular Combinational Logic
Logical Design.
Class Exercise 1A.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
التصميم المنطقي Second Course
Overview Part 2 – Combinational Logic
Arithmetic Operations and Circuits
Chapter 4 Gates and Circuits.
Combinational Logic Chapter 4.
1 EE365 Three-state Outputs Encoders Multiplexers XOR gates.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
Combinational Logic1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
ECE 301 – Digital Electronics
Lecture 3. Boolean Algebra, Logic Gates
Adders, subtractors, ALUs
CS 105 Digital Logic Design
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions.
Combinational Circuits Chapter 3 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 2003.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Combinational Logic Chapter 4. Digital Circuits Combinational Circuits Logic circuits for digital system Combinational circuits the outputs are.
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
Digital Logic Basics Chapter 2 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 
MSI Devices M. Mano & C. Kime: Logic and Computer Design Fundamentals (Chapter 5) Dr. Costas Kyriacou and Dr. Konstantinos Tatas ACOE161 - Digital Logic.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Documentation Standards Circuit specification. –Description of what the system is supposed to do, including a description of all inputs and outputs and.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
ECE 545—Digital System Design with VHDL Lecture 3
Multiplexers XOR gates. Multiplexers A multiplexer is a digital switch - it connects data from one of n sources to its output. An n-input and b-bit multiplexer.
Kuliah Rangkaian Digital Kuliah 6: Blok Pembangun Logika Kombinasional Teknik Komputer Universitas Gunadarma.
1 EE121 John Wakerly Lecture #6 Three-state Outputs Encoders Multiplexers XOR gates.
Lecture 9 Topics: –Combinational circuits Basic concepts Examples of typical combinational circuits –Half-adder –Full-adder –Ripple-Carry adder –Decoder.
EE2420 – Digital Logic Summer II 2013 Hassan Salamy Ingram School of Engineering Texas State University Set 12: Multiplexers, Decoders, Encoders, Shift.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
ES 244: Digital Logic Design Chapter 4 Chapter 4: Combinational Logic Uchechukwu Ofoegbu Temple University.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
Chapter 3 Digital Logic Structures
1 DLD Lecture 16 More Multiplexers, Encoders and Decoders.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
Explain Half Adder and Full Adder with Truth Table.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Mu.com.lec 11.  Used not only to perform addition but also to perform subtraction, multiplication and division  The most basic of the adders is the.
DIGITAL LOGIC CIRCUITS
Combinational Circuit Design
DIGITAL LOGIC CIRCUITS
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
5. Combinational circuits
ECE434a Advanced Digital Systems L02
Week 7: Gates and Circuits: PART II
13 Digital Logic Circuits.
Logic Circuits I Lecture 3.
Digital System Design Combinational Logic
Digital Logic Design Basics Combinational Circuits Sequential Circuits.
Presentation transcript:

1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks

2 Lecture Roadmap – Combinational Logic Basic Logic Review Basic Gates De Morgan’s Law Combinational Logic Building Blocks Multiplexers Decoders, Demultiplexers Encoders, Priority Encoders Arithmetic circuits ROM. Implementing combinational logic using ROM. Tri-state buffers.

3 Textbook References Combinational Logic Review Stephen Brown and Zvonko Vranesic, Fundamentals of Digital Logic with VHDL Design, 2 nd or 3 rd Edition  Chapter 2 Introduction to Logic Circuits ( only)  Chapter 6 Combinational-Circuit Building Blocks ( only) OR your undergraduate digital logic textbook (chapters on combinational logic)

4 Basic Logic Review some slides modified from: S. Dandamudi, “Fundamentals of Computer Organization and Design”

5 Basic Logic Gates (2-input versions)

6 Basic Logic Gates Generalized Simple logic gates AND  0 if one or more inputs is 0 OR  1 if one or more inputs is 1 NAND = AND + NOT 1 if one or more inputs is 0 NOR = OR + NOT 0 if one or more input is 1 XOR  1 if an odd number of inputs is 1 XNOR  1 if an even number of inputs is 1 NAND and NOR gates require fewer transistors than AND and OR in standard CMOS Functionality can be expressed by a truth table A truth table lists output for each possible input combination

7 Number of Functions Number of functions With N logical variables, we can define 2 2 N functions Some of them are useful AND, NAND, NOR, XOR, … Some are not useful: Output is always 1 Output is always 0 “Number of functions” definition is useful in proving completeness property

8 Complete Set of Gates Complete sets A set of gates is complete if we can implement any logic function using only the type of gates in the set Some example complete sets {AND, OR, NOT} Not a minimal complete set {AND, NOT} {OR, NOT} {NAND} {NOR} Minimal complete set A complete set with no redundant elements.

9 NAND as a Complete Set Proving NAND gate is universal

10 Logic Functions Logic functions can be expressed in several ways: Truth table Logical expressions Graphical schematic form HDL code Example: Majority function Output is one whenever majority of inputs is 1 We use 3-input majority function

11 Alternative Representations of Logic Function Truth table ABCF Logical expression form F = A B + B C + A C Graphical schematic form F <= (A AND B) OR (B AND C) OR (A AND C) ; HDL code:

12 Boolean Algebra Boolean identities Name AND versionOR version Identityx. 1 = xx + 0 = x Complementx. x’ = 0x + x’ = 1 Commutativex. y = y. xx + y = y + x Distributionx. (y+z) = xy+xzx + (y. z) = (x+y) (x+z) Idempotentx. x = xx + x = x Nullx. 0 = 0x + 1 = 1

13 Boolean Algebra (cont’d) Boolean identities (cont’d) Name AND versionOR version Involutionx = (x’)’ --- Absorptionx. (x+y) = xx + (x. y) = x Associativex. (y. z) = (x. y). zx + (y + z) = (x + y) + z de Morgan (x. y)’ = x’ + y’ (x + y)’ = x’. y’ (de Morgan’s law in particular is very useful)

14 Alternative symbols for NAND and NOR

15 Majority Function Using Other Gates Using NAND gates Get an equivalent expression A B + C D = (A B + C D)’’ Using de Morgan’s law A B + C D = ( (A B)’. (C D)’)’ Can be generalized Example: Majority function A B + B C + AC = ((A B)’. (B C)’. (AC)’)’

16 Majority Function Using Other Gates (cont'd) Majority function

17 Combinational Logic Building Blocks Some slides modified from: S. Dandamudi, “Fundamentals of Computer Organization and Design” S. Brown and Z. Vranesic, "Fundamentals of Digital Logic"

18 Multiplexers multiplexer n binary inputs (binary input = 1-bit input) log 2 n binary selection inputs 1 binary output Function: one of n inputs is placed onto output Called n-to-1 multiplexer n inputs1 output log 2 n selection inputs

19 2-to-1 Multiplexer (a) Graphical symbol f s w 0 w (b) Truth table 0 1 f f s w 0 w 1 (c) Sum-of-products circuit s w 0 w 1 (d) Circuit with transmission gates w 0 w 1 f s Source: Brown and Vranesic

20 4-to-1 Multiplexer f s 1 w 0 w (b) Truth table w 0 w 1 s 0 w 2 w fs 1 0 s 0 w 2 w 3 f (c) Circuit s 1 w 0 w 1 s 0 w 2 w 3 (a) Graphic symbol Source: Brown and Vranesic

21 Multi-bit 4-to-1 Multiplexer When drawing schematics, can draw multi-bit multiplexers Example: 8-bit 4-to-1 multiplexer 4 inputs (each 8 bits) 1 output (8 bits) 2 selection bits Can also have multi-bit 2-to-1 muxes, 16-to-1 muxes, etc. f s 1 w 0 w (b) Truth table w 0 w 1 s 0 w 2 w fs 1 0 s 0 w 2 w 3 (a) Graphic symbol 8 8

22 8-bit 4-to-1 Multiplexer f(7) s s f(6) s s f(0) s s w 0 (7) w 1 (7) w 2 (7) w 3 (7) w 0 (6) w 1 (6) w 2 (6) w 3 (6) w 0 (0) w 1 (0) w 2 (0) w 3 (0) An 8-bit 4-to-1 multiplexer is composed of eight [1-bit] 4-to-1 multiplexers f s 1 w 0 w s 0 w 2 w =

23 Decoders Decoder n binary inputs 2 n binary outputs Function: decode encoded information If enable=1, one output is asserted high, the other outputs are asserted low If enable=0, all outputs asserted low Often, enable pin is not needed (i.e. the decoder is always enabled) Called n-to-2 n decoder Can consider n binary inputs as a single n-bit input Can consider 2 n binary outputs as a single 2 n -bit output Decoders are often used for RAM/ROM addressing n-1 w 0 n inputs En Enable 2 n outputs y 0 w y 2 n 1–

24 2-to-4 Decoder y 3 w 1 0 w 0 (c) Logic circuit w 1 w En y y y y 0 y 1 y 2 y 3 w 1 y 3 w 0 y 2 y 1 y 0 (a) Truth table(b) Graphical symbol Source: Brown and Vranesic

25 Demultiplexers Demultiplexer 1 binary input n binary outputs log 2 n binary selection inputs Function: places input onto one of n outputs, with the remaining outputs asserted low Called 1-to-n demultiplexer Closely related to decoder Can build 1-to-n demultiplexer from log 2 n-to-n decoder by using the decoder's enable signal as the demultiplexer's input signal, and using decoder's input signals as the demultiplexer's selection input signals. n outputs1 input log 2 n selection inputs

26 1-to-4 Demultiplexer

27 Encoders 2 n inputs w 0 y 0 y n1– n outputs Encoder 2 n binary inputs n binary outputs Function: encodes information into an n-bit code Called 2 n -to-n encoder Can consider 2 n binary inputs as a single 2 n -bit input Can consider n binary output as a single n-bit output Encoders only work when exactly one binary input is equal to 1 w 2 n 1–

28 4-to-2 Encoder w 3 y 1 0 y 0 (b) Circuit w 1 w w w w y 0 w 2 w 3 y 1 (a) Truth table

29 Priority Encoders 2 n inputs w 0 w 2 n 1– y 0 y n1– n outputs Priority Encoder 2 n binary inputs n binary outputs 1 binary "valid" output Function: encodes information into an n-bit code based on priority of inputs Called 2 n -to-n priority encoder Priority encoder allows for multiple inputs to have a value of '1', as it encodes the input with the highest priority (MSB = highest priority, LSB = lowest priority) "valid" output indicates when priority encoder output is valid Priority encoder is more common than an encoder z "valid" output

30 4-to-2 MSB Priority Encoder w 0 y 1 - y z w w w

31 Single-Bit Adders Half-adder Adds two binary (i.e. 1-bit) inputs A and B Produces a sum and carryout Problem: Cannot use it alone to build larger adders Full-adder Adds three binary (i.e. 1-bit) inputs A, B, and carryin Like half-adder, produces a sum and carryout Allows building M-bit adders (M > 1) Simple technique Connect C out of one adder to C in of the next These are called ripple-carry adders

32 Half-Adder x y c s HA x + y = ( c s ) xyc s

33 Full-Adder x y c out s FA x + y + c in = ( c out s ) xy c out s c in x y s c out

34 16-bit Unsigned Adder 16 XY CinCout S +

35 Multi-Bit Ripple-Carry Adder A 16-bit ripple-carry adder is composed of 16 (1-bit) full adders Inputs: 16-bit A, 16-bit B, 1-bit carry in (set to zero in the figure below) Outputs: 16-bit sum S, 1-bit carry out Other multi-bit adder structures can be studied in ECE 645—Computer Arithmetic Called a ripple-carry adder because carry ripples from one full-adder to the next. Critical path is 16 full-adders.

36 Comparator Used two compare two M-bit numbers and produce a flag (M >1) Inputs: M-bit input A, M-bit input B Output: 1-bit output flag 1 indicates condition is met 0 indicates condition is not met Can compare: >, >=, <, <=, =, etc. A > B? A B 1 if A > B 0 if A <= B M M

37 Example: 4-bit comparator (A = B) A = B? A B 1 if A = B 0 if A != B 4 4

38 4x4-bit Unsigned Multiplier 4 4 ab 8 c * U

39 4x4-bit Signed Multiplier 4 4 ab 8 c S *

40 Unsigned vs. Signed Multiplication 1111 x x x x 1 UnsignedSigned

Quotient and remainder Given integers a and n, n>0  ! q, r  Z such that a = q  n + r and 0  r < n q – quotient r – remainder (of a divided by n) q = a n = a div n r = a - q  n = a – a n  n = = a mod n 41

Rules of addition, subtraction and multiplication modulo n a + b mod n = ((a mod n) + (b mod n)) mod n a - b mod n = ((a mod n) - (b mod n)) mod n a  b mod n = ((a mod n)  (b mod n)) mod n 42

43 Logical Shift Right A(3) A(2) A(1) A(0) ‘0’‘0’A(3)A(2)A(1) A C 4 4 A C >>1 L

44 Arithmetic Shift Right A(3) A(2) A(1) A(0) A(3)A(2)A(1) A C 4 4 A C >>1 A(3) A

45 Fixed Rotation A(3) A(2) A(1) A(0) A(2)A(1)A(0)A(3) A 4 4 A C <<< 1 C

46 8-bit Variable Rotator Left A B C A <<< B

47 Read Only Memory (ROM) ROM ADDRDOUT m n

48 Implementing Arbitrary Combinational Logic Using ROM ROM ADDRDOUT 5 1

49 (b) Equivalent circuit (c) Truth table x f e (a) A tri-state buffer Z Z 0 1 f ex x f e = 0 e = 1 x f Tri-state Buffer

50 Four types of Tri-state Buffers