7-Segment Display DIO1 Board Verilog.

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

2’s Complement 4-Bit Saturator
Counters Discussion D8.3.
Verilog in transistor level using Microwind
CPSC 321 Computer Architecture Andreas Klappenecker
CDA 3100 Recitation Week 11.
Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Verilog Modules for Common Digital Functions
Table 7.1 Verilog Operators.
Case Study VLSI 系統設計與高階合成           + : delay : multiplier: adder … … + … … FIR Filter tap=4 IIR Case - Filter (1/8)
//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.
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
//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.
7-Segment Display: Spartan-3 board
Pulse-Width Modulated DAC
Conditional Statements  if and else if statements if (expression) if (expression) statements statements { else if (expression) { else if (expression)
Digilent Spartan 3 Board Lecture L2.2
A/D Converter Control Discussion D8.6 Rev. B – 3/14/2006.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Logic Design Review – 3 Basic Sequential Circuits Lecture L14.3 Verilog.
7-Segment Display DIO1 Board. Digilab2 – DIO1 Boards Four 7-segment displays A0A1A2A3.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
Lecture L6.2 VHDL Multiply Operator (*)
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
LEDs 7-Segment Displays
Division Lecture L6.3. Division
Ring Counter Discussion 11.3 Example 32.
Finite State Machines Mano and Kime Sections 4-4, 4-5, 4-8.
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.
Digilab 7-Segment Displays Lab 4. selyInstruction name “000”true if b = a false otherwise = “001”true if b /= a false otherwise “010”true if b < a.
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX.
Sequential Multiplication Lecture L6.4. Multiplication 13 x = 8Fh 1101 x
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.
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
Multiplexers Lecture L6.6v Section 6.2. Multiplexers A Digital Switch A 2-to-1 MUX A 4-to-1 MUX A Quad 2-to-1 MUX The Verilog if…else Statement TTL Multiplexer.
Introduction to Verilog Multiplexers. Introduction to Verilog Verilog Hardware Description Language (Verilog HDL) released by Gateway Design Automation.
Top-level Verilog Designs Discussion D9.1 Example 12.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
Digital Logic Review Discussion D8.7.
Code Converters Section 3-4 Mano & Kime.
Verilog Descriptions of Digital Systems. Electronic Lock // // Electronic combinational lock // module lock(seg7,key, valid_key, col, row, mclk, resetL)
Digilab2 DIO1 Board. Digilab2 – DIO1 Boards 50 MHz clock mclk Prom socket Spartan IIE.
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.
Figure 7.6. Gated SR latch. (a) Circuit Q Q R S R S R Clk Q Q S Time (c) Timing diagram Clk ? ? SR xx Q(t) (no change) 0 1.
Digital Electronics.
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
1 4-Integrating Peripherals in Embedded Systems (cont.)
Figure Implementation of an FSM in a CPLD..
Overview Logistics Last lecture Today HW5 due today
Supplement on Verilog for Algorithm State Machine Chart
Verilog Modules for Common Digital Functions
Lecture L5.1 Mealy and Moore Machines
Supplement on Verilog Sequential circuit examples: FSM
Pulse-Width Modulation (PWM)
Logic Design Review – 2 Basic Combinational Circuits
A Greatest Common Divisor (GCD) Processor
Fibonacci Sequence Lecture L4.1 Lab 3.
Supplement on Verilog Sequential circuit examples: FSM
The Verilog Hardware Description Language
Presentation transcript:

7-Segment Display DIO1 Board Verilog

Digilab2 – DIO1 Boards Four 7-segment displays A0 A1 A2 A3

DIO1 Board – Common Anodes Pins A0 A1 A2 A3 Pins AtoG(6:0)

Multiplex displays 1 0 0 0 0 1 1 0

Multiplex displays 1 0 0 0 1 1 1 1

Multiplex displays 1 1 0 0 1 1 0 0

Multiplex displays 1 0 1 1 1 0 0 0

x7seg

x7seg.v module x7seg(x,cclk,clr,AtoG,A); input [15:0] x; input cclk, clr; output [6:0] AtoG; output [3:0] A; reg [6:0] AtoG; reg [3:0] A; integer k; reg [3:0] digit; reg [1:0] count;

// ctr2bit always @(posedge cclk or posedge clr) if(clr) count <= 0; else count <= count + 1;

// Mux4 always @(x,count) case(count) 0: digit = x[15:12]; 1: digit = x[11:8]; 2: digit = x[7:4]; 3: digit = x[3:0]; default: digit = x[3:0]; endcase

// seg7dec always @(digit) case(digit) 0: AtoG = 7'b0000001; 1: AtoG = 7'b1001111; 2: AtoG = 7'b0010010; 3: AtoG = 7'b0000110; 4: AtoG = 7'b1001100; 5: AtoG = 7'b0100100; 6: AtoG = 7'b0100000; 7: AtoG = 7'b0001111; 8: AtoG = 7'b0000000; 9: AtoG = 7'b0000100; 'hA: AtoG = 7'b0001000; 'hb: AtoG = 7'b1100000; 'hC: AtoG = 7'b0110001; 'hd: AtoG = 7'b1000010; 'hE: AtoG = 7'b0110000; 'hF: AtoG = 7'b0111000; default: AtoG = 7'b0000001; // 0 endcase

Example: count = 10 A[2] = 1 A[0] = A[1] = A[3] = 0 A[3:0] = 0100 // Acode always @(count) for(k = 0; k <= 3; k = k+1) if(count == k) A[k] = 1; else A[k] = 0; endmodule Example: count = 10 A[2] = 1 A[0] = A[1] = A[3] = 0 A[3:0] = 0100

x7seg_test.v module x7seg_test(mclk,bn,led,ldg,SW,AtoG,A); input [1:8] SW; input mclk, bn; output ldg, led; output [6:0] AtoG; output [3:0] A; wire [6:0] AtoG; wire [3:0] A; wire clr, cclk, bnbuf; reg [23:0] clkdiv; wire [7:0] fix;

IBUFG U00 (.I (bn), .O (bnbuf)); assign led = bnbuf; assign clr = bnbuf; assign ldg = 1; // enable 74HC373 latch // Divide the master clock (50Mhz) always @(posedge mclk) begin clkdiv <= clkdiv + 1; end assign cclk = clkdiv[17]; // 190 Hz assign fix = 8'b10100101; x7seg U1(.x({fix,SW}),.cclk(cclk),.clr(clr),.AtoG(AtoG),.A(A)); endmodule