AUTO3030 Digitaalitekniikan jatkokurssi, harjoitus 5, ratkaisuja

Samankaltaiset tiedostot
AUTO3030 Digitaalitekniikan jatkokurssi, harjoitus 2, ratkaisuja

2_1----~--~r--1.~--~--~--,.~~

Verilogvs. VHDL. Janne Koljonen University of Vaasa

21~--~--~r--1~~--~--~~r--1~

VHDL Tehtävä 1 : JK-Kiikku toteutettu IF:llä

VHDL-piirikuvaus ja simulointi Quartus II ja ModelSim Altera Edition -ohjelmilla

ASM-kaavio: reset. b c d e f g. 00 abcdef. naytto1. clk. 01 bc. reset. 10 a2. abdeg. 11 a3. abcdg

VHDL-kuvauskieli. Digitaalitekniikka (piirit) Luku 17 Sivu 1 (33)

Digitaalitekniikka (piirit), kertaustehtäviä: Vastaukset

BL40A17x0 Digitaalielektroniikka A/B: Ohjelmoitavat logiikkapiirit

Joni Heikkilä PYROLYYSIGENERAATTORIN AUTOMAATIO-OHJAUS OHJELMOITAVALLA LOGIIKKAPIIRILLÄ

V H D L. Very high speed integrated circuits Hardware Description Language

Digitaalitekniikka (piirit) Luku 14 Sivu 1 (16) Sekvenssipiirit. Kombinaatiopiiri. Tilarekisteri

BL40A1711 Johdanto digitaaleketroniikkaan: Sekvenssilogiikka, pitopiirit ja kiikut

Turo Id MIKROPROSESSORIJÄRJESTELMÄN SUUNNITTELU FPGA:LLA

SIMULINK 5.0 Harjoitus. Matti Lähteenmäki

kwc Nirni: Nimen selvennys : ELEKTRONIIKAN PERUSTEET 1 Tentti La / Matti Ilmonen / Vastaukset kysymyspapereille. 0pisk.

Digitaalitekniikka (piirit) Luku 18 Sivu 1 (32) Rekisterit ja laskurit R C1 SRG4 R C1/ CTRDIV16 1R G2 2CT=15 G3 C1/2,3 + CT 3

Ongelma(t): Mistä loogisista lausekkeista ja niitä käytännössä toteuttavista loogisista piireistä olisi hyötyä tietojenkäsittelyssä ja tietokoneen

Synkronisten sekvenssipiirien suunnittelu

Ongelma(t): Mistä loogisista lausekkeista ja niitä käytännössä toteuttavista loogisista piireistä olisi hyötyä tietojenkäsittelyssä ja tietokoneen

ELEC-C5070 Elektroniikkapaja (5 op)

F = AB AC AB C C Tarkistus:

c) loogiset funktiot tulojen summana B 1 = d) AND- ja EXOR-porteille sopivat yhtälöt

SULAUTETTUJEN JÄRJESTELMIEN AMMATILLISET ERIKOISTUMISOPINNOT (30 op)

VAASAN YLIOPISTO TEKNILLINEN TIEDEKUNTA AUTOMAATIOTEKNIIKKA. Otto Nurmi FPGA-TEKNIIKAN OPETUKSEN KEHITTÄMINEN

Inputs: b; x= b 010. x=0. Elektroniikkajärjestelmät ETT_2068

Digitaalitekniikan matematiikka Luku 3 Sivu 1 (19) Kytkentäfunktiot ja perusporttipiirit

ELEC-C3240 Elektroniikka 2

BM20A5840 Usean muuttujan funktiot ja sarjat Harjoitus 7, Kevät 2018

Digitaalilaitteen signaalit

Harjoitus 6 -- Ratkaisut

Sekvenssipiirin tilat. Synkroninen sekvenssipiiri ? 1 ? 2


Luku- ja merkkikoodit. Digitaalitekniikan matematiikka Luku 12 Sivu 1 (15)

Sekvenssipiirin tilat

A/D-muuntimia. Flash ADC

Harjoitus 6: Simulink - Säätöteoria. Syksy Mat Sovelletun matematiikan tietokonetyöt 1

Flowcode 6 Omien komponenttien luonti 3D- tilassa Ledi

C = P Q S = P Q + P Q = P Q. Laskutoimitukset binaariluvuilla P -- Q = P + (-Q) (-Q) P Q C in. C out

Digitaalitekniikka (piirit) Luku 15 Sivu 1 (17) Salvat ja kiikut 1D C1 C1 1T 1J C1 1K S R

LIITE 1 1. Tehtävänä on mallintaa kitara ohjeiden mukaan käyttäen Edit Poly-tekniikkaa.

Mediaanisuodattimet. Tähän asti käsitellyt suodattimet ovat olleet lineaarisia. Niille on tyypillistä, että. niiden ominaisuudet tunnetaan hyvin

Kombinatorisen logiikan laitteet

Pakettisynkronointitestauksen automaatio

ELEC-C3240 Elektroniikka 2 Digitaalielektroniikka Karnaugh n kartat ja esimerkkejä digitaalipiireistä

1 Muutokset piirilevylle

6. Arkkitehtuurityylit

Radioamatöörikurssi 2015

Piirien väliset ohjaus- ja tiedonsiirtoväylät H. Honkanen

TIEP114 Tietokoneen rakenne ja arkkitehtuuri, 3 op. Assembly ja konekieli

VHDL/Verilog/SystemC. Jukka Jokelainen

Tietokonearkkitehtuuri 2 TKT-3201 (5 op)

Ajattelemme tietokonetta yleensä läppärinä tai pöytäkoneena

Harjoitustehtävien ratkaisut

7.4 Variability management

Object Framework - One. OF-1 is a high-productive Multi-UI OpenEdge data driven development framework. Veli-Matti Korhonen

Käytännön logiikkapiirit ja piirrosmerkit

0 v i v j / E, M ij = 1 v i v j E.

Laurea-ammattikorkeakoulu. CRM-järjestelmäratkaisun toteutus - Case Firma

ALTERA DE2 KEHITYS- JA OPETUSALUSTA

x 4 e 2x dx Γ(r) = x r 1 e x dx (1)

Arduino. Kimmo Silvonen (X)

Ratkaisu. Ensimmäinen kuten P Q, toinen kuten P Q. Kolmas kuten P (Q R):

LUMECOM. Jyrsinsovellus. 1. Asennusohje 2. Käyttöohje

1. Maarittele termit/vastaa Iyhyesti. Arvostelu: 1p/oikea vaihtoehto. Ei miinuspisteita

Multivibraattorit. Bistabiili multivibraattori:

1 db Compression point

Uusi Ajatus Löytyy Luonnosta 4 (käsikirja) (Finnish Edition)

Tervetuloa jatkamaan DIGITAALI- TEKNIIKAN opiskelua! Digitaalitekniikka (piirit) Luku 0 Sivu 1 (8)

1 Tietoliikennelaboratorio V0.0. X

Muuntavat analogisen signaalin digitaaliseksi Vertaa sisääntulevaa signaalia referenssijännitteeseen Sarja- tai rinnakkaismuotoinen Tyypilliset

58131 Tietorakenteet ja algoritmit (syksy 2015)

Tilastotieteen jatkokurssi syksy 2003 Välikoe

ABT PUNNITSEVA HAARUKKAVAUNU ECONOMY

LUMECOM. Jyrsinsovellus. 1. Asennusohje 2. Käyttöohje 3. Käyttöönottokortti

Kehittyneiden Aaltomuotojen Käytettävyys HF-alueen Tiedonsiirrossa

Co-Design Yhteissuunnittelu

Ohjelmistoarkkitehtuurit. Syksy 2008

Osittavat arkkitehtuurityylit. Palveluihin perustuvat arkkitehtuurityylit. Erikoisarkkitehtuurityylit

Radioamatöörikurssi 2017

VAIKUTTAVA INSIGHT JA INSIGHT-ORGANISAATIO. Poiminnat Esomarin konferenssista, Berliini Anu Bergius, kehityspäällikkö

3. Käsiteanalyysi ja käsitekaavio

TIEP114 Tietokoneen rakenne ja arkkitehtuuri, 3 op. Assembly ja konekieli

TASONSIIRTOJEN ja VAHVISTUKSEN SUUNNITTELU OPERAATIOVAHVISTINKYTKENNÖISSÄ

Suomalainen koulutusosaaminen vientituotteena

HY / Matematiikan ja tilastotieteen laitos Vektorianalyysi I, syksy 2017 Harjoitus 1 Ratkaisuehdotukset. I.1. Todista Cauchyn-Schwarzin epäyhtälö

Tentin materiaali. Sivia: luvut 1,2, , ,5. MacKay: luku 30. Gelman, 1995: Inference and monitoring convergence

Machine Control Studio - Kuinka päästä alkuun. Ohjelmointiympäristö Unidrive M ja MCi2x0 laitteille

Signaalien datamuunnokset. Näytteenotto ja pito -piirit

SaSun VK1-tenttikysymyksiä 2019 Enso Ikonen, Älykkäät koneet ja järjestelmät (IMS),

MAB Jussi Tyni. Lue ohjeet huolellisesti! Tee pisteytysruudukko konseptin yläkertaan. Muista kirjoittaa nimesi. Kysymyspaperin saa pitää.

Matemaattinen Analyysi

MILDRED JA DATANHALLINNAN TUKI HELSINGIN YLIOPISTOSSA

Elementtirakenteiset Kylmä- ja Pakastehuoneet Prefabricated Cold and Freezer Rooms

Ohjelmointiharjoituksia Arduino-ympäristössä

TEKNILLINEN KORKEAKOULU Systeemianalyysin laboratorio. Mat Systeemien Identifiointi. 4. harjoitus

MAA Jussi Tyni Lue ohjeet huolellisesti! Tee pisteytysruudukko konseptin yläkertaan. Muista kirjoittaa nimesi. Kysymyspaperin saa pitää.

K3K M2K HHA K3K20 0

HMM ja geenien etsintä

Transkriptio:

AUTO3030 Digitaalitekniikan jatkokurssi, harjoitus 5, ratkaisuja s2009 Tehtävien ratkaisussa käytän yhteistä top-level -suunnitteluyksikköä, jonka komponentilla toteutetaan erilaiset piirin topologiat. Top-level on: -- Janne Koljonen -- University of Vaasa -- 12.11.2009 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; -- Top-level entity: change the architecture of the component in the for...use clause. entity Tablesum is generic(bits : Natural := 4); port( reset, clock : in std_logic; x0: in std_logic_vector(bits-1 downto 0); x1: in std_logic_vector(bits-1 downto 0); x2: in std_logic_vector(bits-1 downto 0); x3: in std_logic_vector(bits-1 downto 0); x4: in std_logic_vector(bits-1 downto 0); x5: in std_logic_vector(bits-1 downto 0); y0: out std_logic_vector(bits-1 downto 0); y1: out std_logic_vector(bits-1 downto 0); y2: out std_logic_vector(bits-1 downto 0); y3: out std_logic_vector(bits-1 downto 0); y4: out std_logic_vector(bits-1 downto 0); y5: out std_logic_vector(bits-1 downto 0) ); end Tablesum; architecture arch of Tablesum is component Tablesum2 is generic(bits : Natural); port( reset, clock : in std_logic; x0: in std_logic_vector(bits-1 downto 0); x1: in std_logic_vector(bits-1 downto 0); x2: in std_logic_vector(bits-1 downto 0); x3: in std_logic_vector(bits-1 downto 0); x4: in std_logic_vector(bits-1 downto 0); x5: in std_logic_vector(bits-1 downto 0); y0: out std_logic_vector(bits-1 downto 0); y1: out std_logic_vector(bits-1 downto 0); y2: out std_logic_vector(bits-1 downto 0); jako@uwasa.fi 1

y3: out std_logic_vector(bits-1 downto 0); y4: out std_logic_vector(bits-1 downto 0); y5: out std_logic_vector(bits-1 downto 0) ); end component; for u1: Tablesum2 use entity Work.Tablesum2(arch4); u1: Tablesum2 generic map(bits) port map(reset, clock, x0, x1, x2, x3, x4, x5, y0, y1, y2, y3, y4, y5); end arch; ja komponentin entity: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; -- Component entity with different architectures entity Tablesum2 is generic(bits : Natural); port( reset, clock : in std_logic; x0: in std_logic_vector(bits-1 downto 0); x1: in std_logic_vector(bits-1 downto 0); x2: in std_logic_vector(bits-1 downto 0); x3: in std_logic_vector(bits-1 downto 0); x4: in std_logic_vector(bits-1 downto 0); x5: in std_logic_vector(bits-1 downto 0); y0: out std_logic_vector(bits-1 downto 0); y1: out std_logic_vector(bits-1 downto 0); y2: out std_logic_vector(bits-1 downto 0); y3: out std_logic_vector(bits-1 downto 0); y4: out std_logic_vector(bits-1 downto 0); y5: out std_logic_vector(bits-1 downto 0) ); end Tablesum2; 1. Data path, pipelining, synkroninen logiikka Oletetaan, että pitää laskea 5-paikkaisen syötevektorin x summia seuraavasti: n y n = x i, jossa n = {0, 1,, 5} ja x i on b-bittinen luku. i= 0 Tee VHDL-kuvaus piiristä, joka laskee summat seuraavasti: y 0 = x 0, y 1 = y 0 + x 1, jne. Kellota piiri siten, että summan ulostuloissa on D-kiikut. -- Pipeline: kiikku ulostulossa. architecture arch1 of Tablesum2 is jako@uwasa.fi 2

y0 <= (others => '0'); y1 <= (others => '0'); y2 <= (others => '0'); y3 <= (others => '0'); y4 <= (others => '0'); y5 <= (others => '0'); y0 <= x0; y1 <= x0 + x1; y2 <= x0 + x1 + x2; y3 <= x0 + x1 + x2 + x3; y4 <= x0 + x1 + x2 + x3 + x4; y5 <= x0 + x1 + x2 + x3 + x4 + x5; end arch1; 2. Summat 2 Tee VHDL-kuvaus piiristä, joka laskee tehtävän 1 summat seuraavasti: y 0 = x 0, y 1 = y 0 + x 1, jne. Kellota piiri siten, että jokaisen välisumman ulostulossa on D-kiikku. Muista viivästää myös muita signaaleja D-kiikuilla. -- Pipeline: kiikut jokaisen summaimen jälkeen. -- Ulostulojen latenssiviiveet yhdenmukaistettu. architecture arch3 of Tablesum2 is -- Latenssiviivesignaalit signal s_x2_1, s_x3_1, s_x3_2, s_x4_1, s_x4_2, s_x4_3, s_x5_1, s_x5_2, s_x5_3, s_x5_4, s_x6_1, s_x6_2, s_x6_3, s_x6_4, s_x6_5 : std_logic_vector(bits-1 downto 0); signal s_y0_1, s_y0_2, s_y0_3, s_y0_4 : std_logic_vector(bits-1 downto 0); signal s_y1_1, s_y1_2, s_y1_3, s_y1_4 : std_logic_vector(bits-1 downto 0); signal s_y2_2, s_y2_3, s_y2_4 : std_logic_vector(bits-1 downto 0); signal s_y3_3, s_y3_4 : std_logic_vector(bits-1 downto 0); signal s_y4_4 : std_logic_vector(bits-1 downto 0); s_x2_1 <= (others => '0'); s_x3_1 <= (others => '0'); s_x3_2 <= (others => '0'); s_x4_1 <= (others => '0'); s_x4_2 <= (others => '0'); s_x4_3 <= (others => '0'); s_x5_1 <= (others => '0'); s_x5_2 <= (others => '0'); s_x5_3 <= (others => '0'); jako@uwasa.fi 3

s_x5_4 <= (others => '0'); s_y0_1 <= (others => '0'); s_y0_2 <= (others => '0'); s_y0_3 <= (others => '0'); s_y0_4 <= (others => '0'); y0 <= (others => '0'); s_y1_1 <= (others => '0'); s_y1_2 <= (others => '0'); s_y1_3 <= (others => '0'); s_y1_4 <= (others => '0'); y1 <= (others => '0'); s_y2_2 <= (others => '0'); s_y2_3 <= (others => '0'); s_y2_4 <= (others => '0'); y2 <= (others => '0'); s_y3_3 <= (others => '0'); s_y3_4 <= (others => '0'); y3 <= (others => '0'); s_y4_4 <= (others => '0'); y4 <= (others => '0'); y5 <= (others => '0'); -- 1. kerros s_x2_1 <= x2; s_x3_1 <= x3; s_x4_1 <= x4; s_x5_1 <= x5; s_y0_1 <= x0; s_y1_1 <= x0 + x1; -- 2. kerros s_x3_2 <= s_x3_1; s_x4_2 <= s_x4_1; s_x5_2 <= s_x5_1; s_y0_2 <= s_y0_1; s_y1_2 <= s_y1_1; s_y2_2 <= s_y1_1 + s_x2_1; -- 3. kerros s_x4_3 <= s_x4_2; s_x5_3 <= s_x5_2; s_y0_3 <= s_y0_2; s_y1_3 <= s_y1_2; s_y2_3 <= s_y2_2; s_y3_3 <= s_y2_2 + s_x3_2; -- 4. kerros s_x5_4 <= s_x5_3; s_y0_4 <= s_y0_3; jako@uwasa.fi 4

s_y1_4 <= s_y1_3; s_y2_4 <= s_y2_3; s_y3_4 <= s_y3_3; s_y4_4 <= s_y3_3 + s_x4_3; -- 5. kerros y0 <= s_y0_4; y1 <= s_y1_4; y2 <= s_y2_4; y3 <= s_y3_4; y4 <= s_y4_4; y5 <= s_y4_4 + s_x5_4; end arch3; 3. Summat 3 Tee VHDL-kuvaus piiristä, joka laskee tehtävän 1 summat käyttäen sopivaa pyramidirakennetta (tarvitaan kolme laskentakerrosta). Kellota piiri kerroksittain. Muista viivästää myös muita signaaleja D-kiikuilla. -- Rinnakkaissuutta hyödyntävä ratkaisu. -- Ulostulojen latenssiviiveet yhdenmukaistettu. architecture arch4 of Tablesum2 is -- Apusummat signal s_x23_1, s_x45_1, s_x45_2 : std_logic_vector(bits-1 downto 0); -- Latenssiviivesignaalit signal s_x2_1, s_x4_1, s_x4_2 : std_logic_vector(bits-1 downto 0); signal s_y0_1, s_y0_2 : std_logic_vector(bits-1 downto 0); signal s_y1_1, s_y1_2 : std_logic_vector(bits-1 downto 0); signal s_y2_2 : std_logic_vector(bits-1 downto 0); signal s_y3_2 : std_logic_vector(bits-1 downto 0); s_x23_1 <= (others => '0'); s_x45_1 <= (others => '0'); s_x45_2 <= (others => '0'); s_y0_1 <= (others => '0'); s_y0_2 <= (others => '0'); y0 <= (others => '0'); s_y1_1 <= (others => '0'); s_y1_2 <= (others => '0'); y1 <= (others => '0'); s_y2_2 <= (others => '0'); y2 <= (others => '0'); jako@uwasa.fi 5

s_y3_2 <= (others => '0'); y3 <= (others => '0'); y4 <= (others => '0'); y5 <= (others => '0'); -- 1. kerros s_x2_1 <= x2; s_x4_1 <= x4; s_x23_1 <= x2 + x3; s_x45_1 <= x4 + x5; s_y0_1 <= x0; s_y1_1 <= x0 + x1; -- 2. kerros s_x4_2 <= s_x4_1; s_x45_2 <= s_x45_1; s_y0_2 <= s_y0_1; s_y1_2 <= s_y1_1; s_y2_2 <= s_y1_1 + s_x2_1; s_y3_2 <= s_y1_1 + s_x23_1; -- 3. kerros y0 <= s_y0_2; y1 <= s_y1_2; y2 <= s_y2_2; y3 <= s_y3_2; y4 <= s_x4_2 + s_y3_2; y5 <= s_x45_2 + s_y3_2; end arch4; 4. Summat 4 Tee VHDL-kuvaus piiristä, joka laskee tehtävän 1 summat iteratiivisesti yhdellä summaimella. -- Iteratiivinen ratkaisu. Vastaa sekventiaalista ohjelmaa. architecture arch0 of Tablesum2 is signal s_y0, s_y1, s_y2, s_y3, s_y4, s_y5 : std_logic_vector(bits- 1 downto 0); variable i : Natural; i := 0; s_y0 <= (others => '0'); s_y1 <= (others => '0'); s_y2 <= (others => '0'); s_y3 <= (others => '0'); s_y4 <= (others => '0'); s_y5 <= (others => '0'); jako@uwasa.fi 6

case i is when 0 => s_y0 <= x0; s_y1 <= x0 + x1; when 1 => s_y2 <= s_y1 + x2; when 2 => s_y3 <= s_y2 + x3; when 3 => s_y4 <= s_y3 + x4; when 4 => s_y5 <= s_y4 + x5; when 5 => y0 <= s_y0; y1 <= s_y1; y2 <= s_y2; y3 <= s_y3; y4 <= s_y4; y5 <= s_y5; i := 0; when others => i := 0; end case; end arch0; jako@uwasa.fi 7