Digital Design: An Embedded Systems Approach Using VHDL

Size: px
Start display at page:

Download "Digital Design: An Embedded Systems Approach Using VHDL"

Transcription

1 igital esign: An Embedded Systems Approach Using Chapter 4 Sequential Basics Portions of this work are from the book, igital esign: An Embedded Systems Approach Using, by Peter J. Ashenden, published by Morgan Kaufmann Publishers, Copyright 27 Elsevier Inc. All rights reserved. Sequential Basics Sequential circuits Outputs depend on current inputs and previous inputs Store state: an abstraction of the history of inputs Usually governed by a periodic clock signal igital esign Chapter 4 Sequential Basics 2

2 -Flipflops -bit storage element We will treat it as a basic component Other kinds of flipflops SR (set/reset), JK, T (toggle) igital esign Chapter 4 Sequential Basics 3 Registers Store a multi-bit encoded value One -flipflop per bit Stores a new value on each clock cycle d() q() signal d, q:...;... reg: process () is if rising_edge() then q <= d; end process reg; sensitivity list d() d(n) n n q() q(n) igital esign Chapter 4 Sequential Basics 4 2

3 Pipelines Using Registers Total delay = elay + elay 2 + elay 3 Interval between outputs > Total delay d_in combinational circuit combinational circuit 2 combinational circuit 3 d_out d_in combinational circuit combinational circuit 2 combinational circuit 3 d_out Clock period = max(elay, elay 2, elay 3 ) Total delay = 3 clock period Interval between outputs = clock period igital esign Chapter 4 Sequential Basics 5 Pipeline Example Compute the average of corresponding numbers in three input streams New values arrive on each clock edge library ieee; use ieee.std_logic_64.all, ieee.fixed_pkg.all; entity average_pipeline is port ( : in std_logic; a, b, c : in sfixed(5 downto -8); avg : out sfixed(5 downto -8) ); end entity average_pipeline; igital esign Chapter 4 Sequential Basics 6 3

4 Pipeline Example architecture rtl of average_pipeline is signal a_plus_b, sum, sum_div_3 : sfixed(5 downto -8); signal saved_a_plus_b, saved_c, saved_sum : sfixed(5 downto -8); a_plus_b <= a + b; reg : process () is if rising_edge() then saved_a_plus_b <= a_plus_b; saved_c <= c; end process reg;... igital esign Chapter 4 Sequential Basics 7 Pipeline Example sum <= saved_a_plus_b + saved_c; reg2 : process () is if rising_edge() then saved_sum <= sum; end process reg2; sum_div_3 <= saved_sum * to_fixed(./3., sum_div_3'left, sum_div_3'right); reg3 : process () is if rising_edge() then avg <= sum_div_3; end process reg3; end architecture average_pipeline; igital esign Chapter 4 Sequential Basics 8 4

5 -Flipflop with Enable Storage controlled by a clock-enable stores only when = on a rising edge of the clock is a synchronous control input igital esign Chapter 4 Sequential Basics 9 Register with Enable One flipflop per bit and wired in common signal d, q:...;... reg: process () is if rising_edge() then if ce = '' then q <= d; end process reg; igital esign Chapter 4 Sequential Basics 5

6 Register with Synchronous Reset Reset input forces stored value to reset input must be stable around rising edge of reset reset igital esign Chapter 4 Sequential Basics Synch Reset in single-bit data flipflop: process () is if rising_edge() then if reset = '' then q <= ''; elsif ce = '' then q <= d; end process flipflop; vector data reg: process () is if rising_edge() then if reset = '' then q <= ""; elsif ce = '' then q <= d; end process reg; igital esign Chapter 4 Sequential Basics 2 6

7 Register with Asynchronous Reset Reset input forces stored value to reset can become at any time, and effect is immediate reset should return to synchronously reset reset igital esign Chapter 4 Sequential Basics 3 Asynch Reset in reg: process (, reset) is if reset = '' then q <= ""; elsif rising_edge() then if ce = '' then q <= d; end process reg; reset is an asynchronous control input here include it in the sensitivity list so that the process responds to changes immediately igital esign Chapter 4 Sequential Basics 4 7

8 Example: Accumulator Sum a sequence of signed numbers A new number arrives when data_en = Clear sum to on synch reset library ieee; use ieee.std_logic_64.all, ieee.numeric_std.all; entity accumulator is port (, reset, data_en : in std_logic; data_in : in signed(5 downto ); data_out : out signed(9 downto ) ); end entity accumulator; igital esign Chapter 4 Sequential Basics 5 Example: Accumulator architecture rtl of accumulator is signal sum, new_sum : signed(9 downto ); new_sum <= sum + resize(data_in, sum'length); reg: process () is if rising_edge() then if reset = '' then sum <= (others => ''); elsif data_en = '' then sum <= new_sum; end process reg; data_out <= sum; end architecture rtl; igital esign Chapter 4 Sequential Basics 6 8

9 Flipflop and Register Variations pre clr library ieee; use ieee.std_logic_64.all; entity flipflop_n is port ( _n,, pre_n, clr_n, : in std_logic;, _n : out std_logic ); end entity flipflop_n; architecture behavour of flipflop_n is ff: process (_n, pre_n, clr_n) is assert not ( pre_n = '' and clr_n = '') report "Illegal inputs:" & "pre_n and clr_n both ''"; if pre_n = '' then <= ''; _n <= ''; elsif clr_n = '' then <= ''; _n <= ''; elsif falling_edge(_n) then if = '' then <= ; _n <= not ; end process ff; end architecture behavour; igital esign Chapter 4 Sequential Basics 7 Shift Registers Performs shift operation on stored data Arithmetic scaling Serial transfer of data _in (n ) (n ) _in load_en (n 2) () load_en (n 2) () igital esign Chapter 4 Sequential Basics 8 9

10 Example: Sequential Multiplier 6 6 multiply over 6 clock cycles, using one adder Shift register for multiplier bits Shift register for lsb s of accumulated product y(5...) y_load_en y_ce x(5...) x_ce P_reset P_ce 6-bit shift reg _in load_en 6-bit reg 6-bit adder x c6 y c s bit reg reset 5-bit shift reg _in P(3...5) 5 P(4...) igital esign Chapter 4 Sequential Basics 9 Latches Level-sensitive storage ata transmitted while enable is '' transparent latch ata stored while enable is '' LE LE igital esign Chapter 4 Sequential Basics 2

11 Feedback Latches Feedback in gate circuits produces latching behavior Example: reset/set (RS) latch +V S R R S Current RTL synthesis tools don t accept models with unclocked feedback igital esign Chapter 4 Sequential Basics 2 Latches in Latching behavior is usually an error! mux_block : process (sel, a, b, a2, b2) is if sel = '' then z <= a; z2 <= b; else z <= a2; z3 <= b2; end process mux_block; Values must be stored for z2 while sel = '' for z3 while sel = '' Oops! Should be z2 <=... igital esign Chapter 4 Sequential Basics 22

12 Counters Stores an unsigned integer value increments or decrements the value Used to count occurrences of events repetitions of a processing step Used as timers count elapsed time intervals by incrementing periodically igital esign Chapter 4 Sequential Basics 23 Free-Running Counter + Increments every rising edge of up to 2 n, then wraps back to i.e., counts modulo 2 n This counter is synchronous all outputs governed by clock edge igital esign Chapter 4 Sequential Basics 24 2

13 Example: Periodic Control Signal Count modulo 6 clock cycles Control output = '' every 8 th and 2 th cycle decode count values and + ctrl igital esign Chapter 4 Sequential Basics 25 Example: Periodic Control Signal library ieee; use ieee.std_logic_64.all, ieee.numeric_std.all; entity decoded_counter is port ( : in std_logic; ctrl : out std_logic ); end entity decoded_counter; architecture rtl of decoded_counter is signal count_value : unsigned(3 downto ); counter : process () is if rising_edge() then count_value <= count_value + ; end process counter; ctrl <= '' when count_value = "" or count_value = "" else ''; end architecture rtl; igital esign Chapter 4 Sequential Basics 26 3

14 Count Enable and Reset Use a register with control inputs + reset reset Increments when = '' on rising clock edge Reset: synch or asynch igital esign Chapter 4 Sequential Basics 27 Terminal Count Status signal indicating final count value counter n TC TC is '' for one cycle in every 2 n cycles frequency = clock frequency / 2 n Called a clock divider igital esign Chapter 4 Sequential Basics 28 4

15 ivider Example Alarm clock beep: 5Hz from MHz clock -bit counter TC count tone2 tone count tone2 tone igital esign Chapter 4 Sequential Basics 29 ivide by k ecode k as terminal count and reset counter register Counter increments modulo k Example: decade counter Terminal count = 9 counter 2 reset igital esign Chapter 4 Sequential Basics 3 5

16 ecade Counter in library ieee; use ieee.std_logic_64.all, ieee.numeric_std.all; entity decade_counter is port ( : in std_logic; q : out unsigned(3 downto ) ); end entity decade_counter; architecture rtl of decade_counter is signal count_value : unsigned(3 downto ); count : process () is if rising_edge() then count_value <= (count_value + ) mod ; end process count; q <= count_value; end architecture rtl; igital esign Chapter 4 Sequential Basics 3 own Counter with Load Load a starting value, then decrement Terminal count = Useful for interval timer load =? TC igital esign Chapter 4 Sequential Basics 32 6

17 Loadable Counter in library ieee; use ieee.std_logic_64.all, ieee.numeric_std.all; entity interval_timer is port (, load : in std_logic; data : in unsigned(9 downto ); tc : out std_logic); end entity interval_timer; architecture rtl of interval_timer is signal count_value : unsigned(9 downto ); count : process () is if rising_edge() then if load = '' then count_value <= data; else count_value <= count_value - ; end process count; tc <= '' when count_value = else ''; end architecture rtl; igital esign Chapter 4 Sequential Basics 33 Reloading Counter in architecture repetitive of interval_timer is signal load_value, count_value : unsigned(9 downto ); count : process () is if rising_edge() then if load = '' then load_value <= data; count_value <= data; elsif count_value = then count_value <= load_value; else count_value <= count_value - ; end process count; tc <= '' when count_value = else ''; end architecture repetitive; igital esign Chapter 4 Sequential Basics 34 7

18 Ripple Counter Each bit toggles between and when previous bit changes from to 2 n 2 2 igital esign Chapter 4 Sequential Basics 35 Ripple or Synch Counter? Ripple counter is ok if length is short clock period long relative to flipflop delay transient wrong values can be tolerated area must be minimal E.g., alarm clock Otherwise use a synchronous counter igital esign Chapter 4 Sequential Basics 36 8

19 atapaths and Control igital systems perform sequences of operations on encoded data atapath Combinational circuits for operations Registers for storing intermediate results Control section: control sequencing Generates control signals Selecting operations to perform Enabling registers at the right times Uses status signals from datapath igital esign Chapter 4 Sequential Basics 37 Example: Complex Multiplier Cartesian form, fixed-point operands: 4 pre-, 2 post-binary-point bits result: 8 pre-, 24 post-binary-point bits Subject to tight area constraints a = a r + ja i b = b r + jbi p = ab = p + jp = a b a b ) + j( a b + r i ( r r i i r i aibr 4 multiplies, add, subtract Perform sequentially using multiplier, adder/subtracter igital esign Chapter 4 Sequential Basics 38 ) 9

20 Complex Multiplier atapath a_r a_i a_sel b_r b_i b_sel pp_ce pp2_ce ± p_r p_i sub p_r_ce p_i_ce igital esign Chapter 4 Sequential Basics 39 Complex Multiplier in library ieee; use ieee.std_logic_64.all, ieee.fixed_pkg.all; entity multiplier is port (, reset : in std_logic; input_rdy : in std_logic; a_r, a_i, b_r, b_i : in sfixed(3 downto -2); p_r, p_i : out sfixed(7 downto -24) ); end entity multiplier; architecture rtl of multiplier is signal a_sel, b_sel, pp_ce, pp2_ce, sub, p_r_ce, p_i_ce : std_logic; -- control signals signal a_operand, b_operand : sfixed(3 downto -2); signal pp, pp, pp2, sum : sfixed(7 downto -24);... igital esign Chapter 4 Sequential Basics 4 2

21 Complex Multiplier in a_operand <= a_r when a_sel = '' else a_i; -- mux b_operand <= b_r when b_sel = '' else b_i; -- mux pp <= a_operand * b_operand; -- multiplier pp_reg : process () is -- partial product register if rising_edge() then if pp_ce = '' then pp <= pp; end process pp_reg; pp2_reg : process () is -- partial product register 2 if rising_edge() then if pp2_ce = '' then pp2 <= pp; end process pp2_reg; igital esign Chapter 4 Sequential Basics 4 Complex Multiplier in sum <= pp + pp2 when sub = '' else pp - pp2; -- add/sub p_r_reg : process () is -- result real-part register if rising_edge() then if p_r_ce = '' then p_r <= sum; end process p_r_reg; p_i_reg : process () is -- result imag-part register if rising_edge() then if p_i_ce = '' then p_i <= sum; end process p_i_reg; control circuit end architecture rtl; igital esign Chapter 4 Sequential Basics 42 2

22 Multiplier Control Sequence Avoid resource conflict First attempt. a_r * b_r pp_reg 2. a_i * b_i pp2_reg 3. pp pp2 p_r_reg 4. a_r * b_i pp_reg 5. a_i * b_r pp2_reg 6. pp + pp2 p_i_reg Takes 6 clock cycles igital esign Chapter 4 Sequential Basics 43 Multiplier Control Sequence Merge steps where no resource conflict Revised attempt. a_r * b_r pp_reg 2. a_i * b_i pp2_reg 3. pp pp2 p_r_reg a_r * b_i pp_reg 4. a_i * b_r pp2_reg 5. pp + pp2 p_i_reg Takes 5 clock cycles igital esign Chapter 4 Sequential Basics 44 22

23 Multiplier Control Signals Step a_sel b_sel pp_ce pp2_ce sub p_r_ce p_i_ce igital esign Chapter 4 Sequential Basics 45 Finite-State Machines Used the implement control sequencing Based on mathematical automaton theory A FSM is defined by set of inputs: Σ set of outputs: Γ set of states: S initial state: s S transition function: δ: S Σ S output function: ω: S Σ Γ or ω: S Γ igital esign Chapter 4 Sequential Basics 46 23

24 FSM in Hardware reset reset current_state next state logic inputs output logic outputs Mealy FSM only Mealy FSM: ω: S Σ Γ Moore FSM: ω: S Γ igital esign Chapter 4 Sequential Basics 47 FSM Example: Multiplier Control One state per step Separate idle state? Wait for input_rdy = '' Then proceed to steps, 2,... But this wastes a cycle! Use step as idle state Repeat step if input_rdy '' Proceed to step 2 otherwise Output function efined by table on slide 43 Moore or Mealy? current_ state step step step2 step3 step4 step5 Transition function input_ rdy next_ state step step2 step3 step4 step5 step igital esign Chapter 4 Sequential Basics 48 24

25 State Encoding Encoded in binary N states: use at least log 2 N bits Encoded value used in circuits for transition and output function encoding affects circuit complexity Optimal encoding is hard to find CA tools can do this well One-hot works well in FPGAs Often use... for idle state reset state register to idle igital esign Chapter 4 Sequential Basics 49 FSMs in Use an enumeration type for state values abstract, avoids specifying encoding type multiplier_state is (step, step2, step3, step4, step5); signal current_state, next_state : multiplier_state;... igital esign Chapter 4 Sequential Basics 5 25

26 Multiplier Control in state_reg : process (, reset) is if reset = '' then current_state <= step; elsif rising_edge() then current_state <= next_state; end process state_reg; next_state_logic : process (current_state, input_rdy) is case current_state is when step => if input_rdy = '' then next_state <= step; else next_state <= step2; when step2 => next_state <= step3; when step3 => next_state <= step4; when step4 => next_state <= step5; when step5 => next_state <= step; end case; end process next_state_logic; igital esign Chapter 4 Sequential Basics 5 Multiplier Control in Moore FSM output_logic : process (current_state) is case current_state is when step => a_sel <= ''; b_sel <= ''; pp_ce <= ''; pp2_ce <= ''; sub <= ''; p_r_ce <= ''; p_i_ce <= ''; when step2 => a_sel <= ''; b_sel <= ''; pp_ce <= ''; pp2_ce <= ''; sub <= ''; p_r_ce <= ''; p_i_ce <= ''; when step3 => a_sel <= ''; b_sel <= ''; pp_ce <= ''; pp2_ce <= ''; sub <= ''; p_r_ce <= ''; p_i_ce <= ''; when step4 => a_sel <= ''; b_sel <= ''; pp_ce <= ''; pp2_ce <= ''; sub <= ''; p_r_ce <= ''; p_i_ce <= ''; when step5 => a_sel <= ''; b_sel <= ''; pp_ce <= ''; pp2_ce <= ''; sub <= ''; p_r_ce <= ''; p_i_ce <= ''; end case; end process output_logic; igital esign Chapter 4 Sequential Basics 52 26

27 State Transition iagrams Bubbles to represent states Arcs to represent transitions Example,, S = {s, s2, s3} Inputs (a, a2): Σ = {(,), (,), (,), (,)} δ defined by diagram, s,, s2, s3,, igital esign Chapter 4 Sequential Basics 53 State Transition iagrams Annotate diagram to define output function Annotate states for Moore-style outputs Annotate arcs for Mealy-style outputs Example x, x 2 : Moore-style y, y 2, y 3 : Mealy-style, /,,, /,, s, /,, s2,,, /,, /,,, /,, s3, /,,,, /,,, /,, igital esign Chapter 4 Sequential Basics 54 27

28 Multiplier Control iagram Input: input_rdy Outputs a_sel, b_sel, pp_ce, pp2_ce, sub, p_r_ce, p_i_ce step,,,,,, step2,,,,,, step5,,,,,, step4,,,,,, step3,,,,,, igital esign Chapter 4 Sequential Basics 55 Bubble iagrams or? Many CA tools provide editors for bubble diagrams Automatically generate for simulation and synthesis iagrams are visually appealing but can become unwieldy for complex FSMs Your choice... or your manager's! igital esign Chapter 4 Sequential Basics 56 28

29 Register Transfer Level RTL a level of abstraction data stored in registers transferred via circuits that operate on data inputs outputs control section igital esign Chapter 4 Sequential Basics 57 Clocked Synchronous Timing Registers driven by a common clock Combinational circuits operate during clock cycles (between rising clock edges) t c t co t pd 2 t su t co t pd t slack t su t co + t pd + t su < t c 2 igital esign Chapter 4 Sequential Basics 58 29

30 Control Path Timing t co t su t co + t pd-s + t pd-o + t pd-c + t su < t c t pd-s t pd-c t co + t pd-s + t pd-ns + t su < t c t pd-o t pd-ns t su Ignore t pd-s for a Moore FSM igital esign Chapter 4 Sequential Basics 59 Timing Constraints Inequalities must hold for all paths If t co and t su the same for all paths Combinational delays make the difference Critical path The combinational path between registers with the longest delay etermines minimum clock period for the entire system Focus on it to improve performance Reducing delay may make another path critical igital esign Chapter 4 Sequential Basics 6 3

31 Interpretation of Constraints. Clock period depends on delays System can operate at any frequency up to a maximum OK for systems where high performance is not the main requirement 2. elays must fit within a target clock period Optimize critical paths to reduce delays if necessary May require revising RTL organization igital esign Chapter 4 Sequential Basics 6 Clock Skew 2 2 t h 2 Need to ensure clock edges arrive at all registers at the same time Use CA tools to insert clock buffers and route clock signal paths igital esign Chapter 4 Sequential Basics 62 3

32 Off-Chip Connections elays going off-chip and inter-chip Input and output pad delays, wire delays Same timing rules apply Use input and output registers to avoid adding external delay to critical path 2 igital esign Chapter 4 Sequential Basics 63 Asynchronous Inputs External inputs can change at any time Might violate setup/hold time constraints Can induce metastable state in a flipflop Unbounded time to recover May violate setup/hold time of subsequent flipflop MTBF e = k f k 2 >> igital esign Chapter 4 Sequential Basics 64 k t 2 f f 2 32

33 Synchronizers asynch_in synch_in If input changes outside setup/hold window Change is simply delayed by one cycle If input changes during setup/hold window First flipflop has a whole cycle to resolve metastability See data sheets for metastability parameters igital esign Chapter 4 Sequential Basics 65 Switch Inputs and ebouncing Switches and push-buttons suffer from contact bounce Takes up to ms to settle Need to debounce to avoid false triggering +V R Requires two inputs and two resistors S Must use a breakbefore-make doublethrow switch igital esign Chapter 4 Sequential Basics 66 33

34 Switch Inputs and ebouncing Alternative Use a single-throw switch Sample input at intervals longer than bounce time Look for two successive samples with the same value +V Assumption Extra circuitry inside the chip is cheaper than extra components and connections outside igital esign Chapter 4 Sequential Basics 67 ebouncing in library ieee; use ieee.std_logic_64.all; entity debouncer is port (, reset : in std_logic; -- frequency = 5MHz pb : in std_logic; pb_debounced : out std_logic ); end entity debouncer; architecture rtl of debouncer is signal count5 : integer range to ; signal _Hz : std_logic; signal pb_sampled : std_logic; igital esign Chapter 4 Sequential Basics 68 34

35 ebouncing in div_hz : process (, reset) is if reset = '' then _Hz <= ''; count5 <= ; elsif rising_edge() then if count5 = then count5 <= ; _Hz <= ''; else count5 <= count5 + ; _Hz <= ''; end process div_hz; debounce_pb : process () is if rising_edge() then if _Hz = '' then if pb = pb_sampled then pb_debounced <= pb; pb_sampled <= pb; end process debounce_pb; end architecture rtl; igital esign Chapter 4 Sequential Basics 69 Verifying Sequential Circuits Verification Testbench Apply Test Cases esign Under Verification (UV) Checker UV may take multiple and varying number of cycles to produce output Checker needs to synchronize with test generator ensure UV outputs occur when expected ensure UV outputs are correct ensure no spurious outputs occur igital esign Chapter 4 Sequential Basics 7 35

36 Example: Multiplier Testbench entity multiplier_testbench is end entity multiplier_testbench; library ieee; use ieee.std_logic_64.all, ieee.fixed_pkg.all, ieee.math_complex.all; architecture verify of multiplier_testbench is constant t_c : time := 5 ns; signal, reset : std_logic; signal input_rdy : std_logic; signal a_r, a_i, b_r, b_i : sfixed(3 downto -2); signal p_r, p_i : sfixed(7 downto -24); signal a, b : complex; duv : entity work.multiplier(rtl) port map (, reset, input_rdy, a_r, a_i, b_r, b_i, p_r, p_i ); _gen : process is wait for t_c / 2; <= ''; wait for t_c / 2; <= '; end process _gen; reset <= '', '' after 2 * t_c ns; igital esign Chapter 4 Sequential Basics 7 Example: Multiplier Testbench apply_test_cases : process is wait until falling_edge() and reset = ''; a <= cmplx(.,.); b <= cmplx(., 2.); input_rdy <= ''; wait until falling_edge(); input_rdy <= ''; for i in to 5 loop wait until falling_edge(); end loop; a <= cmplx(.,.); b <= cmplx(.,.); input_rdy <= ''; wait until falling_edge(); input_rdy <= ''; for i in to 6 loop wait until falling_edge(); end loop; -- further test cases... wait; end process apply_test_cases; a_r <= to_sfixed(a.re, a_r'left, a_r'right); a_i <= to_sfixed(a.im, a_i'left, a_i'right); b_r <= to_sfixed(b.re, b_r'left, b_r'right); b_i <= to_sfixed(b.im, b_i'left, b_i'right); igital esign Chapter 4 Sequential Basics 72 36

37 Example: Multiplier Testbench check_outputs : process is variable p : complex; wait until rising_edge() and input_rdy = ''; p := a * b; for i in to 5 loop wait until falling_edge(); end loop; assert abs (to_real(p_r) - p.re) < 2.**(-2) and abs (to_real(p_i) - p.im) < 2.**(-2); end process check_outputs; end architecture verify; igital esign Chapter 4 Sequential Basics 73 Asynchronous Timing Clocked synchronous timing requires global clock distribution with minimal skew path delay between registers < clock period Hard to achieve in complex multi-ghz systems Globally asynch, local synch (GALS) systems ivide the systems into local clock domains Inter-domain signals treated as asynch inputs Simplifies clock managements and constraints elays inter-domain communication elay-insensitive asynchronous systems no clock signals igital esign Chapter 4 Sequential Basics 74 37

38 Other Clock-Related Issues Inter-chip clocking istributing high-speed clocks on PCBs is hard Often use slower off-chip clock, with on-chip clock a multiple of off-chip clock Synchronize on-chip with phase-locked loop (PLL) In multi-pcb systems treat off-pcb signals as asynch inputs Low power design Continuous clocking wastes power Clock gating: turn off clock to idle subsystems igital esign Chapter 4 Sequential Basics 75 Summary Registers for storing data synchronous and asynchronous control clock enable, reset, preset Latches: level-sensitive usually unintentional in Counters free-running dividers, terminal count, reset, load, up/down igital esign Chapter 4 Sequential Basics 76 38

39 Summary RTL organization of digital systems datapath and control section Finite-State Machine (FSM) states, inputs, transition/output functions Moore and Mealy FSMs bubble diagrams Clocked synch timing and constraints critical path and optimization Asynch inputs, switch debouncing Verification of sequential systems igital esign Chapter 4 Sequential Basics 77 39

Digital Design: An Embedded Systems Approach Using Verilog

Digital Design: An Embedded Systems Approach Using Verilog Digital Design: An Embedded Systems Approach Using Verilog Chapter 4 Sequential Basics Portions of this work are from the book, Digital Design: An Embedded Systems Approach Using Verilog, by Peter J. Ashenden,

More information

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule EEU530 EE U530 igital Hardware Synthesis Lecture 11: Prof. Miriam Leeser mel@coe.neu.edu October 18, 2005 Sequential Logic in VHL Finite State Machines in VHL Project proposals due now HW 4 due Wednesday,

More information

Sequential Logic - Module 5

Sequential Logic - Module 5 Sequential Logic Module 5 Jim Duckworth, WPI 1 Latches and Flip-Flops Implemented by using signals in IF statements that are not completely specified Necessary latches or registers are inferred by the

More information

Timing in synchronous systems

Timing in synchronous systems BO 1 esign of sequential logic Outline Timing in synchronous networks Synchronous processes in VHL VHL-code that introduces latches andf flip-flops Initialization of registers Mealy- and Moore machines

More information

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits EE 459/5 HL Based igital esign with Programmable Logic Lecture 6 ombinational and sequential circuits Read before class: hapter 2 from textbook Overview ombinational circuits Multiplexer, decoders, encoders,

More information

VHDL: RTL Synthesis Basics. 1 of 59

VHDL: RTL Synthesis Basics. 1 of 59 VHDL: RTL Synthesis Basics 1 of 59 Goals To learn the basics of RTL synthesis. To be able to synthesize a digital system, given its VHDL model. To be able to relate VHDL code to its synthesized output.

More information

Lecture 12 VHDL Synthesis

Lecture 12 VHDL Synthesis CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?

More information

Control and Datapath 8

Control and Datapath 8 Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system

More information

Sequential Circuit Design: Principle

Sequential Circuit Design: Principle Sequential Circuit Design: Principle Chapter 8 1 Outline 1. Overview on sequential circuits 2. Synchronous circuits 3. Danger of synthesizing async circuit 4. Inference of basic memory elements 5. Simple

More information

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL for Synthesis. Course Description. Course Duration. Goals VHDL for Synthesis Course Description This course provides all necessary theoretical and practical know how to write an efficient synthesizable HDL code through VHDL standard language. The course goes

More information

Digital Design: An Embedded Systems Approach Using VHDL

Digital Design: An Embedded Systems Approach Using VHDL Digital Design: An Embedded Systems Approach Using Chapter 5 Memories Portions of this work are from the book, Digital Design: An Embedded Systems Approach Using, by Peter J. Ashd, published by Morgan

More information

Sequential Circuit Design: Principle

Sequential Circuit Design: Principle Sequential Circuit Design: Principle Chapter 8 1 Outline 1. Overview on sequential circuits 2. Synchronous circuits 3. Danger of synthesizing asynchronous circuit 4. Inference of basic memory elements

More information

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses

Today. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses Today Comments about assignment 3-43 Comments about assignment 3 ASICs and Programmable logic Others courses octor Per should show up in the end of the lecture Mealy machines can not be coded in a single

More information

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Control Unit: Binary Multiplier Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Example: Binary Multiplier Two versions Hardwired control Microprogrammed

More information

3 Designing Digital Systems with Algorithmic State Machine Charts

3 Designing Digital Systems with Algorithmic State Machine Charts 3 Designing with Algorithmic State Machine Charts An ASM chart is a method of describing the sequential operations of a digital system which has to implement an algorithm. An algorithm is a well defined

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs IGITAL LOGIC SIGN VHL Coding for FPGAs SUNTIAL CIRCUITS Unit 5 Asynchronous sequential circuits: Latches Synchronous circuits: flip flops, counters, registers. Testbench: Generating stimulus COMBINATIONAL

More information

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR CE 1911 Counters Counter Types Modulo Gray Code BC (ecimal) ecade Ring Johnson (twisted ring) LFSR Variations Asynchronous / Synchronous Up/own Loadable 2 tj Modulo-n (n = a power of 2) Asynchronous Count

More information

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts Required reading P. Chu, using VHDL Chapter 1, Finite State Machine: Principle & Practice Chapter

More information

Contents. Chapter 9 Datapaths Page 1 of 28

Contents. Chapter 9 Datapaths Page 1 of 28 Chapter 9 Datapaths Page of 2 Contents Contents... 9 Datapaths... 2 9. General Datapath... 3 9.2 Using a General Datapath... 5 9.3 Timing Issues... 7 9.4 A More Complex General Datapath... 9 9.5 VHDL for

More information

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4) Verilog Sequential Logic Verilog for Synthesis Rev C (module 3 and 4) Jim Duckworth, WPI 1 Sequential Logic Module 3 Latches and Flip-Flops Implemented by using signals in always statements with edge-triggered

More information

Verilog for High Performance

Verilog for High Performance Verilog for High Performance Course Description This course provides all necessary theoretical and practical know-how to write synthesizable HDL code through Verilog standard language. The course goes

More information

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas Nanosistemų programavimo kalbos 5 paskaita Sekvencinių schemų projektavimas Terminai Combinational circuit kombinacinė schema (be atminties elementų) Sequential circuit nuosekli (trigerinė, sekvencinė)

More information

FPGA for Software Engineers

FPGA for Software Engineers FPGA for Software Engineers Course Description This course closes the gap between hardware and software engineers by providing the software engineer all the necessary FPGA concepts and terms. The course

More information

8 Register, Multiplexer and

8 Register, Multiplexer and 8 Register, Multiplexer and Three-State Inference HDL Compiler can infer Registers (latches and flip flops) Multiplexers Three state gates This chapter discusses methods of inferring different types of

More information

VHDL for Logic Synthesis

VHDL for Logic Synthesis VHDL for Logic Synthesis Overview Design Flow for Hardware Design VHDL coding for synthesis General guidelines for hardware designers This lecture includes the content from: Nitin Yogi, Modelling for Synthesis

More information

Digital Design with SystemVerilog

Digital Design with SystemVerilog Digital Design with SystemVerilog Prof. Stephen A. Edwards Columbia University Spring 25 Synchronous Digital Design Combinational Logic Sequential Logic Summary of Modeling Styles Testbenches Why HDLs?

More information

VHDL simulation and synthesis

VHDL simulation and synthesis VHDL simulation and synthesis How we treat VHDL in this course You will not become an expert in VHDL after taking this course The goal is that you should learn how VHDL can be used for simulation and synthesis

More information

Writing Circuit Descriptions 8

Writing Circuit Descriptions 8 8 Writing Circuit Descriptions 8 You can write many logically equivalent descriptions in Verilog to describe a circuit design. However, some descriptions are more efficient than others in terms of the

More information

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL DESCRIPTION OF DIGITAL CIRCUITS USING VHDL Combinatinal circuits Sequential circuits Design organization. Generic design Iterative operations Authors: Luis Entrena Arrontes, Celia López, Mario García,

More information

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

ECE Digital Design Laboratory. Lecture 3 Finite State Machines! ECE 4401 - Digital Design Laboratory Lecture 3 Finite State Machines! 1!!!! Synchronous Sequential Circuits!!! Synchronous sequential logic circuits are realized using combinational logic and storage elements

More information

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Luleå University of Technology Kurskod SMD152 Datum Skrivtid Luleå University of Technology Kurskod SMD152 Datum 2003-10-24 Skrivtid 9.00 13.00 1 Manual synthesis (10 p, 2 p each) Here you are given five different VHDL models. Your task is to draw the schematics

More information

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines Lecture 3 Behavioral Modeling Sequential Circuits Registers Counters Finite State Machines Behavioral Modeling Behavioral Modeling Behavioral descriptions use the keyword always, followed by optional event

More information

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010 University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences EECS150 J. Wawrzynek Spring 2010 May 10, 2010 Final Exam Name: ID number: This is

More information

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2 Verilog Tutorial T. A.: Hsueh-Yi Lin Introduction 2008/3/12 VLSI Digital Signal Processing 2 Verilog: A common language for industry HDL is a common way for hardware design Verilog VHDL Verilog is widely

More information

MCMASTER UNIVERSITY EMBEDDED SYSTEMS

MCMASTER UNIVERSITY EMBEDDED SYSTEMS MCMASTER UNIVERSITY EMBEDDED SYSTEMS Computer Engineering 4DS4 Lecture Revision of Digital Systems Amin Vali January 26 Course material belongs to DrNNicolici Field programmable gate arrays (FPGAs) x x

More information

VHDL for Logic Synthesis

VHDL for Logic Synthesis VHDL for Logic Synthesis Overview Design Flow for Hardware Design VHDL coding for synthesis General guidelines for hardware designers This lecture includes the content from: Nitin Yogi, Modelling for Synthesis

More information

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November

More information

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited April 2, 2009 John Wawrzynek Spring 2009 EECS150 - Lec20-fsm Page 1 Finite State Machines (FSMs) FSM circuits are a type of sequential

More information

VHDL/Verilog Simulation. Testbench Design

VHDL/Verilog Simulation. Testbench Design VHDL/Verilog Simulation Testbench Design The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus of UUT inputs

More information

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis Jan 31, 2012 John Wawrzynek Spring 2012 EECS150 - Lec05-verilog_synth Page 1 Outline Quick review of essentials of state elements Finite State

More information

Verilog introduction. Embedded and Ambient Systems Lab

Verilog introduction. Embedded and Ambient Systems Lab Verilog introduction Embedded and Ambient Systems Lab Purpose of HDL languages Modeling hardware behavior Large part of these languages can only be used for simulation, not for hardware generation (synthesis)

More information

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language) Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits Hardware Description Language) 1 Standard ICs PLD: Programmable Logic Device CPLD: Complex PLD FPGA: Field Programmable

More information

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language VHDL Introduction to Structured VLSI Design VHDL I Very High Speed Integrated Circuit (VHSIC) Hardware Description Language Joachim Rodrigues A Technology Independent, Standard Hardware description Language

More information

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and shift registers, which is most useful in conversion between

More information

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control ECE 4514 Digital Design II Lecture 15: FSM-based Control A Design Lecture Overview Finite State Machines Verilog Mapping: one, two, three always blocks State Encoding User-defined or tool-defined State

More information

HDL. Hardware Description Languages extensively used for:

HDL. Hardware Description Languages extensively used for: HDL Hardware Description Languages extensively used for: Describing (digital) hardware (formal documentation) Simulating it Verifying it Synthesizing it (first step of modern design flow) 2 main options:

More information

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign I hope you have completed Part 1 of the Experiment. This lecture leads you to Part 2 of the experiment and hopefully helps you with your progress to Part 2. It covers a number of topics: 1. How do we specify

More information

State Machine Descriptions

State Machine Descriptions State Machine Descriptions Can be modelled using many different coding styles Style guidelines available for Moore or Mealy type machines Several encoding schemes for state variables used in FSM descriptions

More information

HDL Design Cube. Synthesis and VHDL

HDL Design Cube. Synthesis and VHDL HDL Design Cube time causality (algorithmic level) timing clock related (register-transfer level) propagation delay (gate level) structure dataflow behavior bit values view composite bit values values

More information

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design Two HDLs used today Introduction to Structured VLSI Design VHDL I VHDL and Verilog Syntax and ``appearance'' of the two languages are very different Capabilities and scopes are quite similar Both are industrial

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines Algorithmic State Machine (ASM) charts FINITE STATE MACHINES (FSMs) Classification: Moore Machine:

More information

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques FSM Components XST features: Specific inference capabilities for synchronous Finite State Machine (FSM) components. Built-in FSM encoding strategies to accommodate your optimization goals. You may also

More information

Debouncing a Switch. A Design Example. Page 1

Debouncing a Switch. A Design Example. Page 1 Debouncing a Switch A Design Example Page 1 Background and Motivation Page 2 When you throw a switch (button or two-pole switch) It often bounces Page 3 Another switch switch after inversion Page 4 Yet

More information

VHDL in 1h. Martin Schöberl

VHDL in 1h. Martin Schöberl VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset

More information

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits M1 Informatique / MOSIG Introduction to Modeling and erification of Digital Systems Part 4: HDL for sequential circuits Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/m1arc 2017/2018 81 Sequential

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution Spring 2016 1. (15 points) Write a VHDL function that accepts a std_logic_vector of arbitrary length and an integer

More information

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters. ECE 55 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks Required reading P. Chu, RTL Hardware esign using VHL Chapter 5.1, VHL Process Chapter 8, Sequential Circuit esign: Principle

More information

Mealy and Moore examples

Mealy and Moore examples CSE 37 Spring 26 Introduction to igital esign ecture 2: uential ogic Technologies ast ecture Moore and Mealy Machines Today uential logic technologies Ving machine: Moore to synch. Mealy OPEN = creates

More information

Why Should I Learn This Language? VLSI HDL. Verilog-2

Why Should I Learn This Language? VLSI HDL. Verilog-2 Verilog Why Should I Learn This Language? VLSI HDL Verilog-2 Different Levels of Abstraction Algorithmic the function of the system RTL the data flow the control signals the storage element and clock Gate

More information

Controller Implementation--Part I. Cascading Edge-triggered Flip-Flops. Clock Skew. Cascading Edge-triggered Flip-Flops. Why Gating of Clocks is Bad!

Controller Implementation--Part I. Cascading Edge-triggered Flip-Flops. Clock Skew. Cascading Edge-triggered Flip-Flops. Why Gating of Clocks is Bad! Controller Implementation--Part I lternative controller FSM implementation approaches based on: Classical Moore and Mealy machines Time state: ivide and Jump counters Microprogramming (ROM) based approaches»

More information

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines ECE 2300 Digital Logic & Computer Organization Spring 2017 More Verilog Finite State Machines Lecture 8: 1 Announcements 1 st batch of (raw) quiz scores released on CMS Solutions to HW 1-3 released on

More information

CprE 583 Reconfigurable Computing

CprE 583 Reconfigurable Computing Recap 4:1 Multiplexer CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #18 VHDL for Synthesis I LIBRARY ieee

More information

Digital System Design with SystemVerilog

Digital System Design with SystemVerilog Digital System Design with SystemVerilog Mark Zwolinski AAddison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Paris Madrid Capetown Sydney Tokyo

More information

Pollard s Tutorial on Clocked Stuff in VHDL

Pollard s Tutorial on Clocked Stuff in VHDL Pollard s Tutorial on Clocked Stuff in VHDL Welcome to a biased view of how to do register type of stuff in VHDL. The object of this short note is to identify one way to easily handle registered logic

More information

VHDL And Synthesis Review

VHDL And Synthesis Review VHDL And Synthesis Review VHDL In Detail Things that we will look at: Port and Types Arithmetic Operators Design styles for Synthesis VHDL Ports Four Different Types of Ports in: signal values are read-only

More information

Sequential Statement

Sequential Statement Sequential Statement Sequential Logic Output depends not only on current input values but also on previous input values. Are building blocks of; Counters Shift registers Memories Flip flops are basic sequential

More information

Using ModelSim to Simulate Logic Circuits in VHDL Designs. 1 Introduction. For Quartus II 13.0

Using ModelSim to Simulate Logic Circuits in VHDL Designs. 1 Introduction. For Quartus II 13.0 Using ModelSim to Simulate Logic Circuits in VHDL Designs For Quartus II 13.0 1 Introduction This tutorial is a basic introduction to ModelSim, a Mentor Graphics simulation tool for logic circuits. We

More information

Sequential Logic. Use Explicit Port Declarations. Verilog Summary. Examples

Sequential Logic. Use Explicit Port Declarations. Verilog Summary. Examples Use Explicit Port eclarations module mux32two (input [31:0] i0,i1, input sel, output [31:0] out); assign out = sel? i1 : i0; module Sequential igital state: the -Register Timing constraints for -Registers

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS KINGS COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK NAME OF THE SUBJECT: EE 2255 DIGITAL LOGIC CIRCUITS YEAR / SEM: II / IV UNIT I BOOLEAN ALGEBRA AND COMBINATIONAL

More information

קורס VHDL for High Performance. VHDL

קורס VHDL for High Performance. VHDL קורס VHDL for High Performance תיאור הקורס קורסזהמספקאתכלהידע התיאורטיוהמעשילכתיבתקודHDL. VHDL לסינתזה בעזרת שפת הסטנדרט הקורסמעמיקמאודומלמדאת הדרךהיעילהלכתיבתקודVHDL בכדילקבלאתמימושתכןהלוגי המדויק. הקורסמשלב

More information

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date: Design of Datapath Controllers and Sequential Logic Lecturer: Date: 2009.03.18 ACCESS IC LAB Sequential Circuit Model & Timing Parameters ACCESS IC LAB Combinational Logic Review Combinational logic circuits

More information

Lab 3. Advanced VHDL

Lab 3. Advanced VHDL Lab 3 Advanced VHDL Lab 3 Advanced VHDL This lab will demonstrate many advanced VHDL techniques and how they can be used to your advantage to create efficient VHDL code. Topics include operator balancing,

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences Introductory Digital Systems Lab (6.111) uiz - Spring 2004 Prof. Anantha Chandrakasan Student Name: Problem

More information

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007 EECS 5 - Components and Design Techniques for Digital Systems Lec 2 RTL Design Optimization /6/27 Shauki Elassaad Electrical Engineering and Computer Sciences University of California, Berkeley Slides

More information

Summary of FPGA & VHDL

Summary of FPGA & VHDL FYS4220/9220 Summary of FPGA & VHDL Lecture #6 Jan Kenneth Bekkeng, University of Oslo - Department of Physics 16.11.2011 Curriculum (VHDL & FPGA part) Curriculum (Syllabus) defined by: Lectures Lecture6:

More information

Chapter 5 Registers & Counters

Chapter 5 Registers & Counters University of Wisconsin - Madison ECE/Comp Sci 352 Digital Systems Fundamentals Kewal K. Saluja and Yu Hen Hu Spring 2002 Chapter 5 Registers & Counters Originals by: Charles R. Kime Modified for course

More information

Verilog for Synthesis Ing. Pullini Antonio

Verilog for Synthesis Ing. Pullini Antonio Verilog for Synthesis Ing. Pullini Antonio antonio.pullini@epfl.ch Outline Introduction to Verilog HDL Describing combinational logic Inference of basic combinational blocks Describing sequential circuits

More information

University of Technology

University of Technology University of Technology Lecturer: Dr. Sinan Majid Course Title: microprocessors 4 th year Lecture 13 Counters Overview Counters are important components in computers The increment or decrement by one

More information

Design Problem 3 Solutions

Design Problem 3 Solutions CSE 260 Digital Computers: Organization and Logical Design Jon Turner Design Problem 3 Solutions In this problem, you are to design, simulate and implement a sequential pattern spotter, using VHDL. This

More information

In our case Dr. Johnson is setting the best practices

In our case Dr. Johnson is setting the best practices VHDL Best Practices Best Practices??? Best practices are often defined by company, toolset or device In our case Dr. Johnson is setting the best practices These rules are for Class/Lab purposes. Industry

More information

[VARIABLE declaration] BEGIN. sequential statements

[VARIABLE declaration] BEGIN. sequential statements PROCESS statement (contains sequential statements) Simple signal assignment statement

More information

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

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering Final Eamination ECE 4F - Digital Systems Eaminers: S. Brown, J.

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines FINITE STATE MACHINES (FSMs) Classification: Moore Machine: Outputs depend only on the current state

More information

EEL 4712 Digital Design Test 1 Spring Semester 2007

EEL 4712 Digital Design Test 1 Spring Semester 2007 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. COVER SHEET: Problem: Points: 1 (15 pts) 2 (20 pts) Total 3 (15 pts) 4 (18 pts)

More information

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University ECE 545 Lecture 8 Data Flow Description of Combinational-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 7, Combinational Circuit Design:

More information

ECE 3401 Lecture 10. More on VHDL

ECE 3401 Lecture 10. More on VHDL ECE 3401 Lecture 10 More on VHDL Outline More on VHDL Some VHDL Basics Data Types Operators Delay Models VHDL for Simulation VHDL for Synthesis 1 Data Types Every signal has a type, type specifies possible

More information

Registers and finite state machines

Registers and finite state machines Registers and finite state machines DAPA E.T.S.I. Informática Universidad de Sevilla /22 Jorge Juan 2, 2, 22 You are free to copy, distribute and communicate this work publicly and

More information

CS/EE Homework 7 Solutions

CS/EE Homework 7 Solutions CS/EE 260 - Homework 7 Solutions 4/2/2001 1. (20 points) A 4 bit twisted ring counter is a sequential circuit which produces the following sequence of output values: 0000, 1000, 1100, 1110, 1111, 0111,

More information

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1 Verilog Synthesis Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis Spring 2007 Lec #8 -- HW Synthesis 1 Logic Synthesis Verilog and VHDL started out

More information

Lattice VHDL Training

Lattice VHDL Training Lattice Part I February 2000 1 VHDL Basic Modeling Structure February 2000 2 VHDL Design Description VHDL language describes a digital system as a set of modular blocks. Each modular block is described

More information

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008 CSE 140L Final Exam Prof. Tajana Simunic Rosing Spring 2008 NAME: ID#: Do not start the exam until you are told to. Turn off any cell phones or pagers. Write your name and PID at the top of every page.

More information

RTL Design (Using ASM/SM Chart)

RTL Design (Using ASM/SM Chart) Digital Circuit Design and Language RTL Design (Using ASM/SM Chart) Chang, Ik Joon Kyunghee University Process of Logic Simulation and Synthesis Design Entry HDL Description Logic Simulation Functional

More information

VHDL Testbench Design. Textbook chapters 2.19, , 9.5

VHDL Testbench Design. Textbook chapters 2.19, , 9.5 VHDL Testbench Design Textbook chapters 2.19, 4.10-4.12, 9.5 The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus

More information

Injntu.com Injntu.com Injntu.com R16

Injntu.com Injntu.com Injntu.com R16 1. a) What are the three methods of obtaining the 2 s complement of a given binary (3M) number? b) What do you mean by K-map? Name it advantages and disadvantages. (3M) c) Distinguish between a half-adder

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING Digital System Design 1 Name: Registration No: Roll No: Semester:

More information

Written exam for IE1204/5 Digital Design Thursday 29/

Written exam for IE1204/5 Digital Design Thursday 29/ Written exam for IE1204/5 Digital Design Thursday 29/10 2015 9.00-13.00 General Information Examiner: Ingo Sander. Teacher: William Sandqvist phone 08-7904487 Exam text does not have to be returned when

More information

CSE140L: Components and Design Techniques for Digital Systems Lab

CSE140L: Components and Design Techniques for Digital Systems Lab CSE140L: Components and Design Techniques for Digital Systems Lab Tajana Simunic Rosing Source: Vahid, Katz, Culler 1 Announcements & Outline Lab 4 due; demo signup times listed on the cse140l site Check

More information

Code No: R Set No. 1

Code No: R Set No. 1 Code No: R059210504 Set No. 1 II B.Tech I Semester Regular Examinations, November 2007 DIGITAL LOGIC DESIGN ( Common to Computer Science & Engineering, Information Technology and Computer Science & Systems

More information

Quick Introduction to SystemVerilog: Sequental Logic

Quick Introduction to SystemVerilog: Sequental Logic ! Quick Introduction to SystemVerilog: Sequental Logic Lecture L3 8-545 Advanced Digital Design ECE Department Many elements Don Thomas, 24, used with permission with credit to G. Larson Today Quick synopsis

More information

Least Common Multiple (LCM)

Least Common Multiple (LCM) Least Common Multiple (LCM) Task: Implement an LCM algorithm that is able to handle any combination of 8-bit (sign bit included) numbers. Use two's complement format to represent negative values. Provide

More information