download instant at

Size: px
Start display at page:

Download "download instant at"

Transcription

1 Chapter 4: Modeling Behavior 1. Construct a VHDL model of a parity generator for 7-bit words. The parity bit is generated to create an even number of bits in the word with a value of 1. Do not prescribe propagation delays to any of the components. Simulate the model and check for functional correctness. entity parity_generator7bit is port( input: in std_logic_vector(6 downto 0); z: out std_logic_vector(7 downto 0)); end parity_generator7bit; architecture behavioral of parity_generator7bit is parity_gen : process(input) is variable index: integer:=0; variable ones: integer:=0; for index in 0 to 6 loop if input(index) = '1' then ones := ones+1; end loop; if (ones mod 2) = 0 then z(0) <= '0'; z(0) <= '1'; z(7 downto 1) <= input(6 downto 0); end process parity_gen; end architecture behavioral; 21

2 VSIM11> force input " " 5 ns, " " 10 ns, " " 15 ns VSIM12> run 20 ns 2. Explain why you cannot have both a sensitivity list and wait statements within a process. Sensitivity list is the list of signals to which the process is sensitive. Any event on any of the signals in the sensitivity list causes the process to be executed once. The same is achieved by placing a wait statement at the ning of the process. Wait statements in general cause a process to be halted and executed from the statement following the wait statement. It is possible to wait on one signal and be sensitive to another leading to a deadlocked situation in which the process will never execute. 3. Construct and test a model of a negative edge-triggered JK flip-flop. 22

3 entity jkff is port( j,k,ck: in std_logic; q,qbar: out std_logic); end entity jkff; architecture behavioral of jkff is output : process(ck) is variable qtemp : std_logic := '1'; variable qbartemp : std_logic := '0'; if falling_edge(ck) then qtemp:= ((j and qbartemp) or ((not k) and qtemp)); qbartemp:= (((not j) or not (qbartemp)) and (k or qbartemp)); q<= qtemp; qbar<= qbartemp; end process output; end architecture behavioral; 23

4 VSIM11> force ck '0' 1 ns, '1' 2 ns -repeat 2 ns VSIM12> force k '1' 1 ns, '0' 10 ns VSIM13> force j '0' 1 ns, '1' 4 ns VSIM14> run 20 ns 4. Consider the construction of a register file with 8 registers, where each register is 32 bits. Implement the model with two processes. One process reads the register file, while another writes the register file. You can implement the registers as signals declared within the architecture and therefore visible to each process. use ieee.std_logic_unsigned.all; entity regfile is 24

5 port (ck, reset : in std_logic; reg : in std_logic_vector(2 downto 0); in_data : in std_logic_vector(31 downto 0); out_data : out std_logic_vector(31 downto 0); r_w : in std_logic); end regfile; architecture behavioral of regfile is type reg_file is array (0 to 7) of std_logic_vector(31 downto 0); signal reg_data : reg_file; read_process: process (ck, reset, r_w) if reset = '1' then -- asynchronous reset (active high) out_data <= (others => '0'); elsif (rising_edge(ck) and r_w = '1') then out_data <= reg_data(conv_integer(reg)); end process read_process; write_process: process (ck, reset, r_w) -- process write_process if reset = '1' then -- asynchronous reset (active high) for index in 0 to 7 loop reg_data(index) <= (others => '0'); end loop; elsif (rising_edge(ck) and r_w = '0') then reg_data(conv_integer(reg)) <= in_data; end process write_process; end behavioral; 25

6 VSIM11> force reset '1' 0 ns, '0' 1 ns VSIM12> force ck '0' 2 ns, '1' 4 ns -repeat 4 ns VSIM13> force r_w '1' 1 ns, '0' 6 ns, '1' 10 ns VSIM14> force in_data " " 5 ns VSIM15> force reg "110" 1 ns VSIM16> run 15 ns 5. Implement a 32-bit ALU with support for the following operations: add, sub, and, or, and complement. The ALU should also produce an output signal that is asserted when the ALU output is 0. This signal may be used to implement branch instructions in a processor datapath. use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity ALU32bit is port ( 26

7 in_a,in_b : in std_logic_vector(31 downto 0); out_data : out std_logic_vector(31 downto 0); opcode : in std_logic_vector(2 downto 0); out_zeros : out std_logic); end entity ALU32bit; architecture behavioral of ALU32bit is type reg_file is array (0 to 7) of std_logic_vector(31 downto 0); operation : process(opcode,in_a,in_b) is variable outd : std_logic_vector(31 downto 0); case opcode is when "000" => outd:= in_a + in_b; when "001" => outd := in_a - in_b; when "010" => outd := in_a and in_b; when "011" => outd := in_a or in_b; when "100" => outd := not(in_a); when others => outd:= (others => '0'); end case; if outd = x" " then out_zeros <= '1'; out_zeros <= '0'; out_data <= outd; end process operation; end architecture behavioral; 27

8 VSIM11> force opcode "000" 1 ns, "001" 4 ns, "010" 7 ns, "011" 10 ns, "100" 13 ns, "101" 16 ns VSIM12> force in_a 16# F 1 ns VSIM13> force in_b 16# ns VSIM14> run 20 ns 6. Show an example of VHDL code that transforms an input periodic clock signal to an output signal at half the frequency. entity freq_divider is port (ck_in, reset : in std_logic; ck_out : out std_logic); end entity freq_divider; architecture behavioral of freq_divider is signal temp : std_logic; 28

9 divide_freq : process (ck_in, reset) if reset = '1' then temp <= '0'; elsif rising_edge(ck_in) then -- rising clock edge temp <= not(temp); end process divide_freq; ck_out <= temp; end architecture behavioral; VSIM11> force reset '1','0' 2 ns VSIM12> force ck_in '0' 1 ns, '1' 2 ns -repeat 2 ns 29

10 7. Construct a VHDL model for generating four-phase non-overlapping clock signals. Pick your own parameters for pulse width and pulse separation intervals. entity four_phase_clock is port (clk1,clk2,clk3,clk4 : out std_logic); end entity four_phase_clock; architecture behavioral of four_phase_clock is signal ck1,ck2,ck3,ck4 : std_logic; clock1 : process is ck1<= '1' after 1 ns, '0' after 2 ns ; wait for 5 ns; end process clock1; clock2 : process is ck2<= '1' after 2 ns, '0' after 3 ns ; wait for 5 ns; end process clock2; clock3 : process is ck3<= '1' after 3 ns, '0' after 4 ns ; wait for 5 ns; end process clock3; clock4 : process is ck4<= '1' after 4 ns, '0' after 5 ns ; wait for 5 ns; end process clock4; clk1<= ck1; clk2<= ck2; clk3<= ck3; clk4<= ck4; end architecture behavioral; 30

11 VSIM11> run 30 ns 8. Implement and test a 16-bit up down counter. use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity counter is port ( reset, up_down,ck: in std_logic; count : out std_logic_vector(3 downto 0)); end entity counter; architecture behavioral of counter is signal upcnt,downcnt: std_logic_vector(3 downto 0); upcount : process(ck,reset,up_down) is if reset = '1' then upcnt <= "0000"; elsif (rising_edge(ck)and up_down = '1' ) then 31

12 if upcnt = "1111" then upcnt <= "0000"; upcnt <= upcnt + 1; end process upcount; downcount : process(ck,reset,up_down) is if reset = '1' then downcnt <= "0000"; elsif (rising_edge(ck) and up_down = '0') then if downcnt = "0000" then downcnt <= "1111"; downcnt <= downcnt - 1; end process downcount; count <= upcnt when up_down = '1' downcnt when up_down = '0'; end architecture behavioral; 32

13 VSIM11> force up_down '1','0' 20 ns VSIM12> force reset '1' 0 ns, '0' 1 ns VSIM13> force ck '0' 1 ns, '1' 2 ns -repeat 2 ns VSIM14> run 40 ns 9. Implement and test a VHDL model for the state machine for a traffic-light controller [4] shown in Figure entity trafficlight is port(ck, reset : in std_logic; input : in std_logic; z : out std_logic_vector(1 downto 0)); end trafficlight; architecture behavioral of trafficlight is signal current_state, next_state : std_logic_vector(1 downto 0); current: process (ck, reset) if reset = '1' then current_state <= "00"; elsif rising_edge(ck) then current_state <= next_state; end process current; determine_nextstate: process (current_state, input) case current_state is when "00" => if input = '0' then next_state <= "01"; next_state <= "10"; when "01" => if input = '0' then next_state <= "00"; next_state <= "10"; when "10" => if input = '0' then 33

14 next_state <= "00"; next_state <= "10"; when others => next_state <= "00"; end case; end process determine_nextstate; output: process (current_state, input) -- process out_logic case current_state is when "00" => if input = '0' then z <= "10"; z <= "00"; when "01" => if input = '0' then z <= "01"; z <= "00"; when "10" => if input = '0' then z <= "01"; z <= "00"; when others => z <= "00"; end case; end process output; end behavioral; 34

15 VSIM11> force ck '0' 1 ns, '1' 2 ns -repeat 2 ns VSIM12> force reset '1' 0 ns, '0' 1 ns VSIM12> run 15 ns 10. Consider a variant of Simulation Exercise 4.3 where we are interested in the occurrence of six 1 s in the bit stream. After six 1 s have been detected, the output remains asserted until the state machine is reset. Construct and test this model. 35

16 0/ /01 0/01 1/00 1/00 2 1/00 entity sequence_detector is port(ck, reset : in std_logic; input : in std_logic; z : out std_logic); end sequence_detector; State machine for a traffic-light controller architecture behavioral of sequence_detector is type statetype is (state0,state1,state2,state3,state4,state5,state6); signal current_state, next_state : statetype:=state0; updatestate : process (ck, reset) if reset = '1' then current_state <= state0; elsif rising_edge(ck) then current_state <= next_state; end process updatestate; determine_nextstate: process (current_state, input) case current_state is when state0 => if input = '1' then next_state <= state1; next_state <= state0; when state1 => if input = '1' then next_state <= state2; next_state <= state0; when state2 => 36

17 if input = '1' then next_state <= state3; next_state <= state0; when state3 => if input = '1' then next_state <= state4; next_state <= state0; when state4 => if input = '1' then next_state <= state5; next_state <= state0; when state5 => if input = '1' then next_state <= state6; next_state <= state0; when state6 => next_state <= state6; when others => next_state <= state0; end case; end process determine_nextstate; output: process (current_state, input) case current_state is when state6 => z<= '1'; when others => z<='0'; end case; end process output; end behavioral; 37

18 VSIM11> force ck '0' 1 ns, '1' 2 ns -repeat 2 ns VSIM12> force VSIM13> force input '0', '1' 4 ns,'0' 6 ns, '1' 8 ns, '0' 22 ns VSIM14> run 27 ns 11. Consider the following code sequence. At time 100 the process is activated due to an event (0 to 1) on signal x. At this time the values of signals sig_s1, sig_s2, y, and z are 0, 1, 1, and 0 respectively. What is the value of signal res2 scheduled for time 10 ns?. proc2: process (x, y, z) -- Process 2 L1: sig_s1 <= (x and y) after 10 ns; L2: sig_s2 <= (sig_s1 xor z) after 10 ns; L3: res2 <= (sig_s1 nand sig_s2) after 10 ns; end process; 38

19 res2 is scheduled to be the value 1 after 10ns. This is so because the present values of sig_s1 and sig_s2 are 0. Only during the next event will the res2 signal schedule the changes that were affected on sig_s1 and s-g_s2 due to the event on x. 12. Write a VHDL model for detecting equality between two four bit numbers. entity equality_detector is Port ( A,B: in std_logic_vector(3 downto 0); z : out std_logic ); end entity equality_detector ; architecture behavioral of equality_detector is test: process(a,b) is if A=B then z<= '1'; z<='0'; end process test; end architecture behavioral; 39

20 VSIM11> force A "0111" 0 ns, "1000" 3 ns VSIM12> force B "1000" VSIM13> run 10 ns 13. Write a VHDL model for a BCD counter(binary Coded Decimal is the straight binary values of decimal equivalents i.e values from 0000 to 1001 only since decimals range only from 0 to 9 ) use ieee.std_logic_unsigned.all; entity bcd_counter is Port ( clk : in std_logic;-- count input reset : in std_logic;-- resets count to 0 carry : out std_logic;-- Overflow (from 9) z : out std_logic_vector(3 downto 0) ); end bcd_counter; architecture behavioral of bcd_counter is signal c : std_logic_vector(3 downto 0); cnt: process(clk,reset) is 40

21 if (reset = '1') then c <= "0000"; carry <= '0'; elsif rising_edge(clk) then if ( c = 9) then c <= "0000"; carry <= '1'; c <= c + 1; carry <= '0'; end process cnt; z <= c; end behavioral; VSIM11> force reset '1' 0 ns, '0' 1 ns VSIM12> force clk '0' 1 ns, '1' 2 ns -repeat 2 ns VSIM13> run 40 ns 41

Class 19 Sequential Logic: Flip-Flop

Class 19 Sequential Logic: Flip-Flop Class 9 Sequential Logic: Flip-Flop June 2, 22 2 Differences between Latch and Flip-Flop D latch Level trigger D flip-flop Edge trigger June 2, 22 3 Function Table of D Flip-Flop DFF CLK D D flip-flop

More information

Class 06 Sequential Logic: Flip-Flop

Class 06 Sequential Logic: Flip-Flop Class 06 Sequential Logic: Flip-Flop June 16, 2017 2 Differences between Latch and Flip-Flop D latch Level trigger D flip-flop Edge trigger 1 June 16, 2017 3 Function Table of D Flip-Flop DFF D flip-flop

More information

Flip-flop and Registers

Flip-flop and Registers ECE 322 Digital Design with VHDL Flip-flop and Registers Lecture Textbook References n Sequential Logic Review Stephen Brown and Zvonko Vranesic, Fundamentals of Digital Logic with VHDL Design, 2 nd or

More information

ECE 3401 Lecture 12. Sequential Circuits (II)

ECE 3401 Lecture 12. Sequential Circuits (II) EE 34 Lecture 2 Sequential ircuits (II) Overview of Sequential ircuits Storage Elements Sequential circuits Storage elements: Latches & Flip-flops Registers and counters ircuit and System Timing Sequential

More information

ACS College of Engineering. Department of Biomedical Engineering. HDL pre lab questions ( ) Cycle-1

ACS College of Engineering. Department of Biomedical Engineering. HDL pre lab questions ( ) Cycle-1 ACS College of Engineering Department of Biomedical Engineering HDL pre lab questions (2015-2016) Cycle-1 1. What is truth table? 2. Which gates are called universal gates? 3. Define HDL? 4. What is the

More information

ECE 263 Digital Systems, Fall 2015

ECE 263 Digital Systems, Fall 2015 ECE 263 Digital Systems, Fall 2015 REVIEW: FINALS MEMORY ROM, PROM, EPROM, EEPROM, FLASH RAM, DRAM, SRAM Design of a memory cell 1. Draw circuits and write 2 differences and 2 similarities between DRAM

More information

Experiment 8 Introduction to Latches and Flip-Flops and registers

Experiment 8 Introduction to Latches and Flip-Flops and registers Experiment 8 Introduction to Latches and Flip-Flops and registers Introduction: The logic circuits that have been used until now were combinational logic circuits since the output of the device depends

More information

ECE 3401 Lecture 11. Sequential Circuits

ECE 3401 Lecture 11. Sequential Circuits EE 3401 Lecture 11 Sequential ircuits Overview of Sequential ircuits Storage Elements Sequential circuits Storage elements: Latches & Flip-flops Registers and counters ircuit and System Timing Sequential

More information

Flip-Flops and Registers

Flip-Flops and Registers The slides included herein were taken from the materials accompanying Fundamentals of Logic Design, 6 th Edition, by Roth and Kinney, and were used with permission from Cengage Learning. Flip-Flops and

More information

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer 1 P a g e HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer Objectives: Develop the behavioural style VHDL code for D-Flip Flop using gated,

More information

Eng. Mohammed Samara. Fall The Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department

Eng. Mohammed Samara. Fall The Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department Fall 2011 The Islamic University of Gaza Faculty of Engineering Computer Engineering Department ECOM 4111 - Digital Systems Design Lab Lab 7: Prepared By: Eng. Mohammed Samara Introduction: A counter is

More information

Figure 1 Block diagram of a 4-bit binary counter

Figure 1 Block diagram of a 4-bit binary counter Lab 3: Four-Bit Binary Counter EE-459/500 HDL Based Digital Design with Programmable Logic Electrical Engineering Department, University at Buffalo Last update: Cristinel Ababei, August 2012 1. Objective

More information

hochschule fu r angewandte wissenschaften hamburg Prof. Dr. B. Schwarz FB Elektrotechnik/Informatik

hochschule fu r angewandte wissenschaften hamburg Prof. Dr. B. Schwarz FB Elektrotechnik/Informatik 8 Shift Registers A Johnson counter contains the basic structure of a shift register which is made up by a chain of D- FFs. Beginning with the LSB of a register (a number of D-FFs) each D-FF output can

More information

Design Problem 4 Solutions

Design Problem 4 Solutions CSE 260 Digital Computers: Organization and Logical Design Jon Turner Design Problem 4 Solutions In this problem, you are to design, simulate and implement a maze game on the S3 board, using VHDL. This

More information

Outline. CPE/EE 422/522 Advanced Logic Design L04. Review: 8421 BCD to Excess3 BCD Code Converter. Review: Mealy Sequential Networks

Outline. CPE/EE 422/522 Advanced Logic Design L04. Review: 8421 BCD to Excess3 BCD Code Converter. Review: Mealy Sequential Networks Outline PE/EE 422/522 Advanced Logic Design L4 Electrical and omputer Engineering University of Alabama in Huntsville What we know ombinational Networks Analysis, Synthesis, Simplification, Hazards, Building

More information

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Spring 2018 ECOM 2022 Khaleel I. Shaheen Sequential Digital Design Laboratory Manual Experiment #7 Counters Objectives

More information

Feedback Sequential Circuits

Feedback Sequential Circuits Feedback Sequential Circuits sequential circuit output depends on 1. current inputs 2. past sequence of inputs current state feedback sequential circuit uses ordinary gates and feedback loops to create

More information

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems 1 P a g e Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems Lab 5 - VHDL for Sequential Circuits: Implementing a customized State Machine 15 Marks ( 2 weeks) Due

More information

Logic Design. Flip Flops, Registers and Counters

Logic Design. Flip Flops, Registers and Counters Logic Design Flip Flops, Registers and Counters Introduction Combinational circuits: value of each output depends only on the values of inputs Sequential Circuits: values of outputs depend on inputs and

More information

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Chapter 6. Flip-Flops and Simple Flip-Flop Applications Chapter 6 Flip-Flops and Simple Flip-Flop Applications Basic bistable element It is a circuit having two stable conditions (states). It can be used to store binary symbols. J. C. Huang, 2004 Digital Logic

More information

CHAPTER 4: Logic Circuits

CHAPTER 4: Logic Circuits CHAPTER 4: Logic Circuits II. Sequential Circuits Combinational circuits o The outputs depend only on the current input values o It uses only logic gates, decoders, multiplexers, ALUs Sequential circuits

More information

VLSI DESIGN LAB (EE-330-F) VI SEMESTER. Electrical and Electronics Engineering

VLSI DESIGN LAB (EE-330-F) VI SEMESTER. Electrical and Electronics Engineering VLSI DESIGN LAB (EE-330-F) VI SEMESTER Electrical and Electronics Engineering DEPARTMENT OF ELECTRICAL & ELECTRONICS DRONACHARAY COLLEGE OF ENGINEERING KHENTAWAS, GURGAON-123506 DEPARTMENT OF ELECTRICAL

More information

ECE337 Lab 4 Introduction to State Machines in VHDL

ECE337 Lab 4 Introduction to State Machines in VHDL ECE337 Lab Introduction to State Machines in VHDL In this lab you will: Design, code, and test the functionality of the source version of a Moore model state machine of a sliding window average filter.

More information

Chapter 8 Registers & Counters

Chapter 8 Registers & Counters Chapter 8 Registers & Counters 8.1 Introduction Register is a type of sequential circuit used to store binary information or to manipulate the binary information which consists of flip-flops and combinational

More information

CS/EE Homework 6

CS/EE Homework 6 CS/EE 260 - Homework 6 Due 3/16/2000 1. Use VHDL to design the 4 bit arithmetic unit specified in problem 4 of homework 5 (you may borrow from the posted solution, if you wish). Use a dataflow description

More information

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1 Sequential Logic E&CE 223 igital Circuits and Systems (A. Kennings) Page 1 Sequential Circuits Have considered only combinational circuits in which circuit outputs are determined entirely by current circuit

More information

Outputs Combinational circuit. Next state. Fig. 4-1 Block Diagram of a Sequential Circuit

Outputs Combinational circuit. Next state. Fig. 4-1 Block Diagram of a Sequential Circuit 4- Inputs Outputs ombinational circuit Next state Storage elements Present state Fig. 4- Block Diagram of a Sequential ircuit 2 Prentice Hall, Inc. 4-2 (a) t pd (b) t pd 2 t pd (d) 2 t pd (c) t pd Fig.

More information

Chapter 4. Logic Design

Chapter 4. Logic Design Chapter 4 Logic Design 4.1 Introduction. In previous Chapter we studied gates and combinational circuits, which made by gates (AND, OR, NOT etc.). That can be represented by circuit diagram, truth table

More information

Synchronous Sequential Logic

Synchronous Sequential Logic Synchronous Sequential Logic Ranga Rodrigo August 2, 2009 1 Behavioral Modeling Behavioral modeling represents digital circuits at a functional and algorithmic level. It is used mostly to describe sequential

More information

Microprocessor Design

Microprocessor Design Microprocessor Design Principles and Practices With VHDL Enoch O. Hwang Brooks / Cole 2004 To my wife and children Windy, Jonathan and Michelle Contents 1. Designing a Microprocessor... 2 1.1 Overview

More information

4:1 Mux Symbol 4:1 Mux Circuit

4:1 Mux Symbol 4:1 Mux Circuit Exercise 6: Combinational Circuit Blocks Revision: October 20, 2009 215 E Main Suite D Pullman, WA 99163 (509) 334 6306 Voice and Fax STUDT I am submitting my own work, and I understand penalties will

More information

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB Digital Design LAB Islamic University Gaza Engineering Faculty Department of Computer Engineering Fall 2012 ECOM 2112: Digital Design LAB Eng: Ahmed M. Ayash Experiment # 9 Clock generator circuits & Counters

More information

Laboratory Exercise 7

Laboratory Exercise 7 Laboratory Exercise 7 Finite State Machines This is an exercise in using finite state machines. Part I We wish to implement a finite state machine (FSM) that recognizes two specific sequences of applied

More information

Registers and Counters

Registers and Counters Registers and Counters Clocked sequential circuit = F/Fs and combinational gates Register Group of flip-flops (share a common clock and capable of storing one bit of information) Consist of a group of

More information

1. Convert the decimal number to binary, octal, and hexadecimal.

1. Convert the decimal number to binary, octal, and hexadecimal. 1. Convert the decimal number 435.64 to binary, octal, and hexadecimal. 2. Part A. Convert the circuit below into NAND gates. Insert or remove inverters as necessary. Part B. What is the propagation delay

More information

Lecture 8: Sequential Logic

Lecture 8: Sequential Logic Lecture 8: Sequential Logic Last lecture discussed how we can use digital electronics to do combinatorial logic we designed circuits that gave an immediate output when presented with a given set of inputs

More information

Registers and Counters

Registers and Counters Registers and Counters A register is a group of flip-flops which share a common clock An n-bit register consists of a group of n flip-flops capable of storing n bits of binary information May have combinational

More information

Level and edge-sensitive behaviour

Level and edge-sensitive behaviour Level and edge-sensitive behaviour Asynchronous set/reset is level-sensitive Include set/reset in sensitivity list Put level-sensitive behaviour first: process (clock, reset) is begin if reset = '0' then

More information

CS8803: Advanced Digital Design for Embedded Hardware

CS8803: Advanced Digital Design for Embedded Hardware CS883: Advanced Digital Design for Embedded Hardware Lecture 4: Latches, Flip-Flops, and Sequential Circuits Instructor: Sung Kyu Lim (limsk@ece.gatech.edu) Website: http://users.ece.gatech.edu/limsk/course/cs883

More information

Lab 3: VGA Bouncing Ball I

Lab 3: VGA Bouncing Ball I CpE 487 Digital Design Lab Lab 3: VGA Bouncing Ball I 1. Introduction In this lab, we will program the FPGA on the Nexys2 board to display a bouncing ball on a 640 x 480 VGA monitor connected to the VGA

More information

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs) Sequential Circuits Combinational circuits Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs) Sequential circuits Combination circuits with memory

More information

Asynchronous (Ripple) Counters

Asynchronous (Ripple) Counters Circuits for counting events are frequently used in computers and other digital systems. Since a counter circuit must remember its past states, it has to possess memory. The chapter about flip-flops introduced

More information

Bachelor of Technology (Electronics and Instrumentation Engg.)

Bachelor of Technology (Electronics and Instrumentation Engg.) 1 A Project Report on Embedded processor design and Implementation of CAM In partial fulfillment of the requirements of Bachelor of Technology (Electronics and Instrumentation Engg.) Submitted By Jaswant

More information

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist Sequential circuits Same input can produce different output Logic circuit If the same input may produce different output signal, we have a sequential logic circuit. It must then have an internal memory

More information

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Final Exam review: chapter 4 and 5. Supplement 3 and 4 Final Exam review: chapter 4 and 5. Supplement 3 and 4 1. A new type of synchronous flip-flop has the following characteristic table. Find the corresponding excitation table with don t cares used as much

More information

Counters

Counters Counters A counter is the most versatile and useful subsystems in the digital system. A counter driven by a clock can be used to count the number of clock cycles. Since clock pulses occur at known intervals,

More information

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

CSE115: Digital Design Lecture 23: Latches & Flip-Flops Faculty of Engineering CSE115: Digital Design Lecture 23: Latches & Flip-Flops Sections 7.1-7.2 Suggested Reading A Generic Digital Processor Building Blocks for Digital Architectures INPUT - OUTPUT Interconnect:

More information

CHAPTER 4: Logic Circuits

CHAPTER 4: Logic Circuits CHAPTER 4: Logic Circuits II. Sequential Circuits Combinational circuits o The outputs depend only on the current input values o It uses only logic gates, decoders, multiplexers, ALUs Sequential circuits

More information

Registers and Counters

Registers and Counters Registers and Counters Clocked sequential circuit = F/Fs and combinational gates Register Group of flip-flops (share a common clock and capable of storing one bit of information) Consist of a group of

More information

Subject : EE6301 DIGITAL LOGIC CIRCUITS

Subject : EE6301 DIGITAL LOGIC CIRCUITS QUESTION BANK Programme : BE Subject : Semester / Branch : III/EEE UNIT 1 NUMBER SYSTEMS AND DIGITAL LOGIC FAMILIES Review of number systems, binary codes, error detection and correction codes (Parity

More information

Task 4_B. Decoder for DCF-77 Radio Clock Receiver

Task 4_B. Decoder for DCF-77 Radio Clock Receiver Embedded Processor Lab (EIT-EMS-546-L-4) Task 4_B FB Elektrotechnik und Informationstechnik Prof. Dr.-Ing. Norbert Wehn Dozent: Uwe Wasenmüller Raum 12-213, wa@eit.uni-kl.de Task 4_B Decoder for DCF-77

More information

IE1204 Digital Design F11: Programmable Logic, VHDL for Sequential Circuits

IE1204 Digital Design F11: Programmable Logic, VHDL for Sequential Circuits IE1204 Digital Design F11: Programmable Logic, VHDL for Sequential Circuits Elena Dubrova KTH/ICT/ES dubrova@kth.se This lecture BV pp. 98-118, 418-426, 507-519 IE1204 Digital Design, HT14 2 Programmable

More information

ECE 341. Lecture # 2

ECE 341. Lecture # 2 ECE 341 Lecture # 2 Instructor: Zeshan Chishti zeshan@pdx.edu October 1, 2014 Portland State University Announcements Course website reminder: http://www.ece.pdx.edu/~zeshan/ece341.htm Homework 1: Will

More information

CHAPTER1: Digital Logic Circuits

CHAPTER1: Digital Logic Circuits CS224: Computer Organization S.KHABET CHAPTER1: Digital Logic Circuits 1 Sequential Circuits Introduction Composed of a combinational circuit to which the memory elements are connected to form a feedback

More information

library IEEE; use IEEE.STD_LOGIC_1164.ALL;

library IEEE; use IEEE.STD_LOGIC_1164.ALL; library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values use IEEE.NUMERIC_STD.ALL; -- Uncomment the following

More information

IT T35 Digital system desigm y - ii /s - iii

IT T35 Digital system desigm y - ii /s - iii UNIT - III Sequential Logic I Sequential circuits: latches flip flops analysis of clocked sequential circuits state reduction and assignments Registers and Counters: Registers shift registers ripple counters

More information

Digital Fundamentals: A Systems Approach

Digital Fundamentals: A Systems Approach Digital Fundamentals: A Systems Approach Counters Chapter 8 A System: Digital Clock Digital Clock: Counter Logic Diagram Digital Clock: Hours Counter & Decoders Finite State Machines Moore machine: One

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) Quiz #2 - Spring 2003 Prof. Anantha Chandrakasan and Prof. Don

More information

Figure 1: segment of an unprogrammed and programmed PAL.

Figure 1: segment of an unprogrammed and programmed PAL. PROGRAMMABLE ARRAY LOGIC The PAL device is a special case of PLA which has a programmable AND array and a fixed OR array. The basic structure of Rom is same as PLA. It is cheap compared to PLA as only

More information

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic Chapter 5. Synchronous Sequential Logic 1 5.1 Introduction Electronic products: ability to send, receive, store, retrieve, and process information in binary format Dependence on past values of inputs Sequential

More information

D Latch (Transparent Latch)

D Latch (Transparent Latch) D Latch (Transparent Latch) -One way to eliminate the undesirable condition of the indeterminate state in the SR latch is to ensure that inputs S and R are never equal to 1 at the same time. This is done

More information

Laboratory Exercise 7

Laboratory Exercise 7 Laboratory Exercise 7 Finite State Machines This is an exercise in using finite state machines. Part I We wish to implement a finite state machine (FSM) that recognizes two specific sequences of applied

More information

EKT 121/4 ELEKTRONIK DIGIT 1

EKT 121/4 ELEKTRONIK DIGIT 1 EKT 2/4 ELEKTRONIK DIGIT Kolej Universiti Kejuruteraan Utara Malaysia Sequential Logic Circuits - COUNTERS - LATCHES (review) S-R R Latch S-R R Latch Active-LOW input INPUTS OUTPUTS S R Q Q COMMENTS Q

More information

Synchronous Sequential Design

Synchronous Sequential Design Synchronous Sequential Design SMD098 Computation Structures Lecture 4 1 Synchronous sequential systems Almost all digital systems have some concept of state the outputs of a system depends on the past

More information

Digital Circuits I and II Nov. 17, 1999

Digital Circuits I and II Nov. 17, 1999 Physics 623 Digital Circuits I and II Nov. 17, 1999 Digital Circuits I 1 Purpose To introduce the basic principles of digital circuitry. To understand the small signal response of various gates and circuits

More information

IE1204 Digital Design. F11: Programmable Logic, VHDL for Sequential Circuits. Masoumeh (Azin) Ebrahimi

IE1204 Digital Design. F11: Programmable Logic, VHDL for Sequential Circuits. Masoumeh (Azin) Ebrahimi IE1204 Digital Design F11: Programmable Logic, VHDL for Sequential Circuits Masoumeh (Azin) Ebrahimi (masebr@kth.se) Elena Dubrova (dubrova@kth.se) KTH / ICT / ES This lecture BV pp. 98-118, 418-426, 507-519

More information

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus Digital logic: ALUs Sequential logic circuits CS207, Fall 2004 October 11, 13, and 15, 2004 1 Read-only memory (ROM) A form of memory Contents fixed when circuit is created n input lines for 2 n addressable

More information

DIGITAL SYSTEM DESIGN VHDL Coding for FPGAs Unit 7

DIGITAL SYSTEM DESIGN VHDL Coding for FPGAs Unit 7 DIGITAL SYSTM DSIGN VHDL Coding for FPGAs Unit 7 INTRODUCTION TO DIGITAL SYSTM DSIGN: Digital System Components Use of generic map to map parameters. xample: Digital Stopwatch xample: Lights Pattern mbedding

More information

SEMESTER ONE EXAMINATIONS 2002

SEMESTER ONE EXAMINATIONS 2002 SEMESTER ONE EXAMINATIONS 2002 EE101 Digital Electronics Solutions Question 1. An assembly line has 3 failsafe sensors and 1 emergency shutdown switch. The Line should keep moving unless any of the following

More information

Last time, we saw how latches can be used as memory in a circuit

Last time, we saw how latches can be used as memory in a circuit Flip-Flops Last time, we saw how latches can be used as memory in a circuit Latches introduce new problems: We need to know when to enable a latch We also need to quickly disable a latch In other words,

More information

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany Digital Logic Design Sequential Circuits Dr. Basem ElHalawany Combinational vs Sequential inputs X Combinational Circuits outputs Z A combinational circuit: At any time, outputs depends only on inputs

More information

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS) DIGITAL SYSTEM DESIGN UNIT I (2 MARKS) 1. Convert Binary number (111101100) 2 to Octal equivalent. 2. Convert Binary (1101100010011011) 2 to Hexadecimal equivalent. 3. Simplify the following Boolean function

More information

Chapter 6 Registers and Counters

Chapter 6 Registers and Counters EEA051 - Digital Logic 數位邏輯 Chapter 6 Registers and Counters 吳俊興國立高雄大學資訊工程學系 January 2006 Chapter 6 Registers and Counters 6-1 Registers 6-2 Shift Registers 6-3 Ripple Counters 6-4 Synchronous Counters

More information

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

Introduction. NAND Gate Latch.  Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1 2007 Introduction BK TP.HCM FLIP-FLOP So far we have seen Combinational Logic The output(s) depends only on the current values of the input variables Here we will look at Sequential Logic circuits The

More information

MC9211 Computer Organization

MC9211 Computer Organization MC9211 Computer Organization Unit 2 : Combinational and Sequential Circuits Lesson2 : Sequential Circuits (KSB) (MCA) (2009-12/ODD) (2009-10/1 A&B) Coverage Lesson2 Outlines the formal procedures for the

More information

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1 DAY MODU LE TOPIC QUESTIONS Day 1 Day 2 Day 3 Day 4 I Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation Phase Shift Wein Bridge oscillators.

More information

UNIT 1 NUMBER SYSTEMS AND DIGITAL LOGIC FAMILIES 1. Briefly explain the stream lined method of converting binary to decimal number with example. 2. Give the Gray code for the binary number (111) 2. 3.

More information

CAD FOR VLSI DESIGN - I Lecture 32. V. Kamakoti and Shankar Balachandran

CAD FOR VLSI DESIGN - I Lecture 32. V. Kamakoti and Shankar Balachandran CD FOR VLSI DESIGN - I Lecture 32 V. Kamakoti and Shankar Balachandran Flip-flops with synchronous Preset and Clear Inferring a flip-flop with synchronous Preset and Clear comes out of a combination of

More information

Asynchronous Counter

Asynchronous Counter Asynchronous Counter Contents: Asynchronous/Ripple Counter Propagation Delay in Ripple Counter MOD Number Synchronous/Parallel Counter 10101010101010101010101010101010101010101010101010101010101010101010101010101010

More information

Logic Design Viva Question Bank Compiled By Channveer Patil

Logic Design Viva Question Bank Compiled By Channveer Patil Logic Design Viva Question Bank Compiled By Channveer Patil Title of the Practical: Verify the truth table of logic gates AND, OR, NOT, NAND and NOR gates/ Design Basic Gates Using NAND/NOR gates. Q.1

More information

Chapter 5 Synchronous Sequential Logic

Chapter 5 Synchronous Sequential Logic Chapter 5 Synchronous Sequential Logic Chih-Tsun Huang ( 黃稚存 ) http://nthucad.cs.nthu.edu.tw/~cthuang/ Department of Computer Science National Tsing Hua University Outline Introduction Storage Elements:

More information

Multiplexor (aka MUX) An example, yet VERY useful circuit!

Multiplexor (aka MUX) An example, yet VERY useful circuit! Multiplexor (aka MUX) An example, yet VERY useful circuit! A B 0 1 Y S A B Y 0 0 x 0 0 1 x 1 1 x 0 0 1 x 1 1 S=1 S=0 Y = (S)? B:A; Y=S A+SB when S = 0: output A 1: output B 56 A 32-bit MUX Use 32 1-bit

More information

Debugging of VHDL Hardware Designs on Altera s DE2 Boards

Debugging of VHDL Hardware Designs on Altera s DE2 Boards Debugging of VHDL Hardware Designs on Altera s DE2 Boards This tutorial presents some basic debugging concepts that can be helpful in creating VHDL designs for implementation on Altera s DE2 boards. It

More information

Chapter 7 Counters and Registers

Chapter 7 Counters and Registers Chapter 7 Counters and Registers Chapter 7 Objectives Selected areas covered in this chapter: Operation & characteristics of synchronous and asynchronous counters. Analyzing and evaluating various types

More information

UNIT IV. Sequential circuit

UNIT IV. Sequential circuit UNIT IV Sequential circuit Introduction In the previous session, we said that the output of a combinational circuit depends solely upon the input. The implication is that combinational circuits have no

More information

Unit 11. Latches and Flip-Flops

Unit 11. Latches and Flip-Flops Unit 11 Latches and Flip-Flops 1 Combinational Circuits A combinational circuit consists of logic gates whose outputs, at any time, are determined by combining the values of the inputs. For n input variables,

More information

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7 California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 322: Digital Design with VHDL Laboratory 7 Rational: The purpose of this lab is to become familiar in using

More information

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Section 6.8 Synthesis of Sequential Logic Page 1 of 8 Section 6.8 Synthesis of Sequential Logic Page of 8 6.8 Synthesis of Sequential Logic Steps:. Given a description (usually in words), develop the state diagram. 2. Convert the state diagram to a next-state

More information

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering Sri Vidya College of Engineering And Technology Virudhunagar 626 005 Department of Electrical and Electronics Engineering Year/ Semester/ Class : II/ III/ EEE Academic Year: 2017-2018 Subject Code/ Name:

More information

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING DRONACHARYA GROUP OF INSTITUTIONS, GREATER NOIDA Affiliated to Mahamaya Technical University, Noida Approved by AICTE DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Lab Manual for Computer Organization Lab

More information

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic. Chapter 6. sequential logic design This is the beginning of the second part of this course, sequential logic. equential logic equential circuits simple circuits with feedback latches edge-triggered flip-flops

More information

Digital Logic Design ENEE x. Lecture 19

Digital Logic Design ENEE x. Lecture 19 Digital Logic Design ENEE 244-010x Lecture 19 Announcements Homework 8 due on Monday, 11/23. Agenda Last time: Timing Considerations (6.3) Master-Slave Flip-Flops (6.4) This time: Edge-Triggered Flip-Flops

More information

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M CSE-4523 Latches and Flip-flops Dr. Izadi NOR gate property: A B Z A B Z Cross coupled NOR gates: S M S R M R S M R S R S R M S S M R R S ' Gate R Gate S R S G R S R (t+) S G R Flip_flops:. S-R flip-flop

More information

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and

More information

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30 Department of CSIT Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30 Section A: (All 10 questions compulsory) 10X1=10 Very Short Answer Questions: Write

More information

STATIC RANDOM-ACCESS MEMORY

STATIC RANDOM-ACCESS MEMORY STATIC RANDOM-ACCESS MEMORY by VITO KLAUDIO OCTOBER 10, 2015 CSC343 FALL 2015 PROF. IZIDOR GERTNER Table of contents 1. Objective... pg. 2 2. Functionality and Simulations... pg. 4 2.1 SR-LATCH... pg.

More information

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari Sequential Circuits The combinational circuit does not use any memory. Hence the previous state of input does not have any effect on the present state of the circuit. But sequential circuit has memory

More information

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem   ahmadsm AT kfupm Phone: Office: COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: 22-324 Objectives Sequential Circuits Memory Elements Latches Flip-Flops Combinational

More information

Lab 6: Video Game PONG

Lab 6: Video Game PONG CpE 487 Digital Design Lab Lab 6: Video Game PONG 1. Introduction In this lab, we will extend the FPGA code we developed in Labs 3 and 4 (Bouncing Ball) to build a simple version of the 1970 s arcade game

More information

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS NH 67, Karur Trichy Highways, Puliyur C.F, 639 114 Karur District DEPARTMENT OF ELETRONICS AND COMMUNICATION ENGINEERING COURSE NOTES SUBJECT: DIGITAL ELECTRONICS CLASS: II YEAR ECE SUBJECT CODE: EC2203

More information