Lottery Speaker: Tsung-Yi Wu.

Slides:



Advertisements
Similar presentations
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Advertisements

Counters Discussion D8.3.
Verilog in transistor level using Microwind
CDA 3100 Recitation Week 11.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Sequential Logic in Verilog
Supplement on Verilog adder examples
ECE 551 Digital System Design & Synthesis Lecture 06 Loops Non-synthesizable Constructs File I/O.
//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.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
FSM examples.
Edge-Triggered D Flip-Flops
Pulse-Width Modulated DAC
將電路版上振盪電路的輸出頻率,依需求除頻 本實驗將實作除2、4、8,並以LED燈顯示
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.
A/D Converter Datapaths Discussion D8.4. Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit:
Lessons from last lab: 1.Many had the “# skipping” problem 2.Most assumed there was something wrong with their code 3.How does one check their code? 4.SIMULATE!!
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
DIGITAL DESIGN WITH VHDL Exercise 1 1Muhammad Amir Yousaf.
Verilog Descriptions of Digital Systems. Electronic Lock // // Electronic combinational lock // module lock(seg7,key, valid_key, col, row, mclk, resetL)
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
Sequential Logic in Verilog
Week Four Design & Simulation Example slides. Agenda Review the tiny example (Minako “logic”)from last week – look at the detailed static timing report.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
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.
displayCtrlr Specification
Brief Verilog.
Finite State Machine (FSM) Nattha Jindapetch December 2008.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 Arithmetic, ALUs Lecture 9 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Lab for Cell-Based IC Design
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Lab5-1 張明峰 交大資工系 Lab 5: FSM and BCD counters Implement the vending machine of lab 2 A two-digit BCD counter –two BCD counters –can load data in parallel.
1 4-Integrating Peripherals in Embedded Systems (cont.)
Exp#7 Finite State Machine Design in Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
DE2-115 Control Panel - Part I
EECE6017C - Lab 0 Introduction to Altera tools and Basic Digital Logic
Digital Design using FPGAs and Verilog HDL
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Verilog Introduction Fall
Testbenches HDL that tests another module: device under test (dut)
‘if-else’ & ‘case’ Statements
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Hardware Description Languages
Pulse-Width Modulation (PWM)
FPGA Project I: Up/Down Counter w/ Async Reset
Testbenches HDL that tests another module: device under test (dut)
Computer Architecture and Design Lecture 6
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
LAB #2 Xilinix ISE Foundation Tools Schematic Capture “A Tutorial”
Verilog for Digital Design
Register-Transfer Level Components in Verilog
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
CS 153 Logic Design Lab Professor Ian G. Harris
332:437 Lecture 9 Verilog Example
332:437 Lecture 9 Verilog Example
332:437 Lecture 9 Verilog Example
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Lottery Speaker: Tsung-Yi Wu

Architecture 4 LEDs STOP Switch RESET Switch

How to Play Setup Play Switch RESET on Switch RESET off Guess 4 digits Switch STOP off Switch STOP on

RTL Code proc module proc (reset,clk,led,stop,inc); input clk,reset,stop; input[9:0] inc; output[6:0] led; reg[6:0] led; reg[9:0] q; reg[22:0] cnt; always @(posedge reset or posedge clk) if (reset) begin cnt=0; q=10'b0000000001; end else begin if (stop) cnt = cnt+inc; if (cnt[22]==1) begin q={q[8:0],q[9]}; cnt = 0;

RTL Code proc always @(q) begin led=7'b1111111; if (q[9]==1) led=7'b0000100; if (q[8]==1) led=7'b0000000; if (q[7]==1) led=7'b0001111; if (q[6]==1) led=7'b0100000; if (q[5]==1) led=7'b0100100; if (q[4]==1) led=7'b1001100; if (q[3]==1) led=7'b0000110; if (q[2]==1) led=7'b0000110; if (q[1]==1) led=7'b1001111; if (q[0]==1) led=7'b0000001; end endmodule

RTL Code top module top (reset,clk,led,stop,an3,an2,an1,an0); input clk,reset,stop; output[6:0] led; wire[6:0] tled0,tled1,tled2,tled3,t1,t2,t3; output an3,an2,an1,an0; reg[10:0] cnt; reg tmp,an3,an2,an1,an0; assign led = (an3==0) ? tled3 : t1; assign t1 = (an2==0) ? tled2 : t2; assign t2 = (an1==0) ? tled1 : t3; assign t3 = (an0==0) ? tled0 : 7'b0000000;

RTL Code top always @(posedge reset or posedge clk) if (reset) begin an3=0; an2=1; an1=1; an0=1; end else begin cnt = cnt+1; if (cnt==0) begin tmp = an0; an0 = an1; an1 = an2; an2 = an3; an3 = tmp;

RTL Code top proc x0 (reset,clk,tled0,stop,10'd7); endmodule

Lab Debug Write Testbench Write UCF Programming FPGA Bonus Follow the procedures described in “How to Play” slide. Write UCF Programming FPGA Bonus Rewrite de-bouncing function

Appendix Four-Digit, Seven-Segment LED Display

Appendix Controlling Way