Lenguaje VHDL. Diseño de sistemas digitales secuenciales



Similar documents
Digital Design with VHDL

12. A B C A B C A B C 1 A B C A B C A B C JK-FF NETr

VGA video signal generation

VHDL programmering H2

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

An Example VHDL Application for the TM-4

! " # # $ '"() * #! +, # / $0123$

Lab 7: VHDL 16-Bit Shifter

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

(1) D Flip-Flop with Asynchronous Reset. (2) 4:1 Multiplexor. CS/EE120A VHDL Lab Programming Reference

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Red de Revistas Científicas de América Latina y el Caribe, España y Portugal. Universidad Autónoma del Estado de México

Digital Systems Design. VGA Video Display Generation

VHDL GUIDELINES FOR SYNTHESIS

Digital Design with Synthesizable VHDL

A CPLD VHDL Introduction

Digital Fundamentals

Using Xilinx ISE for VHDL Based Design

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

Sprites in Block ROM

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

Asynchronous & Synchronous Reset Design Techniques - Part Deux

From VHDL to FPGA

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Step : Create Dependency Graph for Data Path Step b: 8-way Addition? So, the data operations are: 8 multiplications one 8-way addition Balanced binary

Hardware Implementation of the Stone Metamorphic Cipher

CPE 462 VHDL: Simulation and Synthesis

EE 1130 Freshman Eng. Design for Electrical and Computer Eng.

Técnicas Avanzadas de Inteligencia Artificial Dpt. Lenguajes y Sistemas Informáticos. FISS. UPV-EHU

Quartus II Introduction for VHDL Users

DIPLOMADO DE JAVA - OCA

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

Práctica 1: PL 1a: Entorno de programación MathWorks: Simulink

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

RISC Processor Simulator (SRC) INEL 4215: Computer Architecture and Organization September 22, 2004

Digital Logic Design Sequential circuits

Finite State Machine Design and VHDL Coding Techniques

Schema XML_PGE.xsd. element GrupoInformes. attribute XML_PGE.xsd unqualified qualified

VHDL Reference Manual

VHDL Test Bench Tutorial

In this example the length of the vector is determined by D length and used for the index variable.

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

Laboratorio di Sistemi Digitali M A.A. 2010/11

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Propiedades del esquema del Documento XML de envío:

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

State Machines in VHDL

Printed Circuit Board Design with HDL Designer

From UML to HDL: a Model Driven Architectural Approach to Hardware-Software Co-Design

HPN Product Tools. Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.

Decimal Number (base 10) Binary Number (base 2)

Manejo Basico del Servidor de Aplicaciones WebSphere Application Server 6.0

New Server Installation. Revisión: 13/10/2014

Ranking de Universidades de Grupo of Eight (Go8)

1. DESCRIPCIÓN DE WEB SERVICES DE INTERCAMBIO DE DATOS CON NOTARIOS

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY

Albiral 15 Data retractable monitor, brushed stainless steel cabinet Ref: 150EJSMI

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

PA (Process. Areas) Ex - KPAs

Computer organization

AV-002: Professional Web Component Development with Java

CONCEPTS OF INDUSTRIAL AUTOMATION. By: Juan Carlos Mena Adolfo Ortiz Rosas Juan Camilo Acosta

Rotary Encoder Interface for Spartan-3E Starter Kit

LOS ANGELES UNIFIED SCHOOL DISTRICT REFERENCE GUIDE

ISSAI Control de calidad en una auditoría de estados financieros. Directriz de auditoría financiera

INGENIERíA. Scada System for a Power Electronics Laboratory. Sistema SCADA para un laboratorio de electrónica de potencia Y D E S A R R O L L O

Modeling Latches and Flip-flops

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

Floating point package user s guide By David Bishop (dbishop@vhdl.org)

D755M CONTROL CARD FOR TWO SINGLE-PHASE MOTORS 220/230 VAC TARJETA DE MANDO PARA DOS MOTORES MONOFÁSICOS 220/230 VAC INSTALLATION GUIDE

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

Chapter 5. Sequential Logic

CLASS D POWER AMPLIFIERS

Explorando Oportunidades Juntos Juntos

Registers & Counters

Agility2.0. Enterdev S.A.S. Collin Kleine

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Visión general de la integración con asanetwork

Engr354: Digital Logic Circuits

Asynchronous Counters. Asynchronous Counters

How many high-speed counters (HSCs) are provided by the SIMATIC S PLC? SIMATIC S FAQ March Service & Support. Answers for industry.

Chapter 8. Sequential Circuits for Registers and Counters

Combining the ADS1202 with an FPGA Digital Filter for Current Measurement in Motor Control Applications

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Shipping your pet to Spain

Copyright TeachMe.com 242ea 1

Coding Guidelines for Datapath Synthesis

MAX II ISP Update with I/O Control & Register Data Retention

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

Combinational Logic Design Process

Digital Design and Synthesis INTRODUCTION

Clock Data Recovery Design Techniques for E1/T1 Based on Direct Digital Synthesis Author: Paolo Novellini and Giovanni Guasti

Transcription:

Lenguaje VHDL Diseño de sistemas digitales secuenciales

Flip-Flop D 1 entity d_ff is clk: in std_logic; d: in std_logic; q: out std_logic 2 end d_ff; P3 P1 5 Q D Q Q(t+1) 0 0 0 0 1 0 1 0 1 1 1 1 architecture arch of d_ff is process(clk) P2 3 if (clk'event and clk='1') then q <= d; end 4 if; P4 end arch; 6 Q Clock D Q Q

Flip-flop con reset asíncrono entity d_ff_reset is clk, reset: in std_logic; d: in std_logic; q: out std_logic end d_ff_reset; architecture arch of d_ff_reset is process(clk,reset) if (reset='1') then q <='0'; elsif (clk'event and clk='1') then q <= d; end arch;

Flip-flop con enable síncrono entity d_ff_en is clk, reset: in std_logic; en: in std_logic; d: in std_logic; q: out std_logic end d_ff_en; architecture arch of d_ff_en is process(clk,reset) if (reset='1') then q <='0'; elsif (clk'event and clk='1') then if (en='1') then q <= d; end arch;

Quiz Diseñe un flip-flop RS, la tabla de verdad se muestra a continuación. U1 CLK R S FFSR Q QN S R Q Qt+1 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 X 1 1 1 X

Registros U1 clk q(7:0) d(7:0) reset reg_reset entity reg_reset is clk, reset: in std_logic; d: in std_logic_vector(7 downto 0 q: out std_logic_vector(7 downto 0) end reg_reset; architecture arch of reg_reset is process(clk,reset) if (reset='1') then q <=(others=>'0' elsif (clk'event and clk='1') then q <= d; end arch;

U1 clk ctrl(1:0) d(n-1:0) reset Registro de corrimiento q(n-1:0) univ_shift_reg entity univ_shift_reg is generic(n: integer := 8 clk, reset: in std_logic; ctrl: in std_logic_vector(1 downto 0 d: in std_logic_vector(n-1 downto 0 q: out std_logic_vector(n-1 downto 0) end univ_shift_reg; architecture arch of univ_shift_reg is signal r_reg: std_logic_vector(n-1 downto 0 signal r_next: std_logic_vector(n-1 downto 0 -- register process(clk,reset) if (reset='1') then r_reg <= (others=>'0' elsif (clk'event and clk='1') then r_reg <= r_next; -- next-state logic with ctrl select r_next <= r_reg when "00", --no op r_reg(n-2 downto 0) & d(0) when "01", --shift left; d(n-1) & r_reg(n-1 downto 1) when "10", --shift righ d when others; -- load -- output q <= r_reg; end arch;

Contadores use ieee.numeric_std.all; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity counter is generic (N:integer:=4 clk: in std_logic; q: inout std_logic_vector(n-1 downto 0) end counter; architecture arch of counter is process(clk) if (clk'event and clk='1') then q <= q+1; end arch;

Ejercicio Diseñe un circuito que muestre la cuenta de 0 a F (a un Hertz) en uno de los cuatro displays, la selección se realiza empleando las señales de entrada sel. Clk Reset Sel0 Sel1 Contador a 1 Hz 8 2 an

Contador up/down use ieee.numeric_std.all; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity counter_ud is generic (N:integer:=4 clk, reset, up: in std_logic; q: inout std_logic_vector(n-1 downto 0) end counter_ud; architecture arch of counter_ud is process(clk,reset,up) if (reset='1') then q<=(others=>'0' if (clk'event and clk='1') then if (up='1') then q <= q+1; else q <= q-1; end arch;

Máquinas de Mealy y Moore

Diagramas de estado Definición de tipos y señales type estados is (s0, s1, s2, s3 signal edo_presente, edo_futuro:estados; El proceso que define el comportamiento del sistema, debe considerar que el estado_futuro depende del estado_presente y de las entradas. process(edo_presente,a,b)

Diagramas de estado entity fsm is clk, reset: in std_logic; a, b: in std_logic; y0, y1: out std_logic end fsm;

process(edo_presente,a,b) architecture two of fsm is type estados is (s0, s1, s2 signal edo_presente, edo_futuro: estados; process(clk,reset) if (reset='1') then edo_presente <= s0; elsif (clk'event and clk='1') then edo_presente <= edo_futuro; y0 <= '0'; -- default 0 y1 <= '0'; -- default 0 case edo_presente is when s0 => y1 <= '1'; if a='1' then if b='1' then edo_futuro <= s2; y0 <= '1'; else edo_futuro <= s1; when s1 => y1 <= '1'; if (a='1') then edo_futuro <= s0; when s2 => edo_futuro <= s0; end case; end two;

Mejor implementación entity fsm is clk, reset: in std_logic; a, b: in std_logic; y0, y1: out std_logic end fsm; 101 110 111 000 110 architecture two_seg_arch of fsm is type estados is (s0, s1, s2 signal edo_presente, edo_futuro: estados; process(clk,reset) if (reset='1') then edo_presente <= s0; elsif (clk'event and clk='1') then edo_presente <= edo_futuro; process(edo_presente,a,b) y0 <= '0'; -- default 0 y1 <= '0'; -- default 0 case edo_presente is when s0 => 001 y1 <= '1'; if a='1' then if b='1' then 011 edo_futuro <= s2; else 010 edo_futuro <= s1; -- no else branch when s1 => y1 <= '1'; if (a='1') then edo_futuro <= s0; else edo_futuro <= s1; when s2 => y0 <= '1'; edo_futuro <= s0; end case; end two_seg_arch;

Ejercicio 000 110 001 101 011 111 010 110

Circuito anti-rebote Diseñar el código en VHDL para un circuito anti-rebotes. F library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity antirebote is port ( clk, reset,pbsync: in STD_LOGIC; pulse: out STD_LOGIC end antirebote; architecture cartasm of antirebote is type estados is (s0,s1 signal edo_presente, edo_futuro: estados; process (clk, reset) if (reset='1') then edo_presente<=s0; elsif (clk'event and CLK = '1') then edo_presente<=edo_futuro; process (edo_presente, pbsync) pulse<='0'; case edo_presente is when s0 => if (pbsync='0') then edo_futuro<=s0; else edo_futuro<=s1; pulse<='1'; when s1=> pulse<='0'; if (pbsync='1') then edo_futuro<=s1; else edo_futuro<=s0; end case; end cartasm; T F T