7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX.

Slides:



Advertisements
Similar presentations
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Advertisements

Arbitrary Waveform Discussion 5.5 Example 34.
Multiplexer as a Universal Element Discussion D2.6 Example 9.
7-Segment Display: Spartan-3 board
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
A Simple Microcontroller VHDL Tutorial R. E. Haskell and D. M. Hanna T6: VHDL State Machines.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
Integer Square Root.
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
Digilent Spartan 3 Board Lecture L2.2
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
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.
Lab 6 Program Counter and Program ROM Mano & Kime Sections 7-1 – 7-6.
Finite State Machines Discussion D7.1 Mealy and Moore Machines.
Multiplication Discussion Multiplier Binary Multiplication 4 x 4 Multiplier.
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.
Division Lecture L6.3. Division
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
FPGAs and VHDL Lecture L13.1 Sections 13.1 – 13.3.
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.
Finite State Machines Discussion D8.1 Example 36.
Digilent Spartan 3 Board Discussion D3.3
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
Introduction to VHDL Multiplexers Discussion D1.1.
Lab 3 & 4 Discussion EE414/514 VHDL Design September 25.
Division Discussion D11.3. Division
Registers Lab 5 Mano and Kime Sections 5-2, 5-3, 5-7.
Sequential Multiplication Lecture L6.4. Multiplication 13 x = 8Fh 1101 x
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
7-Segment Display DIO1 Board Verilog.
VHDL Examples Subra Ganesan Reference: Professor Haskell’s Notes,
Code Converters Section 3-4 Mano & Kime.
ECE 448: Spring 12 Lab 4 – Part 2 Finite State Machines Basys2 FPGA Board.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Digilab2 DIO1 Board. Digilab2 – DIO1 Boards 50 MHz clock mclk Prom socket Spartan IIE.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
ENG2410 Digital Design LAB #8 LAB #8 Data Path Design.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
ENG2410 Digital Design LAB #5 Modular Design and Hierarchy using VHDL.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
Prime Numbers Lecture L6.1 Sieve of Eratosthenes.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
LAB #5 Modular Design and Hierarchy using VHDL
Combinational logic circuit
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Part II A workshop by Dr. Junaid Ahmed Zubairi
Combinational Circuits Using VHDL
مدار های ترکیبی دیکدر لامپ های هفت قسمتی یکی از دیکدر هایی که اغلب به کار برده می شود،دیکدر 4 به 7 برای تبدیل کد bcd به کد هفت بیتی برای لامپ های seven.
A Data Stack CoreGen Discussion 12.1.
A Greatest Common Divisor (GCD) Processor
Fibonacci Sequence Lecture L4.1 Lab 3.
Multiplication Discussion 11.1.
Fast, Asynchronous SRAM
Data Stack and Return Stack
CprE / ComS 583 Reconfigurable Computing
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
Presentation transcript:

7-Segment Displays VHDL Tutorial R. E. Haskell and D. M. Hanna T4: Xilinx LogiBLOX

7-Segment Decoder a-g LOW to turn on segment

library IEEE; use IEEE.std_logic_1164.all; entity seg7dec is port (q: in STD_LOGIC_VECTOR(3 downto 0); AtoG: out STD_LOGIC_VECTOR(6 downto 0)); end seg7dec; 7-Segment Decoder

architecture seg7dec_arch of seg7dec is begin process(q) begin case q is when "0000" => AtoG <= " "; when "0001" => AtoG <= " "; when "0010" => AtoG <= " "; when "0011" => AtoG <= " "; when "0100" => AtoG <= " "; when "0101" => AtoG <= " "; when "0110" => AtoG <= " "; when "0111" => AtoG <= " "; when "1000" => AtoG <= " "; when "1001" => AtoG <= " "; when "1010" => AtoG <= " "; when "1011" => AtoG <= " "; when "1100" => AtoG <= " "; when "1101" => AtoG <= " "; when "1110" => AtoG <= " "; when others => AtoG <= " "; end case; end process; end seg7dec_arch;

Digilab Board dig3dig2dig1dig4

Digilab Board – Common Anodes A4 A3 A2 A1 CA CB CC CD CE CF CG Pins

Multiplex displays

Multiplex displays

Multiplex displays

Multiplex displays

mux4 ctr2bit Acode seg7dec dig7seg dig1(3:0) dig2(3:0) dig3(3:0) dig4(3:0) clk anode(3:0) AtoG(6:0) A(4:1) Multiplex displays Asel(1:0) Aen(3:0) y1(3:0)

dig7seg entity dig7seg is port ( anode: in STD_LOGIC_VECTOR (3 downto 0); dig1: in STD_LOGIC_VECTOR (3 downto 0); dig2: in STD_LOGIC_VECTOR (3 downto 0); dig3: in STD_LOGIC_VECTOR (3 downto 0); dig4: in STD_LOGIC_VECTOR (3 downto 0); clk: in STD_LOGIC; AtoG: out STD_LOGIC_VECTOR (6 downto 0); A: out STD_LOGIC_VECTOR (4 downto 1) ); end dig7seg;

dig7seg architecture dig7seg_arch of dig7seg is signal y1: STD_LOGIC_VECTOR (3 downto 0); signal sel2: STD_LOGIC_VECTOR (1 downto 0); begin u0: ctr2bit port map (CLOCK => clk, Q_OUT => sel2); u1: mux4g port map (a => dig1, b => dig2, c => dig3, d => dig4, sel => sel2, y => y1); u2: seg7dec port map (q => y1, AtoG => AtoG); u3: Acode port map (Aen => anode, Asel => sel2, A => A); end dig7seg_arch;

ctr2bit -- A 2-bit up-counter library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity ctr2bit is port ( clr: in STD_LOGIC; clk: in STD_LOGIC; q: out STD_LOGIC_VECTOR (1 downto 0) ); end ctr2bit;

ctr2bit (cont.) architecture ctr2bit_arch of ctr2bit is begin process (clk, clr) variable COUNT: STD_LOGIC_VECTOR (1 downto 0); begin if clr = '1' then q <= "00"; elsif clk'event and clk='1' then COUNT := COUNT + 1; q <= COUNT; end if; end process; end ctr2bit_arch;

library IEEE; use IEEE.std_logic_1164.all; entity Acode is port ( Aen: in STD_LOGIC_VECTOR (3 downto 0); Asel: in STD_LOGIC_VECTOR (1 downto 0); A: out STD_LOGIC_VECTOR (3 downto 0) ); end Acode; Acode

architecture Acode_arch of Acode is begin process(Aen, Asel) begin A <= "0000"; case Asel is when "00" => if Aen(0) = '1' then A <= "0001"; end if; when "01" => if Aen(1) = '1' then A <= "0010"; end if; when "10" => if Aen(2) = '1' then A <= "0100"; end if; when others => if Aen(3) = '1' then A <= "1000"; end if; end case; end process; end Acode_arch;

step_display

library IEEE; use IEEE.std_logic_1164.all; entity step_display is port ( dig1, dig2: in STD_LOGIC_VECTOR (3 downto 0); dig3, dig4: in STD_LOGIC_VECTOR (3 downto 0); step: in STD_LOGIC; clr: in STD_LOGIC; clkout: out STD_LOGIC; clrout: out STD_LOGIC; AtoG: out STD_LOGIC_VECTOR (6 downto 0); A: out STD_LOGIC_VECTOR (4 downto 1) ); end step_display;

architecture step_display_arch of step_display is signal anode: STD_LOGIC_VECTOR (3 downto 0); signal clk4: STD_LOGIC; begin anode <= "1111"; clrout <= clr; u1: dig7seg port map (anode => anode, dig4 => dig4, dig3 => dig3, dig2 => dig2, dig1 => dig1, clk => clk4, AtoG => AtoG, A => A); u2: osc_4k port map (clk => clk4); u3: debounce port map (inp => step, clk => clk4, clr => clr, outp => clkout); end step_display_arch;

T4 Lab Exercise

T4main library IEEE; use IEEE.std_logic_1164.all; entity T4main is port ( SW: in STD_LOGIC_VECTOR (1 to 8); BTN: in STD_LOGIC_VECTOR (1 to 4); LD: out STD_LOGIC_VECTOR (1 to 8); AtoG: out STD_LOGIC_VECTOR (6 downto 0); A: out STD_LOGIC_VECTOR (3 downto 0) ); end T4main;

architecture T4main_arch of T4main is signal tin, T, N, y: std_logic_vector(7 downto 0); signal clr, clk: std_logic; begin U0: mux2 port map (a =>y, b => SW, sel => SW(1), y => tin); Treg: reg port map (d => tin, load => SW(2), clr => clr, clk =>clk, q => T); Nreg: reg port map (d => T, load => SW(3), clr => clr, clk =>clk, q => N); U1: alu port map (a => T, b => N, sel => SW(4 to 5), y => y); U2: step_display port map (dig1 => T(3 downto 0), dig2 => T(7 downto 4), dig3 => N(3 downto 0), dig4 => N(7 downto 4), step => BTN(4), clr => BTN(1), clkout => clk, clrout => clr, A => A, AtoG => AtoG); LD <= SW; end T4main_arch;