CWRU EECS 317 EECS 317 CAD Computer Aided Design LECTURE 2: Delay models, std_ulogic and with-select-when Instructor: Francis G. Wolff

Slides:



Advertisements
Similar presentations
ADDER, HALF ADDER & FULL ADDER
Advertisements

Adders and Subtractors
L23 – Adder Architectures. Adders  Carry Lookahead adder  Carry select adder (staged)  Carry Multiplexed Adder  Ref: text Unit 15 9/2/2012 – ECE 3561.
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Carry Lookahead Homework
CWRU EECS 3221 Language of the Machine EECS 322 Computer Architecture Instructor: Francis G. Wolff Case Western Reserve University.
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Introduction To VHDL for Combinational Logic
Lecture #28 Page 1 ECE 4110– Sequential Logic Design Lecture #28 Agenda 1.Counters Announcements 1.HW #13 assigned 2.Next: Test #2 Review.
Multiplexers Section 3-7 Mano & Kime. Multiplexers & Demultiplexers Multiplexers (Selectors) Lab 1 – Behavioral VHDL -- Multiplexers MUX as a Universal.
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
LECTURE 4: The VHDL N-bit Adder
1 EE24C Digital Electronics Project Theory: Sequential Logic (part 2)
EECS 318 CAD Computer Aided Design LECTURE 2: DSP Architectures Instructor: Francis G. Wolff Case Western Reserve University This presentation.
CWRU EECS 317 EECS 317 Computer Design LECTURE 6: State machines Instructor: Francis G. Wolff Case Western Reserve University This.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 4: Delay models & std_ulogic Instructor: Francis G. Wolff Case Western Reserve.
Adder Discussion D6.2 Example 17. s i = c i ^ (a i ^ b i ) c i+1 = a i * b i + c i * (a i ^ b i ) Full Adder (Appendix I)
1 EE 616 Computer Aided Analysis of Electronic Networks Lecture 11 Instructor: Dr. J. A. Starzyk, Professor School of EECS Ohio University Athens, OH,
CK Cheng Tuesday 10/2/02 CS 140 Lecture 2. Part I. Combinational Logic I) Specification –a. Language –b. Truth Table –c. Boolean Algebra –d. Incompletely.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
ECE 301 – Digital Electronics
CSCI 1412 Logic Gates Parminder Kang Home: Phones OFF Please.
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Floating Point – Finite State Machines – Combinational Logic – Sequential Logic 2.
Binary Addition CSC 103 September 17, 2007.
1. Copyright  2005 by Oxford University Press, Inc. Computer Architecture Parhami2 Figure 10.1 Truth table and schematic diagram for a binary half-adder.
Binary Addition Section 4.5. Binary Addition Example.
ECE 3130 – Digital Electronics and Design
CWRU EECS 3221 Benchmarks EECS 322 Computer Architecture Instructor: Francis G. Wolff Case Western Reserve University This presentation.
CWRU EECS 317 EECS 317 CAD Computer Aided Design LECTURE 3: Synopsys Simulator Instructor: Francis G. Wolff Case Western Reserve University.
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
LECTURE 8: VHDL PROCESSES
Digital Electronics Lecture 6 Combinational Logic Circuit Design.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE Simulator 1: Synopsys Simulator Instructor: Francis G. Wolff Case Western.
LECTURE 7: VHDL Standard Cell Library Package
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Basic Overview of VHDL Matthew Murach Slides Available at:
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 5: AOIs, WITH-SELECT-WHEN, WHEN-ELSE Instructor: Francis G. Wolff Case Western.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
Lecture 11, Advance Digital Design
Universal college of engineering & technology. .By Harsh Patel)
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Logic and computers 2/6/12. Binary Arithmetic /6/ Only two digits: the bits 0 and 1 (Think: 0 = F, 1.
Sneha.  A combinational circuit that performs the addition of two bits is called a half adder.  It has two inputs.  It has two outputs.
IB Computer Science – Logic
Computer Architecture Lecture 16 Fasih ur Rehman.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 3: The VHDL N-bit Adder Instructor: Francis G. Wolff Case Western Reserve.
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
Computer Architecture
Computer Architecture Lecture 15 Fasih ur Rehman.
Figure S1.1 The Motorola MPC 7400 PowerPC CPU. Figure S1.3 Truth table for INCLUSIVE-OR operation.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE Simulator 2: Textio, Wait, Clocks, and Test Benches Instructor: Francis G. Wolff
Explain Half Adder and Full Adder with Truth Table.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 6: State machines Instructor: Francis G. Wolff Case Western Reserve University.
Improving Memory Access The Cache and Virtual Memory
Combinational Circuits
Computer Architecture CST 250
ENG6530 Reconfigurable Computing Systems
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
Elec 2607 Digital Switching Circuits
مقدمه ای بر مهارت های زندگی
ECE 301 – Digital Electronics
Week 7: Gates and Circuits: PART II
Number Systems and Circuits for Addition
DIGITAL ELECTRONICS B.SC FY
XOR Function Logic Symbol  Description  Truth Table 
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
Presentation transcript:

CWRU EECS 317 EECS 317 CAD Computer Aided Design LECTURE 2: Delay models, std_ulogic and with-select-when Instructor: Francis G. Wolff Case Western Reserve University This presentation uses animation: please viewshow

CWRU EECS 317 Review: Full Adder: Truth Table

CWRU EECS 317 Review: Full Adder: Architecture ENTITY full_adder IS PORT (x, y, z:IN std_logic; Sum, Carry:OUT std_logic ); END full_adder; 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; 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; Entity Declaration Optional Entity END name; Architecture Declaration

CWRU EECS 317 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) For example wave <= ‘0’, ‘1’ after 10 ns, ‘0’ after 15 ns, ‘1’ after 25 ns; The waveform of the signal is a sequence of values assigned to a signal over time

CWRU EECS 317 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)

CWRU EECS 317 Signal order: 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; 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; No, this is not C! Net- lists have same beha vior & paral lel No, this is not C! Net- lists have same beha vior & paral lel Does it matter?No

CWRU EECS 317 Delta Delay

CWRU EECS 317 Delta Delay: Example using scheduling

CWRU EECS 317 Inertial Delay

CWRU EECS 317 Inverter model: lowpass filter (inertial) V out R1R1 C2C2 V in Short pulses = High frequency which get filtered out by cmos capacitance Long pulses = low frequency which pass through

CWRU EECS 317 Transport Delay

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

CWRU EECS 317 Combinatorial Logic Operators ANDz <= x AND y; NANDz <= NOT (x AND y); NORz <= NOT (x OR Y); ORz <= x OR y; NOTz <= NOT (x); z<= NOT x; XORz <= (x and NOT y) OR (NOT x AND y); z <= (x AND y) NOR (x NOR y); --AOI XNORz <= (x and y) OR (NOT x AND NOT y); z <= (x NAND y) NAND (x OR y); --OAI 2 2+2i 2i2i 2i2i #Transistors 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)

CWRU EECS 317 Std_logic AND: Un-initialized value AND01U U U0UU OR01U 001U 1111 UU1U 0 AND is 0 0 NAND is 1 1 OR is 1 1 NOR is 0 NOT01U 10U

CWRU EECS 317 SR Flip-Flop (Latch) R S Q Q NAND R S Q n U Q n R S Q Q NOR R S Q n Q n U Q <= R NOR NQ; NQ <= S NOR Q; Q <= R NAND NQ; NQ <= S NAND Q;

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

CWRU EECS 317 Std_logic AND: X Forcing Unknown Value AND0X1U X0XXU 10X1U U0UUU 0 AND is 0 0 NAND is 1 OR0X1U 00X1U XXX1U UUU1U 1 OR is 0 0 NOR is 1 NOT0X1U 1X0U

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

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

CWRU EECS 317 Multiple output drivers: Resolution Function UX0LZWH 1- UUUUUUUUUU XUXXXXXXXX 0UX00000XX LUX0LLWW1X ZUX0LZWH1X WUX0WWWW1X HUX0WHWH1X 1UXX11111X -UXXXXXXXX Suppose that the first gate outputs a 1 the second gate outputs a 0 then the mult-driver output is X X: forcing unknown value by combining 1 and 0 together

CWRU EECS 317 Multiple output drivers: Resolution Function UX0LZWH 1- UUUUUUUUUU X XXXXXXXX XX L LLWW1X Z ZWH1X W WW1X H H1X 1 1X - X Note the multi-driver resolution table is symmetrical Observe that 0 pulls down all weak signals to 0 H L => W

CWRU EECS 317 Resolution Function: std_logic buffer gate input: U0LWXZH 1- output: U00XXX11X 0 or L becomes 0 H or 1 becomes 1 Transition zone becomes X 1 H W, Z L X 0 0 std_logic std_ulogic

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

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

CWRU EECS to-1 Multiplexor: with-select-when 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) ); sd <= d AND ( s(1) AND s(0) ); 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) ); sd <= d AND ( s(1) AND s(0) ); WITH s SELECT Y <=a WHEN “00”, b WHEN “01”, c WHEN “10”, d WHEN OTHERS; abcdabcd S Y As the complexity of the combinatorial logic grows, the SELECT statement, simplifies logic design but at a loss of structural information Structural Combinatorial logic behavioral Note the comma after WHEN

CWRU EECS 317 with-select-when: 2 to 4-line Decoder WITH S SELECT Y <= “1000” WHEN “11”, “0100” WHEN “10”, “0010” WHEN “01”, “0001” WHEN OTHERS; Y1Y1 Y0Y0 Y2Y2 Y3Y3 S0S0 S1S1 SIGNAL S: std_logic_vector(1 downto 0); SIGNAL Y: std_logic_vector(3 downto 0); SIGNAL S: std_logic_vector(1 downto 0); SIGNAL Y: std_logic_vector(3 downto 0); S1S1 S0S0 Y1Y1 Y0Y0 Y2Y2 Y3Y Transistors Replace this with a NOR, then 26 total transistors

CWRU EECS 317 Tri-State buffer oe y x ENTITY TriStateBuffer IS PORT(x:INstd_logic; y:OUTstd_logic; oe: INstd_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;

CWRU EECS 317 Inverted Tri-State buffer oe y x ENTITY TriStateBufferNot IS PORT(x:INstd_logic; y:OUTstd_logic; oe: INstd_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;

CWRU EECS 317 ROM: 4 byte Read Only Memory Y1Y1 Y0Y0 Y2Y2 Y3Y3 A0A0 A1A1 D0D0 OEOE 4 byte by 1 bit ROM ARRAY

CWRU EECS 317 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; 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 Instance

CWRU EECS 317 Component Declaration/Instance relationship ARCHITECTURE rom_4x1_arch OF rom_4x1 IS COMPONENT TriStateBuffer PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; SIGNAL ROMout: std_logic; 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; ARCHITECTURE rom_4x1_arch OF rom_4x1 IS COMPONENT TriStateBuffer PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; SIGNAL ROMout: std_logic; 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; Colon (:) says make a Component Instance Component Declaration Component Instance Name: BufferOut

CWRU EECS 317 Component Port relationship BufferOut: TriStateBuffer PORT MAP(ROMout, D, OE); oe y x COMPONENT TriStateBuffer PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; COMPONENT TriStateBuffer PORT (x: IN std_logic; y: OUT std_logic, oe: IN std_logic); END COMPONENT; 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; OE  IN  oe  IN D  OUT  y  OUT

CWRU EECS 317 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)

CWRU EECS 317 Assignment #2 (Part 2 of 3) X F Y a (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; G b

CWRU EECS 317 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 fALU bit operation 000S = 0; Cout = 0 001S = x 010S = y; Cout =1; 011S = Cin; Cout = x 100S = x OR y; Cout=x; 101S = x AND y; Cout=x; 110(Cout, S) = x + y + Cin; (component) 111(Cout, S) = full subtractor (component) x ALU y C in f S C out