CDA 3100 Recitation Week 11.

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Counters Discussion D8.3.
Verilog in transistor level using Microwind
CDA 3100 Recitation Week 10.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Sequential Logic in Verilog
Synchronous Sequential Logic
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Multiplication and Division
Verilog Modules for Common Digital Functions
Review for Exam 2 Using MUXs to implement logic
Table 7.1 Verilog Operators.
VERILOG EXAMPLES. //example 1.1 module ffNand; wireq, qBar; regpreset, clear; nand #1 g1 (q, qBar, preset), g2 (qBar, q, clear); endmodule.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
Registers and Counters. Register Register is built with gates, but has memory. The only type of flip-flop required in this class – the D flip-flop – Has.
FSM examples.
Pulse-Width Modulated DAC
4-bit Grey Code Converter with Counter Lincoln Chin Dat Tran Thao Nguyen Tien Huynh.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Ring Counter Discussion 11.3 Example 32.
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
CS 61C Discussion 10 (1) Jaein Jeong Fall input MUX °Out = in0 * select’ + in1 * select in0in1selectout
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Registers and Shift Registers Discussion D8.2. D Flip-Flop X 0 Q 0 ~Q 0 D CLK Q ~Q D gets latched to Q on the rising edge of the clock. Positive.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior : initial blocks execute.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
Traffic Lights Discussion D8.3a. Recall Divide-by-8 Counter Use Q2, Q1, Q0 as inputs to a combinational circuit to produce an arbitrary waveform. s0 0.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Digital Electronics.
Unit 4 Structural Descriptions SYLLABUS Highlights of Structural descriptions Organization of the Structural descriptions Binding State Machines Generate(HDL),Generic(VHDL),
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure Implementation of an FSM in a CPLD..
Overview Logistics Last lecture Today HW5 due today
An Introduction to Verilog: Transitioning from VHDL
Figure 8.1. The general form of a sequential circuit.
Lecture 11 Registers and Counters
© Copyright 2004, Gaetano Borriello and Randy H. Katz
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Learning Outcome By the end of this chapter, students are expected to be able to: Design State Machine Write Verilog State Machine by Boolean Algebra and.
Registers and Counters
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
Pulse-Width Modulation (PWM)
SYNTHESIS OF SEQUENTIAL LOGIC
CSE 370 – Winter Sequential Logic-2 - 1
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Verilog.
Registers and Counters
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Register-Transfer Level Components in Verilog
The Verilog Hardware Description Language
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Registers and Counters
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Registers and Counters
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Registers and Counters
Presentation transcript:

CDA 3100 Recitation Week 11

Design a 2-bit counter: Count in the order of 0, 3, 1, 2, 0, 3, 1, 2, … Use a D flip-flop Construct your truth table in the form of a next state diagram That is if input is 00, output is 11

Design 4-bit encoder: Truth (Next State)Table Q1 Q0 D1 D0 1

Design 4-bit encoder: K-Map for D1 Q1 Q0 1 D1 = ~Q1

Design 4-bit encoder: K-Map for D0 Q1 Q0 1 D0 = (~Q1 * ~Q0) + (Q1 * Q0) = ~(Q1 xor Q0)

Verilog Code: Write a Verilog module to have the same effect as the 2-bit counter implemented earlier Just a reminder D1 = ~Q1 D0 = ~(Q1 ^ Q0) You don’t have to reimplement the D flip-flop module, just use the one presented in class module Dff1(D, clk, Q, Qbar); Your module’s prototype will look like: module counter_2_bit(clk, Q);

Verilog Code: Dff1 Module Dff1 (D, clk, Q, Qbar); input D, clk; output reg Q, Qbar; initial begin Q = 0; Qbar = 1; end always @(posedge clk) begin #1 Q = D; Qbar = ~Q; endmodule

Verilog Code: counter_2_bit module counter_2_bit(clk, Q); input clk; output [1:0] Q; wire Q1, Q1bar, Q0, Q0bar, D1, D0; assign D0 = ~(Q1 ^ Q0); Dff1 C0(D0, clk, Q0, Q0bar); assign D1 = ~Q1; Dff1 C1(D1, clk, Q1, Q1bar); assign Q[1] = Q1; assign Q[0] = Q0; endmodule