LECTURE 2: Delay models, std_ulogic and. EECS 316 CAD Computer Aided Design. with-select-when. Chris Papachristou Case Western Reserve University

Similar documents
ECE 407 Computer Aided Design for Electronic Systems. Simulation. Instructor: Maria K. Michael. Overview

Computer organization

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #2 Nov 22, 2006

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

Written exam for IE1204/5 Digital Design with solutions Thursday 29/

Review for Final Exam

Floating Point Representation and Digital Logic. Lecture 11 CS301

Written exam with solutions IE Digital Design Friday 21/

EE 209 Logic Cumulative Exam Name:

Problem Set 6 Solutions

Adders, subtractors comparators, multipliers and other ALU elements

Adders, subtractors comparators, multipliers and other ALU elements

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

CprE 281: Digital Logic

Written exam with solutions IE1204/5 Digital Design Monday 23/

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Design of Sequential Circuits

Vidyalankar. S.E. Sem. III [EXTC] Digital System Design. Q.1 Solve following : [20] Q.1(a) Explain the following decimals in gray code form

Gates and Flip-Flops

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

ALU A functional unit

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

ECE/CS 250 Computer Architecture

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Boolean Logic Prof. James L. Frankel Harvard University. Version of 3:20 PM 29-Aug-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved.

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

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Lecture 7: Logic design. Combinational logic circuits

Review for Test 1 : Ch1 5

Topics. CMOS Design Multi-input delay analysis. John A. Chandy Dept. of Electrical and Computer Engineering University of Connecticut

Latches. October 13, 2003 Latches 1

Lecture 6: Logical Effort

CHAPTER * 2-2.* Pearson Education Limited Problem Solutions, Global Edition Chapter 2. Verification of DeMorgan s Theorem

Homework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker

ECE429 Introduction to VLSI Design

EE141-Fall 2011 Digital Integrated Circuits

Fundamentals of Digital Design

CS61C : Machine Structures

SUMMER 18 EXAMINATION Subject Name: Principles of Digital Techniques Model Answer Subject Code:

Acknowledgment. DLD Lab. This set of slides on VHDL are due to Brown and Vranesic.

ECE 2300 Digital Logic & Computer Organization

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

RAO PAHALD SINGH GROUP OF INSTITUTIONS BALANA(MOHINDER GARH)123029

Combinational Logic. Course Instructor Mohammed Abdul kader

EE 447 VLSI Design. Lecture 5: Logical Effort

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Chapter 2 Combinational Logic Circuits

EECS 312: Digital Integrated Circuits Final Exam Solutions 23 April 2009

STEADY CODES WITH HAMMING- DISTANCES 1 AND 2 DGT D = 1 C 2 D = 2 C 1 C Digital Circuits. Hamburg. Prof. Dr. F.

Digital Control of Electric Drives

DE58/DC58 LOGIC DESIGN DEC 2014

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

DIGITAL LOGIC CIRCUITS

Luleå Tekniska Universitet Kurskod SMD098 Tentamensdatum

COE 328 Final Exam 2008

Boolean Logic Continued Prof. James L. Frankel Harvard University

Combinational Logic Design Combinational Functions and Circuits

Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

CS61C : Machine Structures

CS/COE0447: Computer Organization

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

UNIVERSITY OF WISCONSIN MADISON

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

Simplify the following Boolean expressions and minimize the number of literals:

Digital Logic (2) Boolean Algebra

Written exam with solutions IE1204/5 Digital Design Friday 13/

Pin Details of Digital Logic Gates:

Lecture A: Logic Design and Gates

S No. Questions Bloom s Taxonomy Level UNIT-I

And Inverter Graphs. and and nand. inverter or nor xor

VLSI Design, Fall Logical Effort. Jacob Abraham

Review: Additional Boolean operations

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

University of Toronto Faculty of Applied Science and Engineering Final Examination

Chapter 7. Sequential Circuits Registers, Counters, RAM

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Systems I: Computer Organization and Architecture

Semiconductor memories

COMBINATIONAL LOGIC FUNCTIONS

CS/COE0447: Computer Organization

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

CMPEN 411. Spring Lecture 18: Static Sequential Circuits

C.K. Ken Yang UCLA Courtesy of MAH EE 215B

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

For smaller NRE cost For faster time to market For smaller high-volume manufacturing cost For higher performance

control in out in out Figure 1. Binary switch: (a) opened or off; (b) closed or on.

Circuit A. Circuit B

Lecture 9: Digital Electronics

Digital Electronics Final Examination. Part A

NTE4514B & NTE4515B Integrated Circuit CMOS, 4 Bit Latch/4 to 16 Line Decoder

Philadelphia University Student Name: Student Number:

Combinatorial and Sequential CMOS Circuits Dr. Lynn Fuller Webpage:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

Laboratory Exercise #8 Introduction to Sequential Logic

HN27C4096G/CC Series. Ordering Information. Features word 16-bit CMOS UV Erasable and Programmable ROM

Transcription:

CAD Computer Aided Design LECTURE 2: Delay models, std_ulogic and with-select-when Instructor: Francis G. Wolff wolff@eecs.cwru.edu Chris Papachristou Case Western Reserve University

Review: Full Adder: Truth Table

Review: Full Adder: Architecture Entity Declaration ENTITY full_adder IS PORT (x, y, z: Sum, Carry: ); END full_adder; IN std_logic; OUT std_logic Optional Entity END name; Architecture Declaration ARCHITECTURE full_adder_arch_1 OF full_adder IS BEGIN Sum <= ( ( x XOR y ) XOR z ); Carry <= (( x AND y ) OR (z AND (x AND y))); END full_adder_arch_1; Optional Architecture END name;

Review: SIGNAL: Scheduled Event SIGNAL Like variables in a programming language such as C, signals can be assigned values, e.g. 0, 1 However, SIGNALs also have an associated time value A signal receives a value at a specific point in time and retains that value until it receives a new value at a future point in time (i.e. scheduled event) The waveform of the signal is a sequence of values assigned to a signal over time For example wave <= 0, 1 after 10 ns, 0 after 15 ns, 1 after 25 ns;

Review: Full Adder: Architecture with Delay ARCHITECTURE full_adder_arch_2 OF full_adder IS SIGNAL S1, S2, S3: std_logic; BEGIN s1 <= ( a XOR b ) after 15 ns; s2 <= ( c_in AND s1 ) after 5 ns; s3 <= ( a AND b ) after 5 ns; Sum <= ( s1 XOR c_in ) after 15 ns; Carry <= ( s2 OR s3 ) after 5 ns; END; Signals (like wires) are not PORTs they do not have direction (i.e. IN, OUT)

Signal order: Does it matter? No ARCHITECTURE full_adder_arch_2 OF full_adder IS SIGNAL S1, S2, S3: std_logic; BEGIN s1 <= ( a XOR b ) after 15 ns; s2 <= ( c_in AND s1 ) after 5 ns; s3 <= ( a AND b ) after 5 ns; Sum <= ( s1 XOR c_in ) after 15 ns; Carry <= ( s2 OR s3 ) after 5 ns; END; ARCHITECTURE full_adder_arch_3 OF full_adder IS SIGNAL S1, S2, S3: std_logic; BEGIN Carry <= ( s2 OR s3 ) after 5 ns; Sum <= ( s1 XOR c_in ) after 15 ns; s3 <= ( a AND b ) after 5 ns; s2 <= ( c_in AND s1 ) after 5 ns; s1 <= ( a XOR b ) after 15 ns; END; No, this is not C! Netlists have same beha vior & parall el

Delta Delay

Delta Delay: Example using scheduling

Inertial Delay

Inverter model: lowpass filter (inertial) Short pulses = High frequency which get filtered out by cmos capacitance R 1 V in V out C 2 Long pulses = low frequency which pass through

Transport Delay

Inertial and Transport Delay Sig a b Transport Delay is useful for modeling data buses, networks Inertial Delay is useful for modeling logic gates

Combinatorial Logic Operators #Transistors 2 NOT z <= NOT (x); z<= NOT x; 2+2i AND z <= x AND y; 2i NAND z <= NOT (x AND y); 2+2i OR z <= x OR y; 2i 10 12 NOR XOR XNOR z <= NOT (x OR Y); z <= (x and NOT y) OR (NOT x AND y); z <= (x AND y) NOR (x NOR y); --AOI z <= (x and y) OR (NOT x AND NOT y); z <= (x NAND y) NAND (x OR y); --OAI Footnote: (i=#inputs) We are only referring to CMOS static transistor ASIC gate designs Exotic XOR designs can be done in 6 (J. W. Wang, IEEE J. Solid State Circuits, 29, July 1994)

Std_logic AND: Un-initialized value NOT 0 1 U 1 0 U AND 0 1 U 0 0 0 0 1 0 1 U U 0 U U OR 0 1 U 0 0 1 U 1 1 1 1 U U 1 U 0 AND <anything> is 0 0 NAND <anything> is 1 1 OR <anything> is 1 1 NOR <anything> is 0

SR Flip-Flop (Latch) R S Q Q NOR R S Q n+1 0 0 Q n 0 1 1 1 0 0 1 1 U Q <= R NOR NQ; NQ <= S NOR Q; R S Q Q NAND R S Q n+1 0 0 U 0 1 1 1 0 0 1 1 Q n Q <= R NAND NQ; NQ <= S NAND Q;

SR Flip-Flop (Latch) NAND R S Q n+1 0 0 U 0 1 1 1 0 0 1 1 Q n R S Q Q R(t) Q(t) Q(t) S(t) 5ns Q(t + 5ns) 5ns Q(t + 5ns) With Delay Example: R <= 1, 0 after 10ns, 1 after 30ns; S <= 1 ; t 0 5ns 10ns 15ns 20ns 25ns 30ns 35ns 40ns R 1 1 0 0 0 0 1 1 1 Q U U U U 0 0 0 0 0 Q U U U 1 1 1 1 1 1 S 1 1 1 1 1 1 1 1 1

Std_logic AND: X Forcing Unknown Value NOT 0 X 1 U 1 X 0 U AND 0 X 1 U 0 0 0 0 0 X 0 X X U 1 0 X 1 U U 0 U U U 0 AND <anything> is 0 0 NAND <anything> is 1 OR 0 X 1 U 0 0 X 1 U X X X 1 U 1 1 1 1 1 U U U 1 U 1 OR <anything> is 0 0 NOR <anything> is 1

The rising transition signal Vcc=5.5 25 C 1 > 3.85 Volts H X W L Unknown 2.20 Volt gap 0 < 1.65 Volts

Modeling logic gate values: std_ulogic TYPE std_ulogic IS ( -- Unresolved LOGIC Z, -- High Impedance (Tri-State) 1, -- Forcing 1 H, -- Weak 1 X, -- Forcing Unknown: i.e. combining 0 and 1 ); W, L, -- Weak 0 0, -- Forcing 0 U, -- Weak Unknown: i.e. combining H and L -- Un-initialized -, -- Don t care Example: multiple drivers 0 1 1 1 1 0 X

Multiple output drivers: Resolution Function U X 0 L Z W H 1 - U U U U U U U U U U X U X X X X X X X X 0 U X 0 0 0 0 0 X X L USuppose X that 0 L L W W 1 X Z U the first gate outputs a 1 X 0 L Z W the second gate outputs a 0 H 1 X W Uthen X 0 W W W W 1 X H U the mult-driver output is X X 0 W H W X: forcing unknown value by H 1 X 1 U Xcombining X 1 1and 0 together 1 1 1 1 X - U X X X X X X X X

Multiple output drivers: Resolution Function U X 0 L Z W H 1 - U U U U U U U U U U X X X X X X X X X 0 0 0 0 0 0 X X L L L W W 1 X Z Observe that 0 pulls down all Z W H 1 X W weak signals to 0 W W 1 X H H <driving> L => W H 1 X 1 1 X - X Note the multi-driver resolution table is symmetrical

Resolution Function: std_logic buffer gate 0 W, Z L H 1 std_ulogic std_logic 0 0 X 1 1 input: U 0 L W X Z H 1 - output: U 0 0 X X X 1 1 X 0 or L becomes 0 H or 1 becomes 1 Transition zone becomes X

Resolving input: std_logic AND GATE std_ulogic W X std_logic std_logic std_ulogic 1 1 std_logic X Process each input as an unresolved to resolved buffer. Then process the gate as a standard logic gate { 0, X, 1, U } For example, let s transform z <= W AND 1 ; z <= W AND 1 ; -- convert std_ulogic W to std_logic X z <= X AND 1 ; -- now compute the std_logic AND z <= X ;

2-to-1 Multiplexor: with-select-when a b 2 S 6 6 Y <= (a AND NOT s) OR (b AND s); structural 6 20 Transistors combinatorial logic OTHERS includes 1,U,L,W,X,H,Z Y a b 0 1 S Y WITH s SELECT Y <= a WHEN 0, b WHEN 1 ; behavioral or more general Only values allowed WITH s SELECT Y <= a WHEN 0, b WHEN OTHERS;

4-to-1 Multiplexor: with-select-when Structural Combinatorial logic Y <= sa OR sb OR sc OR sd; sa <= a AND ( NOT s(1) AND NOT s(0) ); sb <= b AND ( NOT s(1) AND s(0) ); sc <= c AND ( s(1) AND NOT s(0) ); a b c d 00 01 10 11 Y sd <= d AND ( s(1) AND s(0) ); As the complexity of the combinatorial logic grows, the SELECT statement, simplifies logic design but at a loss of structural information Note the comma after WHEN WITH s SELECT Y <= a WHEN 00, b WHEN 01, c WHEN 10, d WHEN OTHERS; S behavioral

with-select-when: 2 to 4-line Decoder 6 8 Y 3 Y 2 SIGNAL S: std_logic_vector(1 downto 0); SIGNAL Y: std_logic_vector(3 downto 0); 8 Y 1 S 1 Y 3 Y 2 S 0 Y 1 10 Y 0 Y 0 S 1 S 0 Replace this with a NOR, then 26 total transistors 32 Transistors WITH S SELECT Y <= 1000 WHEN 11, 0100 WHEN 10, 0010 WHEN 01, 0001 WHEN OTHERS;

Tri-State buffer oe x y ENTITY TriStateBuffer IS PORT(x: IN std_logic; y: OUT std_logic; oe: IN std_logic ); END; ARCHITECTURE Buffer3 OF TriStateBuffer IS BEGIN WITH oe SELECT y <= x WHEN 1, -- Enabled: y <= x; Z WHEN OTHERS; -- Disabled: output a tri-state END;

Inverted Tri-State buffer oe x y ENTITY TriStateBufferNot IS PORT(x: IN std_logic; y: OUT std_logic; oe: IN std_logic ); END; ARCHITECTURE Buffer3 OF TriStateBufferNot IS BEGIN WITH oe SELECT y <= NOT(x) WHEN 1, -- Enabled: y <= Not(x); Z WHEN OTHERS; -- Disabled END;

ROM: 4 byte Read Only Memory A 1 A 0 Y 3 Y 2 Y 1 4 byte by 1 bit ROM ARRAY Y 0 O E D 0

ROM: 4 byte Read Only Memory ENTITY rom_4x1 IS PORT(A: IN std_logic_vector(1 downto 0); OE: IN std_logic; -- Tri-State Output D: OUT std_logic ); END; ARCHITECTURE rom_4x1_arch OF rom_4x1 IS SIGNAL ROMout: std_logic; Component Instance BEGIN BufferOut: TriStateBuffer PORT MAP(ROMout, D, OE); WITH A SELECT ROMout <= 1 WHEN 00, 0 WHEN 01, 0 WHEN 10, 1 WHEN 11 ; Component declaration name

Component Declaration/Instance relationship ARCHITECTURE rom_4x1_arch OF rom_4x1 IS Component Declaration COMPONENT TriStateBuffer PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; Colon (:) says make a SIGNAL ROMout: std_logic; Component Instance BEGIN BufferOut: TriStateBuffer PORT MAP(ROMout, D, OE); WITH A SELECT ROMout <= 1 WHEN 00, 0 WHEN 01, 0 WHEN 10, 1 WHEN 11 ; END; Component Instance Name: BufferOut

Component Port relationship oe OE IN oe IN x COMPONENT TriStateBuffer y D OUT y OUT PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; BufferOut: TriStateBuffer PORT MAP(ROMout, D, OE); ENTITY rom_4x1 IS PORT(A: IN std_logic_vector(1 downto 0); OE: IN std_logic; -- Tri-State Output D: OUT std_logic ); END;

Assignment #2 (Part 1 of 3) 1) Assume each gate is 5 ns delay for the above circuit. (a) Write entity-architecture for a inertial model (b) Given the following waveform, draw, R, S, Q, NQ (inertial) R <= 1, 0 after 25 ns, 1 after 30 ns, 1 after 50 ns; S <= 0, 1 after 20 ns, 0 after 35 ns, 1 after 50 ns; (c) Repeat (b) but now assume each gate is 20 ns delay (d) Write entity-architecture for a transport model (e) Given the waveform in (b) draw, R, S, Q, NQ (transport)

Assignment #2 (Part 2 of 3) X a F Y b G (2) Given the above two tri-state buffers connected together ( assume transport model of 5ns per gate), draw X, Y, F, a, b, G for the following input waveforms: X <= 1, 0 after 10 ns, X after 20 ns, L after 30 ns, 1 after 40 ns; Y <= 0, L after 10 ns, W after 20 ns, 0 after 30 ns, Z after 40 ns; F <= 0, 1 after 10 ns, 0 after 50 ns;

Assignment #2 (Part 3 of 3) 3) Write (no programming) a entity-architecture for a 1-bit ALU. The input will consist of x, y, Cin, f and the output will be S and Cout. Make components for 1-bit add/sub. The input function f (with-select) will enable the following operations: function f ALU bit operation 000 S = 0; Cout = 0 001 S = x 010 S = y; Cout =1; 011 S = Cin; Cout = x 100 S = x OR y; Cout=x; 101 S = x AND y; Cout=x; x y C in ALU 110 (Cout, S) = x + y + Cin; (component) 111 (Cout, S) = full subtractor (component) f S C out